eacces-error.c revision a497e8b94b55e035a1ebd28cf1368a8869ddaa62
/* Copyright (c) 2007-2011 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "str.h"
#include "abspath.h"
#include "ipwd.h"
#include "restrict-access.h"
#include "eacces-error.h"
#include <unistd.h>
{
unsigned int i, count;
return TRUE;
for (i = 0; i < count; i++) {
return TRUE;
}
return FALSE;
}
{
return 0;
}
return -1;
}
/* access() uses real uid, not effective uid.
we'll have to do these checks manually. */
switch (mode) {
case X_OK:
return 0;
return 0;
return -1;
case R_OK:
mode = 04;
break;
case W_OK:
mode = 02;
break;
default:
i_unreached();
}
return -1;
}
else
return 0;
return -1;
}
static const char *
{
orig_errno = errno;
if (*path != '/') {
if (t_get_current_dir(&dir) == 0) {
}
}
case -1:
break;
case 0:
break;
default:
break;
}
case -1:
break;
case 0:
break;
default:
break;
}
break;
if (ret == 0)
break;
/* see if we have access to parent directory */
/* probably mkdir_parents() failed here, find the first
parent directory we couldn't create */
} else {
/* some other error, can't handle it */
break;
}
}
if (ret == 0) {
/* dir is the first parent directory we can stat() */
missing_mode = 1;
}
missing_mode = 2;
}
/* this produces a wrong error if the operation didn't
actually need write permissions, but we don't know
it here.. */
missing_mode = 4;
}
} else {
}
}
if (ret < 0)
;
} else {
}
} else if (missing_mode != 0 &&
} else {
}
}
}
errno = orig_errno;
}
{
}
{
}
{
int orig_errno = errno;
if (gid_origin != NULL)
errno = orig_errno;
}