summaryrefslogtreecommitdiff
path: root/lib/exclude.c
diff options
context:
space:
mode:
authorGao Xiang <hsiangkao@redhat.com>2020-06-08 21:08:54 +0800
committerGao Xiang <hsiangkao@redhat.com>2020-06-08 21:15:05 +0800
commit3e52a3337f8e63bf40dbda7a8f3269026681e883 (patch)
tree9ab0f3f73b6508be7518ba2bf2b2c8784112e091 /lib/exclude.c
parent0c699795ba2bf3a13b604e133262959bd8b32bc2 (diff)
erofs-utils: support selinux file contexts
Add --file-contexts flag that allows passing a selinux file_context file to setup file selabels. Reviewed-and-tested-by: Li Guifu <bluce.lee@aliyun.com> Link: https://lore.kernel.org/r/20200608130854.16953-1-hsiangkao@aol.com Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
Diffstat (limited to 'lib/exclude.c')
-rw-r--r--lib/exclude.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/exclude.c b/lib/exclude.c
index 47b467d..73b3720 100644
--- a/lib/exclude.c
+++ b/lib/exclude.c
@@ -17,13 +17,6 @@
static LIST_HEAD(exclude_head);
static LIST_HEAD(regex_exclude_head);
-static unsigned int rpathlen; /* root directory prefix length */
-
-void erofs_exclude_set_root(const char *rootdir)
-{
- rpathlen = strlen(rootdir);
-}
-
static void dump_regerror(int errcode, const char *s, const regex_t *preg)
{
char str[512];
@@ -120,10 +113,7 @@ struct erofs_exclude_rule *erofs_is_exclude_path(const char *dir,
s = buf;
}
- s += rpathlen;
- while (*s == '/')
- s++;
-
+ s = erofs_fspath(s);
list_for_each_entry(r, &exclude_head, list) {
if (!strcmp(r->pattern, s))
return r;