diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2013-11-29 16:39:28 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2013-11-29 16:39:28 +0100 |
commit | 1a7256ac38284caffd2a0de2250364369059be69 (patch) | |
tree | 0e97ac73f8709563c82424b96c5f9d8fceacd902 | |
parent | 72745632a13ccd12232127b31e1656f2f7ebcaff (diff) | |
download | busybox-w32-1a7256ac38284caffd2a0de2250364369059be69.tar.gz busybox-w32-1a7256ac38284caffd2a0de2250364369059be69.tar.bz2 busybox-w32-1a7256ac38284caffd2a0de2250364369059be69.zip |
chpst: fix a bug where -U USER was using wrong USER (one from -u USER)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | libbb/inet_common.c | 3 | ||||
-rw-r--r-- | runit/chpst.c | 5 |
2 files changed, 3 insertions, 5 deletions
diff --git a/libbb/inet_common.c b/libbb/inet_common.c index 0f4fca1a2..b3e0802ee 100644 --- a/libbb/inet_common.c +++ b/libbb/inet_common.c | |||
@@ -175,8 +175,7 @@ int FAST_FUNC INET6_resolve(const char *name, struct sockaddr_in6 *sin6) | |||
175 | return -1; | 175 | return -1; |
176 | } | 176 | } |
177 | memcpy(sin6, ai->ai_addr, sizeof(*sin6)); | 177 | memcpy(sin6, ai->ai_addr, sizeof(*sin6)); |
178 | if (ai) | 178 | freeaddrinfo(ai); |
179 | freeaddrinfo(ai); | ||
180 | return 0; | 179 | return 0; |
181 | } | 180 | } |
182 | 181 | ||
diff --git a/runit/chpst.c b/runit/chpst.c index ed72c8b8c..71af29f66 100644 --- a/runit/chpst.c +++ b/runit/chpst.c | |||
@@ -236,7 +236,6 @@ int chpst_main(int argc UNUSED_PARAM, char **argv) | |||
236 | { | 236 | { |
237 | struct bb_uidgid_t ugid; | 237 | struct bb_uidgid_t ugid; |
238 | char *set_user = set_user; /* for compiler */ | 238 | char *set_user = set_user; /* for compiler */ |
239 | char *env_user = env_user; | ||
240 | char *env_dir = env_dir; | 239 | char *env_dir = env_dir; |
241 | char *root; | 240 | char *root; |
242 | char *nicestr; | 241 | char *nicestr; |
@@ -264,7 +263,7 @@ int chpst_main(int argc UNUSED_PARAM, char **argv) | |||
264 | IF_CHPST("/:n:vP012"), | 263 | IF_CHPST("/:n:vP012"), |
265 | &limita, &limitc, &limitd, &limitf, &limitl, | 264 | &limita, &limitc, &limitd, &limitf, &limitl, |
266 | &limitm, &limito, &limitp, &limitr, &limits, &limitt, | 265 | &limitm, &limito, &limitp, &limitr, &limits, &limitt, |
267 | &set_user, &env_user, &env_dir | 266 | &set_user, &set_user, &env_dir |
268 | IF_CHPST(, &root, &nicestr)); | 267 | IF_CHPST(, &root, &nicestr)); |
269 | argv += optind; | 268 | argv += optind; |
270 | if (opt & OPT_m) { // -m means -asld | 269 | if (opt & OPT_m) { // -m means -asld |
@@ -292,7 +291,7 @@ int chpst_main(int argc UNUSED_PARAM, char **argv) | |||
292 | 291 | ||
293 | // envuidgid? | 292 | // envuidgid? |
294 | if (ENABLE_ENVUIDGID && applet_name[0] == 'e' && applet_name[3] == 'u') { | 293 | if (ENABLE_ENVUIDGID && applet_name[0] == 'e' && applet_name[3] == 'u') { |
295 | env_user = *argv++; | 294 | set_user = *argv++; |
296 | opt |= OPT_U; | 295 | opt |= OPT_U; |
297 | } | 296 | } |
298 | 297 | ||