diff options
author | Sven Joachim <svenjoac@gmx.de> | 2015-09-17 17:31:29 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2015-09-21 07:03:18 +0200 |
commit | 176098fb7eb9279339f418ac6c11653ddbe5a859 (patch) | |
tree | f9e1321345c4eb8e51bbbd488538e76912e2de46 /utils/start-stop-daemon.c | |
parent | d287060bb1a45f5de33eb27034a7d8b27b039dbb (diff) | |
download | dpkg-176098fb7eb9279339f418ac6c11653ddbe5a859.tar.gz |
s-s-d: Do not set changegroup unconditionally
Commit 3db7a6eb4fd16b4cea475009bd80be3a41ada014 would always set
changegroup in the --chuid option, even if no colon is given on the
commandline.
[guillem@debian.org:
- Avoid an else from a fatal if. ]
Signed-off-by: Guillem Jover <guillem@debian.org>
Diffstat (limited to 'utils/start-stop-daemon.c')
-rw-r--r-- | utils/start-stop-daemon.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c index 0f4c326cd..c844f2e94 100644 --- a/utils/start-stop-daemon.c +++ b/utils/start-stop-daemon.c @@ -1038,10 +1038,11 @@ parse_options(int argc, char * const *argv) * argument later. */ changeuser_len = strcspn(optarg, ":"); changeuser = xstrndup(optarg, changeuser_len); - if (optarg[changeuser_len] == ':' && - optarg[changeuser_len + 1] == '\0') - fatal("missing group name"); - changegroup = optarg + changeuser_len + 1; + if (optarg[changeuser_len] == ':') { + if (optarg[changeuser_len + 1] == '\0') + fatal("missing group name"); + changegroup = optarg + changeuser_len + 1; + } break; case 'g': /* --group <group>|<gid> */ changegroup = optarg; |