teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame SOURCES/0262-sysv-generator-follow-symlinks-in-etc-rc.d-init.d.patch

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