security: fix security_file_lock cmd argument
authorSten Spans <Sten_Spans@genua.de>
Thu, 16 Jul 2009 07:41:39 +0000 (09:41 +0200)
committerJames Morris <jmorris@namei.org>
Thu, 16 Jul 2009 21:41:23 +0000 (07:41 +1000)
Pass posix-translated lock operations to security_file_lock
when invoked via sys_flock.

Signed-off-by: Sten Spans <Sten_Spans@genua.de>
Signed-off-by: James Morris <jmorris@namei.org>
fs/locks.c

index b6440f52178fad125f3d0101d7a97f82ad2cf3ee..52366e877d7636a04078bdd14133f30be6459f5d 100644 (file)
@@ -1591,7 +1591,7 @@ SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd)
        if (can_sleep)
                lock->fl_flags |= FL_SLEEP;
 
-       error = security_file_lock(filp, cmd);
+       error = security_file_lock(filp, lock->fl_type);
        if (error)
                goto out_free;