Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 280657 Details for
Bug 365955
sys-apps/openrc runscript does not parse symlinks correctly if the target starts with "./"
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
0001-fix-handling-of-symbolic-links-in-init.d-directory.patch
0001-fix-handling-of-symbolic-links-in-init.d-directory.patch (text/plain), 1.81 KB, created by
William Hubbs
on 2011-07-22 18:12:20 UTC
(
hide
)
Description:
0001-fix-handling-of-symbolic-links-in-init.d-directory.patch
Filename:
MIME Type:
Creator:
William Hubbs
Created:
2011-07-22 18:12:20 UTC
Size:
1.81 KB
patch
obsolete
>From 1579f70f7fd3689e040a9329180a9649635e90aa Mon Sep 17 00:00:00 2001 >From: William Hubbs <williamh@gentoo.org> >Date: Thu, 21 Jul 2011 13:38:15 -0500 >Subject: [PATCH] fix handling of symbolic links in init.d directory > >Symbolic links in the init.d directory must point to a file in the same >directory, so we can discard any path in the target of the symbolic >link. > >X-Gentoo-Bug: 365955 >X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=365955 >--- > src/rc/runscript.c | 18 ++++-------------- > 1 files changed, 4 insertions(+), 14 deletions(-) > >diff --git a/src/rc/runscript.c b/src/rc/runscript.c >index 0907ce1..f3e39b0 100644 >--- a/src/rc/runscript.c >+++ b/src/rc/runscript.c >@@ -1101,7 +1101,7 @@ runscript(int argc, char **argv) > int retval, opt, depoptions = RC_DEP_TRACE; > RC_STRING *svc; > char path[PATH_MAX], lnk[PATH_MAX]; >- char *dir, *saveDir = NULL, *saveLnk = NULL; >+ char *dir, *save = NULL; > char pidstr[10]; > size_t l = 0, ll; > const char *file; >@@ -1131,18 +1131,10 @@ runscript(int argc, char **argv) > } > memset(lnk, 0, sizeof(lnk)); > if (readlink(argv[1], lnk, sizeof(lnk)-1)) { >+ if (strchr(lnk, '/')) >+ eerrorx("The target of %s must not include a path.", argv[1]); > dir = dirname(path); >- if (strchr(lnk, '/')) { >- saveDir = xstrdup(dir); >- saveLnk = xstrdup(lnk); >- dir = dirname(saveLnk); >- if (strcmp(dir, saveDir) == 0) >- file = basename_c(argv[1]); >- else >- file = basename_c(lnk); >- dir = saveDir; >- } else >- file = basename_c(argv[1]); >+ file = basename_c(argv[1]); > ll = strlen(dir) + strlen(file) + 2; > service = xmalloc(ll); > snprintf(service, ll, "%s/%s", dir, file); >@@ -1150,8 +1142,6 @@ runscript(int argc, char **argv) > free(service); > service = xstrdup(lnk); > } >- free(saveDir); >- free(saveLnk); > } > if (!service) > service = xstrdup(path); >-- >1.7.3.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 365955
: 280657