No point in having to lots of get the user code.
This commit is contained in:
parent
0963e06766
commit
9ea8afb200
@ -565,6 +565,7 @@ int start_stop_daemon (int argc, char **argv)
|
||||
background = true;
|
||||
break;
|
||||
|
||||
case 'u': /* --user <username>|<uid> */
|
||||
case 'c': /* --chuid <username>|<uid> */
|
||||
{
|
||||
char *p = optarg;
|
||||
@ -646,16 +647,6 @@ int start_stop_daemon (int argc, char **argv)
|
||||
test = true;
|
||||
break;
|
||||
|
||||
case 'u': /* --user <username>|<uid> */
|
||||
if (sscanf (optarg, "%d", &tid) != 1) {
|
||||
struct passwd *pw = getpwnam (optarg);
|
||||
if (! pw)
|
||||
eerrorx ("%s: user `%s' not found", applet, optarg);
|
||||
uid = pw->pw_uid;
|
||||
} else
|
||||
uid = tid;
|
||||
break;
|
||||
|
||||
case 'r': /* --chroot /new/root */
|
||||
ch_root = optarg;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user