clausklein / rpms / tftp

Forked from rpms/tftp 5 years ago
Clone

Blame SOURCES/tftp-0.49-chk_retcodes.patch

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