clausklein / rpms / tftp

Forked from rpms/tftp 5 years ago
Clone

Blame SOURCES/tftp-0.49-chk_retcodes.patch

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