Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 273833 Details for
Bug 350910
sys-apps/openrc: symlinked init scripts must be in the same directory as their symlink
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to fix dirname() call in runscript.c
runscript.patch (text/plain), 1.26 KB, created by
vm
on 2011-05-18 13:31:44 UTC
(
hide
)
Description:
Patch to fix dirname() call in runscript.c
Filename:
MIME Type:
Creator:
vm
Created:
2011-05-18 13:31:44 UTC
Size:
1.26 KB
patch
obsolete
>--- runscript.c.orig 2011-04-15 20:48:30.000000000 -0400 >+++ runscript.c 2011-05-03 11:15:37.000000000 -0400 >@@ -1101,7 +1101,8 @@ > bool doneone = false; > int retval, opt, depoptions = RC_DEP_TRACE; > RC_STRING *svc; >- char path[PATH_MAX], lnk[PATH_MAX], *dir, *save = NULL, pidstr[10]; >+ char path[PATH_MAX], lnk[PATH_MAX], *dir, pidstr[10]; >+ char *save = NULL, *savedir = NULL, *savelnk = NULL; > size_t l = 0, ll; > const char *file; > struct stat stbuf; >@@ -1132,13 +1133,14 @@ > if (readlink(argv[1], lnk, sizeof(lnk)-1)) { > dir = dirname(path); > if (strchr(lnk, '/')) { >- save = xstrdup(dir); >+ savedir = xstrdup(dir); >+ savelnk = xstrdup(lnk); > dir = dirname(lnk); >- if (strcmp(dir, save) == 0) >+ if (strcmp(dir, savedir) == 0) > file = basename_c(argv[1]); > else >- file = basename_c(lnk); >- dir = save; >+ file = basename_c(savelnk); >+ dir = savedir; > } else > file = basename_c(argv[1]); > ll = strlen(dir) + strlen(file) + 2; >@@ -1146,9 +1148,10 @@ > snprintf(service, ll, "%s/%s", dir, file); > if (stat(service, &stbuf) != 0) { > free(service); >- service = xstrdup(lnk); >+ service = xstrdup(savelnk); > } >- free(save); >+ free(savedir); >+ free(savelnk); > } > if (!service) > service = xstrdup(path);
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 350910
:
259462
| 273833 |
281179
|
281201