X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fsrc%2Fexim.c;h=890bcebe99b0195726d53d7b1f340bf4d5855074;hb=dbc4b90d7238e249a9406cc3770ca4445b87864f;hp=7d1c3b6a6a02fbfeba68d306fcbe0ed36f4914db;hpb=ed7f7860402395aedcb9e9c0cbade291c675a12f;p=exim.git diff --git a/src/src/exim.c b/src/src/exim.c index 7d1c3b6a6..890bcebe9 100644 --- a/src/src/exim.c +++ b/src/src/exim.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/exim.c,v 1.67 2010/06/06 00:27:52 pdp Exp $ */ +/* $Cambridge: exim/src/src/exim.c,v 1.70 2010/06/06 22:46:34 pdp Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -685,8 +685,8 @@ else * Show supported features * *************************************************/ -/* This function is called for -bV and for -d to output the optional features -of the current Exim binary. +/* This function is called for -bV/--version and for -d to output the optional +features of the current Exim binary. Arguments: a FILE for printing Returns: nothing @@ -1234,6 +1234,12 @@ This is a feature to make the lives of binary distributors easier. */ #ifdef EXIM_USERNAME if (route_finduser(US EXIM_USERNAME, &pw, &exim_uid)) { + if (exim_uid == 0) + { + fprintf(stderr, "exim: refusing to run with uid 0 for \"%s\"\n", + EXIM_USERNAME); + exit(EXIT_FAILURE); + } exim_gid = pw->pw_gid; } else @@ -1489,16 +1495,6 @@ running in an unprivileged state. */ unprivileged = (real_uid != root_uid && original_euid != root_uid); -/* If the first argument is --help, set usage_wanted and pretend there -are no arguments. This will cause a brief message to be given. We do -the message generation downstream so we can pick up how we were invoked */ - -if (argc > 1 && Ustrcmp(argv[1], "--help") == 0) - { - argc = 1; - usage_wanted = TRUE; - } - /* Scan the program's arguments. Some can be dealt with right away; others are simply recorded for checking and handling afterwards. Do a high-level switch on the second character (the one after '-'), to save some effort. */ @@ -1563,6 +1559,21 @@ for (i = 1; i < argc; i++) argrest++; } + /* deal with --option_aliases */ + else if (switchchar == '-') + { + if (Ustrcmp(argrest, "help") == 0) + { + usage_wanted = TRUE; + break; + } + else if (Ustrcmp(argrest, "version") == 0) + { + switchchar = 'b'; + argrest = "V"; + } + } + /* High-level switch on active initial letter */ switch(switchchar) @@ -3612,6 +3623,7 @@ else setgid(exim_gid); /* Handle a request to scan a file for malware */ if (malware_test_file) { +#ifdef WITH_CONTENT_SCAN int result; set_process_info("scanning file for malware"); result = malware_in_file(malware_test_file); @@ -3629,6 +3641,9 @@ if (malware_test_file) printf("Malware found: %s\n", malware_name); else printf("Malware scan detected malware of unknown name.\n"); +#else + printf("Malware scanning not enabled at compile time.\n"); +#endif exit(EXIT_FAILURE); }