- if (*argrest == 0) {}
-
- /* -bpu: List the contents of the mail queue, top-level undelivered */
-
- else if (Ustrcmp(argrest, "u") == 0) list_queue_option += 1;
-
- /* -bpa: List the contents of the mail queue, including all delivered */
-
- else if (Ustrcmp(argrest, "a") == 0) list_queue_option += 2;
-
- /* Unknown after -bp[r] */
-
- else
- {
- badarg = TRUE;
- break;
- }
- }
-
-
- /* -bP: List the configuration variables given as the address list.
- Force -v, so configuration errors get displayed. */
-
- else if (Ustrcmp(argrest, "P") == 0)
- {
- list_options = TRUE;
- debug_selector |= D_v;
- debug_file = stderr;
- }
-
- /* -brt: Test retry configuration lookup */
-
- else if (Ustrcmp(argrest, "rt") == 0)
- {
- test_retry_arg = i + 1;
- goto END_ARG;
- }
-
- /* -brw: Test rewrite configuration */
-
- else if (Ustrcmp(argrest, "rw") == 0)
- {
- test_rewrite_arg = i + 1;
- goto END_ARG;
- }
-
- /* -bS: Read SMTP commands on standard input, but produce no replies -
- all errors are reported by sending messages. */
-
- else if (Ustrcmp(argrest, "S") == 0)
- smtp_input = smtp_batched_input = receiving_message = TRUE;
-
- /* -bs: Read SMTP commands on standard input and produce SMTP replies
- on standard output. */
-
- else if (Ustrcmp(argrest, "s") == 0) smtp_input = receiving_message = TRUE;
-
- /* -bt: address testing mode */
-
- else if (Ustrcmp(argrest, "t") == 0)
- address_test_mode = checking = log_testing_mode = TRUE;
-
- /* -bv: verify addresses */
-
- else if (Ustrcmp(argrest, "v") == 0)
- verify_address_mode = checking = log_testing_mode = TRUE;
-
- /* -bvs: verify sender addresses */
-
- else if (Ustrcmp(argrest, "vs") == 0)
- {
- verify_address_mode = checking = log_testing_mode = TRUE;
- verify_as_sender = TRUE;
- }
-
- /* -bV: Print version string and support details */
-
- else if (Ustrcmp(argrest, "V") == 0)
- {
- printf("Exim version %s #%s built %s\n", version_string,
- version_cnumber, version_date);
- printf("%s\n", CS version_copyright);
- version_printed = TRUE;
- show_whats_supported(stdout);
- }
-
- /* -bw: inetd wait mode, accept a listening socket as stdin */
-
- else if (*argrest == 'w')
- {
- inetd_wait_mode = TRUE;
- background_daemon = FALSE;
- daemon_listen = TRUE;
- if (*(++argrest) != '\0')
- {
- inetd_wait_timeout = readconf_readtime(argrest, 0, FALSE);
- if (inetd_wait_timeout <= 0)
- {
- fprintf(stderr, "exim: bad time value %s: abandoned\n", argv[i]);
- exit(EXIT_FAILURE);
- }
- }
- }
-
- else badarg = TRUE;
- break;
-
-
- /* -C: change configuration file list; ignore if it isn't really
- a change! Enforce a prefix check if required. */
-
- case 'C':
- if (*argrest == 0)
- {
- if(++i < argc) argrest = argv[i]; else
- { badarg = TRUE; break; }
- }
- if (Ustrcmp(config_main_filelist, argrest) != 0)
- {
- #ifdef ALT_CONFIG_PREFIX
- int sep = 0;
- int len = Ustrlen(ALT_CONFIG_PREFIX);
- uschar *list = argrest;
- uschar *filename;
- while((filename = string_nextinlist(&list, &sep, big_buffer,
- big_buffer_size)) != NULL)
- {
- if ((Ustrlen(filename) < len ||
- Ustrncmp(filename, ALT_CONFIG_PREFIX, len) != 0 ||
- Ustrstr(filename, "/../") != NULL) &&
- (Ustrcmp(filename, "/dev/null") != 0 || real_uid != root_uid))
- {
- fprintf(stderr, "-C Permission denied\n");
- exit(EXIT_FAILURE);
- }
- }
- #endif
- if (real_uid != root_uid)
- {
- #ifdef TRUSTED_CONFIG_LIST
-
- if (real_uid != exim_uid
- #ifdef CONFIGURE_OWNER
- && real_uid != config_uid
- #endif
- )
- trusted_config = FALSE;
- else
- {
- FILE *trust_list = Ufopen(TRUSTED_CONFIG_LIST, "rb");
- if (trust_list)
- {
- struct stat statbuf;
-
- if (fstat(fileno(trust_list), &statbuf) != 0 ||
- (statbuf.st_uid != root_uid /* owner not root */
- #ifdef CONFIGURE_OWNER
- && statbuf.st_uid != config_uid /* owner not the special one */
- #endif
- ) || /* or */
- (statbuf.st_gid != root_gid /* group not root */
- #ifdef CONFIGURE_GROUP
- && statbuf.st_gid != config_gid /* group not the special one */
- #endif
- && (statbuf.st_mode & 020) != 0 /* group writeable */
- ) || /* or */
- (statbuf.st_mode & 2) != 0) /* world writeable */
- {
- trusted_config = FALSE;
- fclose(trust_list);
- }
- else
- {
- /* Well, the trust list at least is up to scratch... */
- void *reset_point = store_get(0);
- uschar *trusted_configs[32];
- int nr_configs = 0;
- int i = 0;