mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-27 14:30:32 +00:00
start: print_top_failing_dir()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
6be5397b86
commit
9e5f5f2fee
@ -99,23 +99,30 @@ static void lxc_destroy_container_on_signal(struct lxc_handler *handler,
|
|||||||
|
|
||||||
static void print_top_failing_dir(const char *path)
|
static void print_top_failing_dir(const char *path)
|
||||||
{
|
{
|
||||||
size_t len = strlen(path);
|
int ret;
|
||||||
char *copy = alloca(len + 1), *p, *e, saved;
|
size_t len;
|
||||||
strcpy(copy, path);
|
char *copy, *e, *p, saved;
|
||||||
|
|
||||||
|
len = strlen(path);
|
||||||
|
copy = alloca(len + 1);
|
||||||
|
strcpy(copy, path);
|
||||||
p = copy;
|
p = copy;
|
||||||
e = copy + len;
|
e = copy + len;
|
||||||
while (p < e) {
|
while (p < e) {
|
||||||
while (p < e && *p == '/')
|
while (p < e && *p == '/')
|
||||||
p++;
|
p++;
|
||||||
|
|
||||||
while (p < e && *p != '/')
|
while (p < e && *p != '/')
|
||||||
p++;
|
p++;
|
||||||
|
|
||||||
saved = *p;
|
saved = *p;
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
if (access(copy, X_OK)) {
|
|
||||||
|
ret = access(copy, X_OK);
|
||||||
|
if (ret != 0) {
|
||||||
SYSERROR("Could not access %s. Please grant it x "
|
SYSERROR("Could not access %s. Please grant it x "
|
||||||
"access, or add an ACL for the container "
|
"access, or add an ACL for the container "
|
||||||
"root.", copy);
|
"root", copy);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
*p = saved;
|
*p = saved;
|
||||||
|
Loading…
Reference in New Issue
Block a user