From 33374b2363b2dd6b0a0c20c155738c7e8b87b373 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Fri, 23 Jul 2004 06:59:06 +0000 Subject: [PATCH] Fixed missing argument to getcfg() under linux SVN revision: 971 --- src/elogd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/elogd.c b/src/elogd.c index 5dfc9df4..c187d2d8 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -6,6 +6,9 @@ Contents: Web server program for Electronic Logbook ELOG $Log$ + Revision 1.395 2004/07/23 06:59:06 midas + Fixed missing argument to getcfg() under linux + Revision 1.394 2004/07/22 21:05:29 midas Fixed bugs with https:// in URL @@ -301,6 +304,7 @@ /* ELOG identification */ static const char ELOGID[] = "elogd " VERSION " built " __DATE__ ", " __TIME__; +#define _GNU_SOURCE #include #include #include @@ -18773,7 +18777,7 @@ void server_loop(int tcp_port) signal(SIGHUP, hup_handler); /* give up root privilege */ if (geteuid() == 0) { - if (!getcfg("global", "Grp", str) || setgroup(str) < 0) { + if (!getcfg("global", "Grp", str, sizeof(str)) || setgroup(str) < 0) { eprintf("Falling back to default group \"elog\"\n"); if (setgroup("elog") < 0) { eprintf("Falling back to default group \"%s\"\n", DEFAULT_GROUP); @@ -18786,7 +18790,7 @@ void server_loop(int tcp_port) } } - if (!getcfg("global", "Usr", str) || setuser(str) < 0) { + if (!getcfg("global", "Usr", str, sizeof(str)) || setuser(str) < 0) { eprintf("Falling back to default user \"elog\"\n"); if (setuser("elog") < 0) { eprintf("Falling back to default user \"%s\"\n", DEFAULT_USER);