aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/tftpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'toys/pending/tftpd.c')
-rw-r--r--toys/pending/tftpd.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/toys/pending/tftpd.c b/toys/pending/tftpd.c
index 3e7264b5..ea8d3eac 100644
--- a/toys/pending/tftpd.c
+++ b/toys/pending/tftpd.c
@@ -249,11 +249,7 @@ void tftpd_main(void)
error_exit(NULL);
}
- if (toys.optflags & FLAG_u) {
- struct passwd *pw = getpwnam(TT.user);
- if (!pw) error_exit("unknown user %s", TT.user);
- TT.pw = pw;
- }
+ if (TT.user) TT.pw = xgetpwnam(TT.user);
if (*toys.optargs) {
if (chroot(*toys.optargs))
perror_exit("can't change root directory to '%s'", *toys.optargs);