Fallback to elog/elog added

SVN revision: 436
This commit is contained in:
Stefan Ritt 2003-03-10 08:08:11 +00:00
parent 14cf5eb085
commit ca97cd36ff

View File

@ -6,6 +6,9 @@
Contents: Web server program for Electronic Logbook ELOG Contents: Web server program for Electronic Logbook ELOG
$Log$ $Log$
Revision 1.44 2003/03/10 08:08:11 midas
Fallback to elog/elog added
Revision 1.43 2003/03/09 19:57:53 midas Revision 1.43 2003/03/09 19:57:53 midas
V2.3.2(beta) V2.3.2(beta)
@ -12642,7 +12645,10 @@ usage:
if (geteuid() == 0) if (geteuid() == 0)
{ {
if (! getcfg("global", "Grp", str) || ! setgroup(str) < 0) if (!getcfg("global", "Grp", str) || setgroup(str) < 0)
{
printf("Falling back to default group \"elog\"\n");
if (setgroup("elog") < 0)
{ {
printf("Falling back to default group \"%s\"\n", DEFAULT_GROUP); printf("Falling back to default group \"%s\"\n", DEFAULT_GROUP);
if (setgroup(DEFAULT_GROUP) < 0) if (setgroup(DEFAULT_GROUP) < 0)
@ -12652,8 +12658,12 @@ usage:
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
} }
}
if (! getcfg("global", "Usr", str) || ! setuser(str) < 0) if (!getcfg("global", "Usr", str) || setuser(str) < 0)
{
printf("Falling back to default user \"elog\"\n");
if (setuser("elog") < 0)
{ {
printf("Falling back to default user \"%s\"\n", DEFAULT_USER); printf("Falling back to default user \"%s\"\n", DEFAULT_USER);
if (setuser(DEFAULT_USER) < 0) if (setuser(DEFAULT_USER) < 0)
@ -12664,6 +12674,7 @@ usage:
} }
} }
} }
}
#endif #endif
if (read_pwd[0]) if (read_pwd[0])