changeset 1731:5a00bc5e1c0f

Make install support numeric uid/gids (reported by Kylie McClain).
author Rob Landley <rob@landley.net>
date Thu, 12 Mar 2015 14:20:10 -0500
parents 90a7ed7ec30e
children 9adb0ccb617e
files toys/posix/cp.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/toys/posix/cp.c	Thu Mar 12 11:11:08 2015 -0500
+++ b/toys/posix/cp.c	Thu Mar 12 14:20:10 2015 -0500
@@ -402,8 +402,8 @@
   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();