clausklein / rpms / tftp

Forked from rpms/tftp 5 years ago
Clone

Blame SOURCES/tftp-0.49-chk_retcodes.patch

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