Date: Tue, 29 Sep 2020 01:54:05 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366239 - stable/12/libexec/tftpd Message-ID: <202009290154.08T1s5Fu077087@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Tue Sep 29 01:54:04 2020 New Revision: 366239 URL: https://svnweb.freebsd.org/changeset/base/366239 Log: MFC r366002: tftpd: Check for errors from chdir() Modified: stable/12/libexec/tftpd/tftpd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/tftpd/tftpd.c ============================================================================== --- stable/12/libexec/tftpd/tftpd.c Tue Sep 29 01:52:53 2020 (r366238) +++ stable/12/libexec/tftpd/tftpd.c Tue Sep 29 01:54:04 2020 (r366239) @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009290154.08T1s5Fu077087>