snapper allow all user to read info

This commit is contained in:
陈浩南 2023-08-04 22:18:39 +08:00
parent 3c810be918
commit 136e7916aa
2 changed files with 20 additions and 0 deletions

View File

@ -122,6 +122,13 @@ inputs:
});
in
listToAttrs (map f (attrsToList services.snapper.configs));
nixpkgs.config.packageOverrides = pkgs:
{
snapper = pkgs.snapper.overrideAttrs (attrs:
{
patches = (if (attrs ? patches) then attrs.patches else []) ++ [ ./snapper.patch ];
});
};
}
)
(

View File

@ -0,0 +1,13 @@
diff --git a/snapper/FileUtils.cc b/snapper/FileUtils.cc
index 9da572f..48f60fa 100644
--- a/snapper/FileUtils.cc
+++ b/snapper/FileUtils.cc
@@ -424,7 +424,7 @@ namespace snapper
v /= 62;
}
- int fd = open(name, O_RDWR | O_CREAT | O_EXCL | O_CLOEXEC, S_IRUSR | S_IWUSR);
+ int fd = open(name, O_RDWR | O_CREAT | O_EXCL | O_CLOEXEC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
if (fd >= 0)
return fd;
else if (errno != EEXIST)