X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fsrc%2Fspool_in.c;h=f393d4d3eccdf05ca8d2e25f57a91c611c9b2b7f;hb=7d8d08c484958a90f5d5744894b9bc2f723bee4e;hp=101a6c40cfb94245f3869a806e1383d0b996c25a;hpb=f3ebb786e451da973560f1c9d8cdb151d25108b5;p=exim.git diff --git a/src/src/spool_in.c b/src/src/spool_in.c index 101a6c40c..f393d4d3e 100644 --- a/src/src/spool_in.c +++ b/src/src/spool_in.c @@ -52,7 +52,7 @@ for (int i = 0; i < 2; i++) uschar * fname; int save_errno; - message_subdir[0] = split_spool_directory == i ? '\0' : id[5]; + set_subdir_str(message_subdir, id, i); fname = spool_fname(US"input", message_subdir, id, US"-D"); DEBUG(D_deliver) debug_printf("Trying spool file %s\n", fname); @@ -185,7 +185,7 @@ BOOL right = buffer[1] == 'Y'; if (n < 5) return FALSE; /* malformed line */ buffer[n-1] = 0; /* Remove \n */ -node = store_get(sizeof(tree_node) + n - 3, is_tainted(buffer)); +node = store_get(sizeof(tree_node) + n - 3, TRUE); /* rcpt names tainted */ *connect = node; Ustrcpy(node->name, buffer + 3); node->data.ptr = NULL; @@ -341,7 +341,6 @@ int n; int rcount = 0; long int uid, gid; BOOL inheader = FALSE; -uschar *p; /* Reset all the global variables to their default values. However, there is one exception. DO NOT change the default value of dont_deliver, because it may @@ -356,7 +355,7 @@ and unsplit directories, as for the data file above. */ for (int n = 0; n < 2; n++) { if (!subdir_set) - message_subdir[0] = split_spool_directory == (n == 0) ? name[5] : 0; + set_subdir_str(message_subdir, name, n); if ((fp = Ufopen(spool_fname(US"input", message_subdir, name, US""), "rb"))) break; @@ -387,7 +386,8 @@ and the number of warning messages for delivery delays that have been sent. */ if (Ufgets(big_buffer, big_buffer_size, fp) == NULL) goto SPOOL_READ_ERROR; -p = big_buffer + Ustrlen(big_buffer); +{ +uschar *p = big_buffer + Ustrlen(big_buffer); while (p > big_buffer && isspace(p[-1])) p--; *p = 0; if (!isdigit(p[-1])) goto SPOOL_FORMAT_ERROR; @@ -400,6 +400,7 @@ while (p > big_buffer && (isdigit(p[-1]) || '-' == p[-1])) p--; uid = Uatoi(p); if (p <= big_buffer || *(--p) != ' ') goto SPOOL_FORMAT_ERROR; *p = 0; +} originator_login = string_copy(big_buffer); originator_uid = (uid_t)uid; @@ -449,6 +450,7 @@ for (;;) int len; BOOL tainted; uschar * var; + const uschar * p; if (Ufgets(big_buffer, big_buffer_size, fp) == NULL) goto SPOOL_READ_ERROR; if (big_buffer[0] != '-') break; @@ -659,7 +661,7 @@ for (;;) case 't': if (Ustrncmp(p, "ls_", 3) == 0) { - uschar * q = p + 3; + const uschar * q = p + 3; if (Ustrncmp(q, "certificate_verified", 20) == 0) tls_in.certificate_verified = TRUE; else if (Ustrncmp(q, "cipher", 6) == 0) @@ -708,7 +710,7 @@ host_build_sender_fullhost(); #ifndef COMPILE_UTILITY DEBUG(D_deliver) debug_printf("sender_local=%d ident=%s\n", f.sender_local, - (sender_ident == NULL)? US"unset" : sender_ident); + sender_ident ? sender_ident : US"unset"); #endif /* COMPILE_UTILITY */ /* We now have the tree of addresses NOT to deliver to, or a line @@ -920,8 +922,8 @@ while ((n = fgetc(fp)) != EOF) if (h->type == htype_received) received_count++; - if (header_list == NULL) header_list = h; - else header_last->next = h; + if (header_list) header_last->next = h; + else header_list = h; header_last = h; for (i = 0; i < n; i++) @@ -973,7 +975,7 @@ if (errno != 0) fclose(fp); errno = n; - return inheader? spool_read_hdrerror : spool_read_enverror; + return inheader ? spool_read_hdrerror : spool_read_enverror; } SPOOL_FORMAT_ERROR: