]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- .snapshots must not have group root if it is not group-writable
authorArvin Schnell <aschnell@suse.de>
Thu, 18 Oct 2012 13:20:02 +0000 (15:20 +0200)
committerArvin Schnell <aschnell@suse.de>
Thu, 18 Oct 2012 13:20:02 +0000 (15:20 +0200)
doc/snapper.8.in
package/snapper.changes
snapper/Filesystem.cc

index 13dc01b4925665207f1a83d8249716d17dc82ff9..0b9ad45742673d20fffeafd0c947d5f483cba88c 100644 (file)
@@ -224,8 +224,8 @@ algorithms are number, timeline and empty-pre-post.
 Non-root users can be allowed to use a configuration by setting ALLOW_USERS or
 ALLOW_GROUPS in the config file. For all operations to work the user must also
 be able to read and access the .snapshots directory inside the
-subvolume. The .snapshots directory must have owner and group root. The
-directory must not be writable by anybody else.
+subvolume. The .snapshots directory must be owned by root and must not be
+writable by anybody else.
 
 .SH "FILES"
 .TP
index 4a0a00bb8b5a668dc78b743fce6d099e62652b1a..c389135c0a9ee8d61c96d4011171c6bd2dc4ce82 100644 (file)
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Thu Oct 18 15:11:49 CEST 2012 - aschnell@suse.de
+
+- .snapshots must not have group root if it is not group-writable
+
 -------------------------------------------------------------------
 Mon Oct 15 10:40:07 CEST 2012 - aschnell@suse.de
 
index 1067b67b8aeeed8699e57909fdbb8042b5752638..74f960d5422ca54a7fe5d5213acd7c83603d495d 100644 (file)
@@ -287,15 +287,21 @@ namespace snapper
            throw IOErrorException();
        }
 
-       if (stat.st_uid != 0 || stat.st_gid != 0)
+       if (stat.st_uid != 0)
        {
-           y2err("owner/group of .snapshots wrong");
+           y2err(".snapshots must have owner root");
+           throw IOErrorException();
+       }
+
+       if (stat.st_gid != 0 && stat.st_mode & S_IWGRP)
+       {
+           y2err(".snapshots must have group root or must not be group-writable");
            throw IOErrorException();
        }
 
        if (stat.st_mode & S_IWOTH)
        {
-           y2err("permissions of .snapshots wrong");
+           y2err(".snapshots must not be world-writable");
            throw IOErrorException();
        }
 
@@ -730,15 +736,21 @@ namespace snapper
            throw IOErrorException();
        }
 
-       if (stat.st_uid != 0 || stat.st_gid != 0)
+       if (stat.st_uid != 0)
+       {
+           y2err(".snapshots must have owner root");
+           throw IOErrorException();
+       }
+
+       if (stat.st_gid != 0 && stat.st_mode & S_IWGRP)
        {
-           y2err("owner/group of .snapshots wrong");
+           y2err(".snapshots must have group root or must not be group-writable");
            throw IOErrorException();
        }
 
        if (stat.st_mode & S_IWOTH)
        {
-           y2err("permissions of .snapshots wrong");
+           y2err(".snapshots must not be world-writable");
            throw IOErrorException();
        }