[Freeciv-Dev] (PR#424) civserver --version as root
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Here's an update of this patch for current CVS. No other changes have
been made.
Note that as I said in earlier replies, audio_init cannot be moved down
below where the options are parsed, as until we init the audio (modules)
we cannot determine which modules are available (which is needed for
--help).
Nonetheless, I think this is a pretty innocuous change, and is worth it
to fix the "bug".
jason
Index: client/civclient.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/civclient.c,v
retrieving revision 1.152
diff -u -r1.152 civclient.c
--- client/civclient.c 2002/11/15 09:54:31 1.152
+++ client/civclient.c 2002/11/15 20:54:54
@@ -117,7 +117,6 @@
char *option=NULL;
init_nls();
- dont_run_as_root(argv[0], "freeciv_client");
audio_init();
/* default argument values are set in options.c */
@@ -196,6 +195,9 @@
/* Remove all options except those intended for the UI. */
argv[1 + ui_options] = NULL;
argc = 1 + ui_options;
+
+ /* disallow running as root -- too dangerous */
+ dont_run_as_root(argv[0], "freeciv_client");
log_init(logfile, loglevel, NULL);
Index: server/civserver.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/civserver.c,v
retrieving revision 1.211
diff -u -r1.211 civserver.c
--- server/civserver.c 2002/11/14 09:15:04 1.211
+++ server/civserver.c 2002/11/15 20:54:55
@@ -56,9 +56,6 @@
/* initialize server */
srv_init();
- /* disallow running as root -- too dangerous */
- dont_run_as_root(argv[0], "freeciv_server");
-
/* parse command-line arguments... */
#ifdef GENERATING_MAC
@@ -149,6 +146,9 @@
fprintf(stderr, _("Report bugs to <%s>.\n"), BUG_EMAIL_ADDRESS);
exit(EXIT_SUCCESS);
}
+
+ /* disallow running as root -- too dangerous */
+ dont_run_as_root(argv[0], "freeciv_server");
/* have arguments, call the main server loop... */
srv_main();
- [Freeciv-Dev] (PR#424) civserver --version as root, Jason Short via RT, 2002/11/12
- [Freeciv-Dev] (PR#424) civserver --version as root,
Jason Short via RT <=
- [Freeciv-Dev] (PR#424) civserver --version as root, Jason Short via RT, 2002/11/18
- [Freeciv-Dev] Re: (PR#424) civserver --version as root, Mike Kaufman via RT, 2002/11/18
- [Freeciv-Dev] Re: (PR#424) civserver --version as root, Raimar Falke, 2002/11/18
- [Freeciv-Dev] Re: (PR#424) civserver --version as root, Raimar Falke via RT, 2002/11/18
- [Freeciv-Dev] renaming audio_init, Jason Dorje Short, 2002/11/18
- [Freeciv-Dev] Re: renaming audio_init, Mike Kaufman, 2002/11/18
- [Freeciv-Dev] Re: renaming audio_init, Reinier Post, 2002/11/19
- [Freeciv-Dev] Re: renaming audio_init, Raimar Falke, 2002/11/19
|
|