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,25 +12645,33 @@ 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 \"%s\"\n", DEFAULT_GROUP); printf("Falling back to default group \"elog\"\n");
if (setgroup(DEFAULT_GROUP) < 0) if (setgroup("elog") < 0)
{ {
printf("Refuse to run as setgid root.\n"); printf("Falling back to default group \"%s\"\n", DEFAULT_GROUP);
printf("Please consider to define a Grp statement in configuration file\n"); if (setgroup(DEFAULT_GROUP) < 0)
exit(EXIT_FAILURE); {
printf("Refuse to run as setgid root.\n");
printf("Please consider to define a Grp statement in configuration file\n");
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 \"%s\"\n", DEFAULT_USER); printf("Falling back to default user \"elog\"\n");
if (setuser(DEFAULT_USER) < 0) if (setuser("elog") < 0)
{ {
printf("Refuse to run as setuid root.\n"); printf("Falling back to default user \"%s\"\n", DEFAULT_USER);
printf("Please consider to define a Usr statement in configuration file\n"); if (setuser(DEFAULT_USER) < 0)
exit(EXIT_FAILURE); {
printf("Refuse to run as setuid root.\n");
printf("Please consider to define a Usr statement in configuration file\n");
exit(EXIT_FAILURE);
}
} }
} }
} }