tftpd: Check for errors from chdir()
MFC after: 1 week Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
3994f5bc18
commit
0aabff2880
@ -373,7 +373,10 @@ main(int argc, char *argv[])
|
||||
chroot_dir, strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
chdir("/");
|
||||
if (chdir("/") != 0) {
|
||||
tftp_log(LOG_ERR, "chdir: %s", strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
if (setgroups(1, &nobody->pw_gid) != 0) {
|
||||
tftp_log(LOG_ERR, "setgroups failed");
|
||||
exit(1);
|
||||
|
Loading…
Reference in New Issue
Block a user