From 39cfb2393549ce37efd586b941f720b379bf2f45 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Sat, 15 Jan 2005 17:09:53 +0000 Subject: [PATCH] Fix ACLs handling for the root file system. Without this fix, when ACLs are set via tunefs(8) on the root file system, they are removed on boot when 'mount -a' is called, because mount(8) called for the root file system always add MNT_UPDATE flag and MNT_UPDATE flag isn't perfect. Now, one cannot remove ACLs stored in superblock (configured with tunefs(8)) via 'mount -a' nor 'mount -u -o noacls ', but it is still possible to mount file system which doesn't have ACLs in superblock via 'mount -o acls ' or /etc/fstab's 'acls' option. Reported by: Lech Lorens/pl.comp.os.bsd Discussed with: phk, rwatson Reviewed by: rwatson MFC after: 2 weeks --- sys/ufs/ffs/ffs_vfsops.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 9ca5ccd8abc..50791c2ca04 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -279,6 +279,11 @@ ffs_mount(struct mount *mp, struct thread *td) */ if (mp->mnt_flag & MNT_SOFTDEP) mp->mnt_flag &= ~MNT_ASYNC; + /* + * Keep MNT_ACLS flag if it is stored in superblock. + */ + if ((fs->fs_flags & FS_ACLS) != 0) + mp->mnt_flag |= MNT_ACLS; /* * If not updating name, process export requests. */