diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/userspec.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/userspec.c b/src/userspec.c index 8cffd65..82cfcef 100644 --- a/src/userspec.c +++ b/src/userspec.c | |||
@@ -108,10 +108,16 @@ parse_user_spec (const char *spec_arg, uid_t *uid, gid_t *gid, | |||
108 | 108 | ||
109 | if (u != NULL) | 109 | if (u != NULL) |
110 | { | 110 | { |
111 | pwd = getpwnam (u); | 111 | if (*u == '+') |
112 | if (pwd == NULL) | ||
113 | { | 112 | { |
113 | pwd = NULL; | ||
114 | ++u; | ||
115 | } | ||
116 | else | ||
117 | pwd = getpwnam (u); | ||
114 | 118 | ||
119 | if (pwd == NULL) | ||
120 | { | ||
115 | if (!isnumber_p (u)) | 121 | if (!isnumber_p (u)) |
116 | error_msg = _("invalid user"); | 122 | error_msg = _("invalid user"); |
117 | else | 123 | else |
@@ -155,7 +161,14 @@ parse_user_spec (const char *spec_arg, uid_t *uid, gid_t *gid, | |||
155 | if (g != NULL && error_msg == NULL) | 161 | if (g != NULL && error_msg == NULL) |
156 | { | 162 | { |
157 | /* Explicit group. */ | 163 | /* Explicit group. */ |
158 | grp = getgrnam (g); | 164 | if (*g == '+') |
165 | { | ||
166 | grp = NULL; | ||
167 | ++g; | ||
168 | } | ||
169 | else | ||
170 | grp = getgrnam (g); | ||
171 | |||
159 | if (grp == NULL) | 172 | if (grp == NULL) |
160 | { | 173 | { |
161 | if (!isnumber_p (g)) | 174 | if (!isnumber_p (g)) |