* Tim Martin
* $Id: checkpw.c,v 1.49 2002/03/07 19:14:04 ken3 Exp $
*/
+/* Copyright (c) The Exim Maintainers 2021 - 2022 */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (c) 2001 Carnegie Mellon University. All rights reserved.
*
const char *passwd,
const char **reply)
{
-userid = userid; /* Keep picky compilers happy */
-passwd = passwd;
*reply = "pwcheck support is not included in this Exim binary";
return PWCHECK_FAIL;
}
s = socket(AF_UNIX, SOCK_STREAM, 0);
if (s == -1) { return PWCHECK_FAIL; }
- memset((char *)&srvaddr, 0, sizeof(srvaddr));
+ memset(CS &srvaddr, 0, sizeof(srvaddr));
srvaddr.sun_family = AF_UNIX;
strncpy(srvaddr.sun_path, CYRUS_PWCHECK_SOCKET, sizeof(srvaddr.sun_path));
r = connect(s, (struct sockaddr *)&srvaddr, sizeof(srvaddr));
return PWCHECK_FAIL;
}
- iov[0].iov_base = (char *)userid;
+ iov[0].iov_base = CS userid;
iov[0].iov_len = strlen(userid)+1;
- iov[1].iov_base = (char *)passwd;
+ iov[1].iov_base = CS passwd;
iov[1].iov_len = strlen(passwd)+1;
retry_writev(s, iov, 2);
const uschar *realm,
const uschar **reply)
{
-userid = userid; /* Keep picky compilers happy */
-passwd = passwd;
-service = service;
-realm = realm;
*reply = US"saslauthd support is not included in this Exim binary";
return PWCHECK_FAIL;
}
return PWCHECK_FAIL;
}
- memset((char *)&srvaddr, 0, sizeof(srvaddr));
+ memset(CS &srvaddr, 0, sizeof(srvaddr));
srvaddr.sun_family = AF_UNIX;
strncpy(srvaddr.sun_path, CYRUS_SASLAUTHD_SOCKET,
sizeof(srvaddr.sun_path));
if (count > MAX_REQ_LEN) {
return -1;
} else {
- *retval = store_get(count + 1);
+ /* Assume the file is trusted, so no tainting */
+ *retval = store_get(count + 1, GET_UNTAINTED);
rc = (retry_read(fd, *retval, count) < (int) count);
(*retval)[count] = '\0';
return count;
{
int n;
int nread = 0;
- char *buf = (char *)inbuf;
+ char *buf = CS inbuf;
if (nbyte == 0) return 0;
for (i = 0; i < iovcnt; i++) {
if (iov[i].iov_len > (unsigned) n) {
- iov[i].iov_base = (char *)iov[i].iov_base + n;
+ iov[i].iov_base = CS iov[i].iov_base + n;
iov[i].iov_len -= n;
break;
}