]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
homed: open blob dir with O_PATH 33591/head
authorMatteo Croce <teknoraver@meta.com>
Tue, 9 Jul 2024 00:05:29 +0000 (02:05 +0200)
committerMatteo Croce <teknoraver@meta.com>
Tue, 16 Jul 2024 13:03:37 +0000 (15:03 +0200)
`sys_base_dfd` is only used as dirfd argument to *_at functions,
open it with O_PATH.

src/home/homework-blob.c

index 6b22ab6f24ed143b11244c708174ecaf99ac2685..0ad2941539614da840af6614c67287e619a5ee96 100644 (file)
@@ -218,7 +218,7 @@ int home_reconcile_blob_dirs(UserRecord *h, int root_fd, int reconciled) {
         if (reconciled == USER_RECONCILE_IDENTICAL)
                 return 0;
 
-        sys_base_dfd = open(home_system_blob_dir(), O_RDONLY|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW);
+        sys_base_dfd = open(home_system_blob_dir(), O_PATH|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW);
         if (sys_base_dfd < 0)
                 return log_error_errno(errno, "Failed to open system blob dir: %m");