utils: enable override only for directories and files

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2020-11-11 11:18:41 +01:00
parent fc9de46ebf
commit 7868e49da8
No known key found for this signature in database
GPG Key ID: E4730F97F60286ED

10
utils.c
View File

@ -240,6 +240,16 @@ override_mode (struct ovl_layer *l, int fd, const char *abs_path, const char *pa
cleanup_close int cleanup_fd = -1; cleanup_close int cleanup_fd = -1;
const char *xattr_name; const char *xattr_name;
switch (st->st_mode & S_IFMT)
{
case S_IFDIR:
case S_IFREG:
break;
default:
return 0;
}
switch (l->stat_override_mode) switch (l->stat_override_mode)
{ {
case STAT_OVERRIDE_NONE: case STAT_OVERRIDE_NONE: