]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
homed: use O_PATH for FDs
authorMatteo Croce <teknoraver@meta.com>
Mon, 8 Jul 2024 23:50:53 +0000 (01:50 +0200)
committerMatteo Croce <teknoraver@meta.com>
Tue, 16 Jul 2024 13:03:37 +0000 (15:03 +0200)
`Home->pin_fd` is used only for pinning, open it with O_PATH.

src/home/homed-home.c

index da64d1a8b6ff42ab40dd15c399aaacbaaa9de81d..664397e55e01a983a7c939ad87d58beff38a90bf 100644 (file)
@@ -386,7 +386,7 @@ static void home_pin(Home *h) {
                 return;
         }
 
-        h->pin_fd = open(path, O_RDONLY|O_DIRECTORY|O_CLOEXEC);
+        h->pin_fd = open(path, O_PATH|O_DIRECTORY|O_CLOEXEC);
         if (h->pin_fd < 0) {
                 log_warning_errno(errno, "Couldn't open home directory '%s' for pinning, ignoring: %m", path);
                 return;