aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/cp.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-03-12 14:20:10 -0500
committerRob Landley <rob@landley.net>2015-03-12 14:20:10 -0500
commit9ff639cef3c2f73ce876c6cab4c4f517e512bf13 (patch)
tree8941c7ca9db4158771d5a4de4a58702e8c88a4e2 /toys/posix/cp.c
parentb8140d18800e7094cdacb0a61526f46181dc132d (diff)
downloadtoybox-9ff639cef3c2f73ce876c6cab4c4f517e512bf13.tar.gz
Make install support numeric uid/gids (reported by Kylie McClain).
Diffstat (limited to 'toys/posix/cp.c')
-rw-r--r--toys/posix/cp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/toys/posix/cp.c b/toys/posix/cp.c
index 45c93e79..31706630 100644
--- a/toys/posix/cp.c
+++ b/toys/posix/cp.c
@@ -402,8 +402,8 @@ void install_main(void)
if (flags & FLAG_v) toys.optflags |= 8; // cp's FLAG_v
if (flags & (FLAG_p|FLAG_o|FLAG_g)) toys.optflags |= 512; // cp's FLAG_p
- if (TT.user) TT.uid = xgetpwnam(TT.user)->pw_uid;
- if (TT.group) TT.gid = xgetgrnam(TT.group)->gr_gid;
+ if (TT.user) TT.uid = xgetpwnamid(TT.user)->pw_uid;
+ if (TT.group) TT.gid = xgetgrnamid(TT.group)->gr_gid;
TT.callback = install_node;
cp_main();