clausklein / rpms / tftp

Forked from rpms/tftp 5 years ago
Clone

Blame SOURCES/tftp-0.49-chk_retcodes.patch

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