X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/c988f1f4faa9f679f79beddf3c14676c5dcb8e28..4263f395efd136dece52d765dfcff3c96f17506e:/src/src/directory.c diff --git a/src/src/directory.c b/src/src/directory.c index a3a24a5da..c6d46aa5d 100644 --- a/src/src/directory.c +++ b/src/src/directory.c @@ -1,10 +1,8 @@ -/* $Cambridge: exim/src/src/directory.c,v 1.2 2005/01/04 10:00:42 ph10 Exp $ */ - /************************************************* * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2005 */ +/* Copyright (c) University of Cambridge 1995 - 2009 */ /* See the file NOTICE for conditions of use and distribution. */ #include "exim.h" @@ -36,10 +34,12 @@ Returns: panic on failure if panic is set; otherwise return FALSE; */ BOOL -directory_make(uschar *parent, uschar *name, int mode, BOOL panic) +directory_make(const uschar *parent, const uschar *name, + int mode, BOOL panic) { BOOL use_chown = parent == spool_directory && geteuid() == root_uid; -uschar *p, *slash; +uschar *p; +const uschar *slash; int c = 1; struct stat statbuf; uschar buffer[256]; @@ -47,7 +47,7 @@ uschar buffer[256]; if (parent == NULL) { p = buffer + 1; - slash = parent = US""; + slash = parent = CUS""; } else { @@ -74,13 +74,13 @@ while (c != 0 && *p != 0) /* Set the ownership if necessary. */ - if (use_chown) Uchown(buffer, exim_uid, exim_gid); + if (use_chown) (void)Uchown(buffer, exim_uid, exim_gid); /* It appears that any mode bits greater than 0777 are ignored by mkdir(), at least on some operating systems. Therefore, if the mode contains any such bits, do an explicit mode setting. */ - if ((mode & 0777000) != 0) Uchmod(buffer, mode); + if ((mode & 0777000) != 0) (void)Uchmod(buffer, mode); } *p++ = c; }