mirror of
https://github.com/containers/fuse-overlayfs.git
synced 2025-09-14 09:46:33 -04:00
Merge pull request #389 from giuseppe/check-for-acl-support
main: check that ACLs are supported in the lower layers
This commit is contained in:
commit
b622e9a955
4
NEWS
4
NEWS
@ -1,3 +1,7 @@
|
||||
* fuse-overlayfs-1.11
|
||||
|
||||
- main: if a lower layer doesn't support ACLs do not enable them.
|
||||
|
||||
* fuse-overlayfs-1.10
|
||||
|
||||
- main: use /proc/self/fd to read xattrs.
|
||||
|
@ -1,5 +1,5 @@
|
||||
AC_PREREQ([2.69])
|
||||
AC_INIT([fuse-overlayfs], [1.11-dev], [giuseppe@scrivano.org])
|
||||
AC_INIT([fuse-overlayfs], [1.12-dev], [giuseppe@scrivano.org])
|
||||
AC_CONFIG_SRCDIR([main.c])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
|
||||
|
11
direct.c
11
direct.c
@ -206,6 +206,16 @@ direct_num_of_layers (const char *opaque, const char *path)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static bool
|
||||
direct_support_acls (struct ovl_layer *l)
|
||||
{
|
||||
char value[32];
|
||||
|
||||
return fgetxattr (l->fd, ACL_XATTR, value, sizeof (value)) >= 0
|
||||
|| errno != ENOTSUP;
|
||||
}
|
||||
|
||||
|
||||
struct data_source direct_access_ds =
|
||||
{
|
||||
.num_of_layers = direct_num_of_layers,
|
||||
@ -221,4 +231,5 @@ struct data_source direct_access_ds =
|
||||
.getxattr = direct_getxattr,
|
||||
.listxattr = direct_listxattr,
|
||||
.readlinkat = direct_readlinkat,
|
||||
.support_acls = direct_support_acls,
|
||||
};
|
||||
|
@ -24,6 +24,8 @@
|
||||
# include <stdbool.h>
|
||||
# include <sys/types.h>
|
||||
|
||||
# define ACL_XATTR "system.posix_acl_default"
|
||||
|
||||
typedef struct hash_table Hash_table;
|
||||
|
||||
struct ovl_ino
|
||||
@ -151,6 +153,7 @@ struct data_source
|
||||
int (*listxattr)(struct ovl_layer *l, const char *path, char *buf, size_t size);
|
||||
int (*getxattr)(struct ovl_layer *l, const char *path, const char *name, char *buf, size_t size);
|
||||
ssize_t (*readlinkat)(struct ovl_layer *l, const char *path, char *buf, size_t bufsiz);
|
||||
bool (*support_acls)(struct ovl_layer *l);
|
||||
};
|
||||
|
||||
/* passthrough to the file system. */
|
||||
|
8
main.c
8
main.c
@ -66,8 +66,6 @@
|
||||
#include <utils.h>
|
||||
#include <plugin.h>
|
||||
|
||||
#define ACL_XATTR "system.posix_acl_default"
|
||||
|
||||
#ifndef TEMP_FAILURE_RETRY
|
||||
#define TEMP_FAILURE_RETRY(expression) \
|
||||
(__extension__ \
|
||||
@ -5764,6 +5762,12 @@ main (int argc, char *argv[])
|
||||
|
||||
lo.layers = layers;
|
||||
|
||||
for (tmp_layer = layers; !lo.noacl && tmp_layer; tmp_layer = tmp_layer->next)
|
||||
{
|
||||
if (! tmp_layer->ds->support_acls (tmp_layer))
|
||||
lo.noacl = 1;
|
||||
}
|
||||
|
||||
if (lo.upperdir)
|
||||
{
|
||||
if (lo.xattr_permissions)
|
||||
|
Loading…
x
Reference in New Issue
Block a user