daandemeyer / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
803fb7
From 7374770f790080b677f504075ba9659230e11226 Mon Sep 17 00:00:00 2001
803fb7
From: Lukas Nykryn <lnykryn@redhat.com>
803fb7
Date: Fri, 11 Sep 2015 16:23:07 +0200
803fb7
Subject: [PATCH] sysv-generator: follow symlinks in /etc/rc.d/init.d
803fb7
803fb7
Some java packages puts a symlink to init.d and its content is pointing
803fb7
to latest java installation (because you can have multiple javas on you
803fb7
machine).
803fb7
803fb7
On rhel-based distributions you can use alternatives --initscript
803fb7
instread of symlink, but this is not usable for other distributions.
803fb7
803fb7
Cherry-picked from: 7b729f8686a83b24f3d9a891cde1c
803fb7
Resolves: #1285492
803fb7
---
803fb7
 src/sysv-generator/sysv-generator.c | 2 +-
803fb7
 1 file changed, 1 insertion(+), 1 deletion(-)
803fb7
803fb7
diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
803fb7
index 3c6cb8f10..0a8a528bd 100644
803fb7
--- a/src/sysv-generator/sysv-generator.c
803fb7
+++ b/src/sysv-generator/sysv-generator.c
803fb7
@@ -753,7 +753,7 @@ static int enumerate_sysv(const LookupPaths *lp, Hashmap *all_services) {
803fb7
                         if (hidden_file(de->d_name))
803fb7
                                 continue;
803fb7
 
803fb7
-                        if (fstatat(dirfd(d), de->d_name, &st, AT_SYMLINK_NOFOLLOW) < 0) {
803fb7
+                        if (fstatat(dirfd(d), de->d_name, &st, 0) < 0) {
803fb7
                                 log_warning_errno(errno, "stat() failed on %s/%s: %m", *path, de->d_name);
803fb7
                                 continue;
803fb7
                         }