X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Flookups%2Flf_check_file.c;h=7f0f12806e9270e27d564236f79ec614baf4ddc2;hb=refs%2Ftags%2Fexim-4_94_RC0;hp=0ef5f5b67b1b8ac49fd81914412cdaf04f64e979;hpb=c988f1f4faa9f679f79beddf3c14676c5dcb8e28;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/lookups/lf_check_file.c b/src/src/lookups/lf_check_file.c index 0ef5f5b67..7f0f12806 100644 --- a/src/src/lookups/lf_check_file.c +++ b/src/src/lookups/lf_check_file.c @@ -1,10 +1,9 @@ -/* $Cambridge: exim/src/src/lookups/lf_check_file.c,v 1.2 2005/01/04 10:00:44 ph10 Exp $ */ - /************************************************* * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2005 */ +/* Copyright (c) University of Cambridge 1995 - 2009 */ +/* Copyright (c) The Exim Maintainers 2020 */ /* See the file NOTICE for conditions of use and distribution. */ @@ -40,10 +39,9 @@ Side effect: sets errno to ERRNO_BADUGID, ERRNO_NOTREGULAR or ERRNO_BADMODE for */ int -lf_check_file(int fd, uschar *filename, int s_type, int modemask, uid_t *owners, - gid_t *owngroups, char *type, uschar **errmsg) +lf_check_file(int fd, const uschar * filename, int s_type, int modemask, + uid_t * owners, gid_t * owngroups, const char * type, uschar ** errmsg) { -int i; struct stat statbuf; if ((fd >= 0 && fstat(fd, &statbuf) != 0) || @@ -84,7 +82,7 @@ if ((statbuf.st_mode & modemask) != 0) if (owners != NULL) { BOOL uid_ok = FALSE; - for (i = 1; i <= (int)owners[0]; i++) + for (int i = 1; i <= (int)owners[0]; i++) if (owners[i] == statbuf.st_uid) { uid_ok = TRUE; break; } if (!uid_ok) { @@ -98,7 +96,7 @@ if (owners != NULL) if (owngroups != NULL) { BOOL gid_ok = FALSE; - for (i = 1; i <= (int)owngroups[0]; i++) + for (int i = 1; i <= (int)owngroups[0]; i++) if (owngroups[i] == statbuf.st_gid) { gid_ok = TRUE; break; } if (!gid_ok) {