*************************************************/
/* Copyright (c) University of Cambridge 1995 - 2018 */
-/* Copyright (c) The Exim maintainers 2020 */
+/* Copyright (c) The Exim maintainers 2020 - 2021 */
/* See the file NOTICE for conditions of use and distribution. */
/* This module contains code for extracting addresses from a forwarding list
*/
static uschar *
-rda_get_file_contents(redirect_block *rdata, int options, uschar **error,
+rda_get_file_contents(const redirect_block *rdata, int options, uschar **error,
int *yield)
{
FILE *fwd;
*/
static int
-rda_extract(redirect_block *rdata, int options, uschar *include_directory,
- uschar *sieve_vacation_directory, uschar *sieve_enotify_mailto_owner,
- uschar *sieve_useraddress, uschar *sieve_subaddress,
- address_item **generated, uschar **error, error_block **eblockp,
- int *filtertype)
+rda_extract(const redirect_block * rdata, int options,
+ const uschar * include_directory, const uschar * sieve_vacation_directory,
+ const uschar * sieve_enotify_mailto_owner, const uschar * sieve_useraddress,
+ const uschar * sieve_subaddress, address_item ** generated, uschar ** error,
+ error_block ** eblockp, int * filtertype)
{
-uschar *data;
+const uschar * data;
if (rdata->isfile)
{
static int
rda_write_string(int fd, const uschar *s)
{
-int len = (s == NULL)? 0 : Ustrlen(s) + 1;
+int len = s ? Ustrlen(s) + 1 : 0;
return ( write(fd, &len, sizeof(int)) != sizeof(int)
- || (s != NULL && write(fd, s, len) != len)
+ || (s && write(fd, s, len) != len)
)
? -1 : 0;
}
*/
int
-rda_interpret(redirect_block *rdata, int options, uschar *include_directory,
- uschar *sieve_vacation_directory, uschar *sieve_enotify_mailto_owner,
- uschar *sieve_useraddress, uschar *sieve_subaddress, ugid_block *ugid,
- address_item **generated, uschar **error, error_block **eblockp,
- int *filtertype, uschar *rname)
+rda_interpret(redirect_block * rdata, int options,
+ const uschar * include_directory, const uschar * sieve_vacation_directory,
+ const uschar * sieve_enotify_mailto_owner, const uschar * sieve_useraddress,
+ const uschar * sieve_subaddress, const ugid_block * ugid, address_item ** generated,
+ uschar ** error, error_block ** eblockp, int * filtertype, const uschar * rname)
{
int fd, rc, pfd[2];
int yield, status;
*error = string_sprintf("internal problem in %s: failure to transfer "
"data from subprocess: status=%04x%s%s%s", rname,
status, readerror,
- (*error == NULL)? US"" : US": error=",
- (*error == NULL)? US"" : *error);
+ *error ? US": error=" : US"",
+ *error ? *error : US"");
log_write(0, LOG_MAIN|LOG_PANIC, "%s", *error);
}
else if (status != 0)
- {
log_write(0, LOG_MAIN|LOG_PANIC, "internal problem in %s: unexpected status "
"%04x from redirect subprocess (but data correctly received)", rname,
status);
- }
FINAL_EXIT:
(void)close(fd);