]> err.no Git - util-linux/commit
mount: should set proper permissions on locktime
authorFlávio Leitner <fleitner@redhat.com>
Tue, 31 Jul 2007 10:42:14 +0000 (12:42 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 31 Jul 2007 10:44:31 +0000 (12:44 +0200)
commit1002156a0667a9c907465db39e758f74152e73e4
tree26ccb8853e13c7ad8ce58a4c54c6ed886439791e
parent2018629905d3d881ff3fddf76552b6e79091f2b8
mount: should set proper permissions on locktime

When creating the "/etc/mtab~" lockfile (specifically 'linktargetfile'  in the
lock_mtab function), the file is created with incorrect permissions ('000')
which necessitates root to leverage CAP_DAC_OVERRIDE. If proper file modes (it
would appear 0600 would be sufficient) were used in the open this would
function properly with CAP_DAC_OVERRIDE revoked.

  $ sysctl -w kernel.cap-bound=0xf7fd7df5
  $ mount -t tmpfs /dev/swap /mnt
  can't open lock file /etc/mtab~: Permission denied (use -n flag to override)

Signed-off-by: Flávio Leitner <fleitner@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
mount/fstab.c