Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 116124 Details for
Bug 174362
sys-apps/baselayout-2.0.0_alpha1 permission issues with ddclient
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
start-stop-daemon patch
s-s-d.patch (text/plain), 2.56 KB, created by
Roy Marples (RETIRED)
on 2007-04-13 06:48:31 UTC
(
hide
)
Description:
start-stop-daemon patch
Filename:
MIME Type:
Creator:
Roy Marples (RETIRED)
Created:
2007-04-13 06:48:31 UTC
Size:
2.56 KB
patch
obsolete
>Index: src/start-stop-daemon.c >=================================================================== >--- src/start-stop-daemon.c (revision 2585) >+++ src/start-stop-daemon.c (working copy) >@@ -562,28 +562,35 @@ > break; > > case 'c': /* --chuid <username>|<uid> */ >- /* we copy the string just in case we need the >- * argument later. */ > { > char *p = optarg; > char *cu = strsep (&p, ":"); >+ struct passwd *pw = NULL; >+ > changeuser = strdup (cu); >- if (sscanf (cu, "%d", &tid) != 1) { >- struct passwd *pw = getpwnam (cu); >- if (! pw) >- eerrorx ("%s: user `%s' not found", progname, cu); >- ch_uid = pw->pw_uid; >- } else >- ch_uid = tid; >+ if (sscanf (cu, "%d", &tid) != 1) >+ pw = getpwnam (cu); >+ else >+ pw = getpwuid (tid); >+ >+ if (! pw) >+ eerrorx ("%s: user `%s' not found", progname, cu); >+ ch_uid = pw->pw_uid; >+ if (! ch_gid) >+ ch_gid = pw->pw_gid; >+ > if (p) { >+ struct group *gr = NULL; > char *cg = strsep (&p, ":"); >- if (sscanf (cg, "%d", &tid) != 1) { >- struct group *gr = getgrnam (cg); >- if (! gr) >- eerrorx ("%s: group `%s' not found", progname, cg); >- ch_gid = gr->gr_gid; >- } else >- ch_gid = tid; >+ >+ if (sscanf (cg, "%d", &tid) != 1) >+ gr = getgrnam (cg); >+ else >+ gr = getgrgid (tid); >+ >+ if (! gr) >+ eerrorx ("%s: group `%s' not found", progname, cg); >+ ch_gid = gr->gr_gid; > } > } > break; >@@ -593,13 +600,18 @@ > break; > > case 'g': /* --group <group>|<gid> */ >- if (sscanf (optarg, "%d", &tid) != 1) { >+ { > struct group *gr = getgrnam (optarg); >+ >+ if (sscanf (optarg, "%d", &tid) != 1) >+ gr = getgrnam (optarg); >+ else >+ gr = getgrgid (tid); >+ > if (! gr) > eerrorx ("%s: group `%s' not found", progname, optarg); > ch_gid = gr->gr_gid; >- } else >- ch_gid = tid; >+ } > break; > > case 'm': /* --make-pidfile */ >@@ -821,11 +833,10 @@ > eerrorx ("%s: pam error: %s", progname, pam_strerror(pamh, pamr)); > #endif > >- if ((ch_gid) && setgid(ch_gid)) >+ if (ch_gid && setgid (ch_gid)) > eerrorx ("%s: unable to set groupid to %d", progname, ch_gid); >- if (changeuser && ch_gid) >- if (initgroups (changeuser, ch_gid)) >- eerrorx ("%s: initgroups (%s, %d)", progname, changeuser, ch_gid); >+ if (changeuser && initgroups (changeuser, ch_gid)) >+ eerrorx ("%s: initgroups (%s, %d)", progname, changeuser, ch_gid); > if (ch_uid && setuid (ch_uid)) > eerrorx ("%s: unable to set userid to %d", progname, ch_uid); > else {
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 174362
: 116124