Date: Sun, 19 May 2002 12:51:48 -0700 (PDT) From: Woei-Luen@www.freebsd.org, Shyu <m8535@cn.ee.ccu.edu.tw> To: freebsd-gnats-submit@FreeBSD.org Subject: bin/38303: tftpd -c patch Message-ID: <200205191951.g4JJpmE9054439@www.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 38303
>Category: bin
>Synopsis: tftpd -c patch
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun May 19 13:00:12 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Woei-Luen, Shyu
>Release: 4.6-PRERELEASE
>Organization:
National Chung-Cheng University
>Environment:
FreeBSD mail.dorm.ccu.edu.tw 4.6-PRERELEASE FreeBSD 4.6-PRERELEASE #0: Sun May 12 09:35:36 CST 2002 jonce@mail.dorm.ccu.edu.tw:/usr/obj/usr/src/sys/mail i386
>Description:
According to the tftpd's manual page, the -c flag enables this feature: "If the directory does not exist, the client connection is refused." However, it does not work! After some hacking, I think there is a bug in the tftpd's source code and I make a patch for this bug.
>How-To-Repeat:
>Fix:
--- tftpd.c Sun May 19 15:19:10 2002
+++ /usr/src/libexec/tftpd/tftpd.c Mon May 20 03:36:23 2002
@@ -256,9 +256,9 @@
NI_NUMERICHOST | NI_WITHSCOPEID);
asprintf(&tempchroot, "%s/%s", chroot_dir, hbuf);
statret = stat(tempchroot, &sb);
- if ((sb.st_mode & S_IFDIR) &&
- (statret == 0 || (statret == -1 && ipchroot == 1)))
- chroot_dir = tempchroot;
+ if ( ( statret == 0 && sb.st_mode & S_IFDIR ) ||
+ ( ipchroot == 1 ) )
+ chroot_dir = tempchroot;
}
/* Must get this before chroot because /etc might go away */
if ((nobody = getpwnam(chuser)) == NULL) {
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200205191951.g4JJpmE9054439>
