Mercurial > hg > toybox
comparison toys/posix/cp.c @ 1731:5a00bc5e1c0f draft
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 | 0c8ef714cf03 |
children | b11f536bac74 |
comparison
equal
deleted
inserted
replaced
1730:90a7ed7ec30e | 1731:5a00bc5e1c0f |
---|---|
400 // Translate flags from install to cp | 400 // Translate flags from install to cp |
401 toys.optflags = 4; // Force cp's FLAG_F | 401 toys.optflags = 4; // Force cp's FLAG_F |
402 if (flags & FLAG_v) toys.optflags |= 8; // cp's FLAG_v | 402 if (flags & FLAG_v) toys.optflags |= 8; // cp's FLAG_v |
403 if (flags & (FLAG_p|FLAG_o|FLAG_g)) toys.optflags |= 512; // cp's FLAG_p | 403 if (flags & (FLAG_p|FLAG_o|FLAG_g)) toys.optflags |= 512; // cp's FLAG_p |
404 | 404 |
405 if (TT.user) TT.uid = xgetpwnam(TT.user)->pw_uid; | 405 if (TT.user) TT.uid = xgetpwnamid(TT.user)->pw_uid; |
406 if (TT.group) TT.gid = xgetgrnam(TT.group)->gr_gid; | 406 if (TT.group) TT.gid = xgetgrnamid(TT.group)->gr_gid; |
407 | 407 |
408 TT.callback = install_node; | 408 TT.callback = install_node; |
409 cp_main(); | 409 cp_main(); |
410 } | 410 } |