Unverified Commit 2e3890af by Christian Brauner Committed by GitHub

Merge pull request #2037 from hallyn/2017-12-14/dir_detect_eperm

dir_detect: warn on eperm
parents 12401528 3d8869c3
......@@ -136,10 +136,19 @@ int dir_destroy(struct lxc_storage *orig)
bool dir_detect(const char *path)
{
struct stat statbuf;
int ret;
if (!strncmp(path, "dir:", 4))
return true;
if (is_dir(path))
ret = stat(path, &statbuf);
if (ret == -1 && errno == EPERM) {
SYSERROR("dir_detect: failed to look at \"%s\"", path);
return false;
}
if (ret == 0 && S_ISDIR(statbuf.st_mode))
return true;
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment