]> err.no Git - util-linux/commit
lomount.c: don't use mlockall if CRYPT_NONE
authorMasatake YAMATO <jet@gyve.org>
Tue, 8 May 2007 11:52:18 +0000 (11:52 +0000)
committerKarel Zak <kzak@redhat.com>
Tue, 10 Jul 2007 12:05:45 +0000 (14:05 +0200)
commitd33279c2e3bdaff7a3c9c7f6df60da75d7969ad4
treeb779c5b1d19c1adfdb54396afdcf4131747eef26
parentbb6aacfecaaa4d70a2c46e9151bb67503a35a781
lomount.c: don't use mlockall if CRYPT_NONE

loop back mounting emits two system calls: mount and mlockall.
mount is obviously needed. mlockall is needed for encryption.
As the result both CAP_SYS_ADMIN and CAP_IPC_LOCK are needed
to do loopback mounting.

The problem is that CAP_IPC_LOCK is always needed through my
command doesn't need encryption.

With the following patch, mount calls mlockall only when
encryption is needed.

Signed-off-by: Masatake YAMATO <jet@gyve.org>
mount/lomount.c