]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
install: follow config_path symlink (#3362)
authorRhys <rimmington@gmail.com>
Tue, 9 Aug 2016 13:33:46 +0000 (23:33 +1000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 9 Aug 2016 13:33:46 +0000 (09:33 -0400)
Under NixOS, the config_path /etc/systemd/system is a symlink to
/etc/static/systemd/system. Commands such as `systemctl list-unit-files`
and `systemctl is-enabled` did not work as the symlink was not followed.

This does not affect how symlinks are treated within the config_path
directory.

src/shared/install.c

index 7b49e1ece9ee1a017164e5ef21e840886a61c81b..e740ef3910549c3262f2a6aa64a69a2e62735e34 100644 (file)
@@ -777,7 +777,7 @@ static int find_symlinks(
         assert(config_path);
         assert(same_name_link);
 
-        fd = open(config_path, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW);
+        fd = open(config_path, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC);
         if (fd < 0) {
                 if (IN_SET(errno, ENOENT, ENOTDIR, EACCES))
                         return 0;