-const char jcc_rcs[] = "$Id: jcc.c,v 1.72 2002/03/05 21:33:45 david__schmidt Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.75 2002/03/06 10:02:19 oes Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
*
* Revisions :
* $Log: jcc.c,v $
+ * Revision 1.75 2002/03/06 10:02:19 oes
+ * Fixed stupid bug when --user was not given
+ *
+ * Revision 1.74 2002/03/06 00:49:31 jongfoster
+ * Fixing warning on Windows
+ * Making #ifdefs that refer to the same variable consistently
+ * use #ifdef unix rather than mixing #ifdef unix & #ifndef OS2
+ *
+ * Revision 1.73 2002/03/05 23:57:30 hal9
+ * Stray character 's' on line 1618 was breaking build.
+ *
* Revision 1.72 2002/03/05 21:33:45 david__schmidt
* - Re-enable OS/2 building after new parms were added
* - Fix false out of memory report when resolving CGI templates when no IP
* to be reopened by the main thread on HUP.
*
* Parameters :
- * 1 : the_signal - the signal cause this function to call
+ * 1 : the_signal = the signal cause this function to call
*
* Returns : -
*
#endif
{
int argc_pos = 0;
- struct passwd *pw;
+#ifdef unix
+ struct passwd *pw = NULL;
+#endif
Argc = argc;
Argv = argv;
{
no_daemon = 1;
}
-#if !defined(__OS2__)
+#if defined(unix)
else if (strcmp(argv[argc_pos], "--pidfile" ) == 0)
{
if (++argc_pos == argc) usage(argv[0]);
log_error(LOG_LEVEL_FATAL, "User %s not found.", argv[argc_pos]);
}
}
-#endif /* !defined(__OS2__) */
+#endif /* defined(unix) */
else
#endif /* defined(_WIN32) && !defined(_WIN_CONSOLE) */
{
*/
write_pid_file();
- if (setuid(pw->pw_uid))
+ if ((NULL != pw) && setuid(pw->pw_uid))
{
log_error(LOG_LEVEL_FATAL, "Cannot setuid(): Insufficient permissions.");
}