git://git.exim.org
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix DKIM information leakage
[exim.git]
/
src
/
src
/
directory.c
diff --git
a/src/src/directory.c
b/src/src/directory.c
index 5d1d866af342c58c364dab6b9f55d602274b0a0f..5c55a4524b66e8a4baff930898a0b137830c7b2b 100644
(file)
--- a/
src/src/directory.c
+++ b/
src/src/directory.c
@@
-1,10
+1,8
@@
-/* $Cambridge: exim/src/src/directory.c,v 1.4 2006/02/07 11:19:00 ph10 Exp $ */
-
/*************************************************
* Exim - an Internet mail transport agent *
*************************************************/
/*************************************************
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 200
6
*/
+/* Copyright (c) University of Cambridge 1995 - 200
9
*/
/* See the file NOTICE for conditions of use and distribution. */
#include "exim.h"
/* 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
*/
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;
{
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];
int c = 1;
struct stat statbuf;
uschar buffer[256];
@@
-47,7
+47,7
@@
uschar buffer[256];
if (parent == NULL)
{
p = buffer + 1;
if (parent == NULL)
{
p = buffer + 1;
- slash = parent = US"";
+ slash = parent =
C
US"";
}
else
{
}
else
{
@@
-74,7
+74,12
@@
while (c != 0 && *p != 0)
/* Set the ownership if necessary. */
/* Set the ownership if necessary. */
- if (use_chown) (void)Uchown(buffer, exim_uid, exim_gid);
+ if (use_chown && Uchown(buffer, exim_uid, exim_gid))
+ {
+ if (!panic) return FALSE;
+ log_write(0, LOG_MAIN|LOG_PANIC_DIE,
+ "Failed to set owner on directory \"%s\": %s\n", buffer, strerror(errno));
+ }
/* It appears that any mode bits greater than 0777 are ignored by
mkdir(), at least on some operating systems. Therefore, if the mode
/* It appears that any mode bits greater than 0777 are ignored by
mkdir(), at least on some operating systems. Therefore, if the mode