clausklein / rpms / tftp

Forked from rpms/tftp 5 years ago
Clone

Blame SOURCES/tftp-0.49-chk_retcodes.patch

0805be
diff -up tftp-hpa-0.49/tftpd/tftpd.c.chk_retcodes tftp-hpa-0.49/tftpd/tftpd.c
0805be
--- tftp-hpa-0.49/tftpd/tftpd.c.chk_retcodes	2009-01-15 15:28:50.000000000 +0100
0805be
+++ tftp-hpa-0.49/tftpd/tftpd.c	2009-01-15 15:31:36.000000000 +0100
0805be
@@ -932,7 +932,10 @@ int main(int argc, char **argv)
0805be
             exit(EX_OSERR);
0805be
         }
0805be
 #ifdef __CYGWIN__
0805be
-        chdir("/");             /* Cygwin chroot() bug workaround */
0805be
+				if (chdir("/") < 0) {			/* Cygwin chroot() bug workaround */
0805be
+					syslog(LOG_ERR, "chroot: %m");
0805be
+					exit(EX_OSERR);
0805be
+				}
0805be
 #endif
0805be
     }
0805be
 #ifdef HAVE_SETREGID