From: Arvin Schnell Date: Wed, 5 Sep 2012 12:06:59 +0000 (+0200) Subject: - check permissions of .snapshots X-Git-Tag: v0.1.3~111 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=2e12e3a4a9fde45709ee84e1c8a41306f1683817;p=thirdparty%2Fsnapper.git - check permissions of .snapshots --- diff --git a/snapper/Filesystem.cc b/snapper/Filesystem.cc index 526a0e70..7312f6dc 100644 --- a/snapper/Filesystem.cc +++ b/snapper/Filesystem.cc @@ -269,7 +269,13 @@ namespace snapper if (stat.st_uid != 0 || stat.st_gid != 0) { - y2err("owner of .snapshots wrong"); + y2err("owner/group of .snapshots wrong"); + throw IOErrorException(); + } + + if (stat.st_mode & S_IWOTH) + { + y2err("permissions of .snapshots wrong"); throw IOErrorException(); } @@ -711,7 +717,13 @@ namespace snapper if (stat.st_uid != 0 || stat.st_gid != 0) { - y2err("owner of .snapshots wrong"); + y2err("owner/group of .snapshots wrong"); + throw IOErrorException(); + } + + if (stat.st_mode & S_IWOTH) + { + y2err("permissions of .snapshots wrong"); throw IOErrorException(); }