summaryrefslogtreecommitdiffstats
path: root/fuse/ulockmgr.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--fuse/ulockmgr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fuse/ulockmgr.c b/fuse/ulockmgr.c
index 4a049d5b2..f0523ae70 100644
--- a/fuse/ulockmgr.c
+++ b/fuse/ulockmgr.c
@@ -400,6 +400,10 @@ int ulockmgr_op(int fd, int cmd, struct flock *lock, const void *owner,
if (cmd != F_GETLK && cmd != F_SETLK && cmd != F_SETLKW)
return -EINVAL;
+ if (lock->l_type != F_RDLCK && lock->l_type != F_WRLCK &&
+ lock->l_type != F_UNLCK)
+ return -EINVAL;
+
if (lock->l_whence != SEEK_SET && lock->l_whence != SEEK_CUR &&
lock->l_whence != SEEK_END)
return -EINVAL;