diff options
author | Daniel Golle <daniel@makrotopia.org> | 2022-05-03 01:55:31 +0100 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2022-05-03 02:00:21 +0100 |
commit | 9e11b3723ce30b9b8c94ad7d15072a10cf13c0b4 (patch) | |
tree | ee9117f765760fb7f9816eb8eeda6b7aae132a41 | |
parent | 0917d223d14bca9edd3f8c91e2828a7a960a21d1 (diff) | |
download | fstools-9e11b3723ce30b9b8c94ad7d15072a10cf13c0b4.tar.gz |
fstools: remove SELinux restorecon hack
Now that procd takes care of it properly we no longer need this hack.
Remove it to safe some space also on non-SELinux systems.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
-rw-r--r-- | libfstools/libfstools.h | 1 | ||||
-rw-r--r-- | libfstools/mount.c | 25 | ||||
-rw-r--r-- | libfstools/overlay.c | 1 |
3 files changed, 0 insertions, 27 deletions
diff --git a/libfstools/libfstools.h b/libfstools/libfstools.h index 340e2dc..be20fad 100644 --- a/libfstools/libfstools.h +++ b/libfstools/libfstools.h @@ -62,6 +62,5 @@ extern void overlay_delete(const char *dir, bool keep_sysupgrade); enum fs_state fs_state_get(const char *dir); int fs_state_set(const char *dir, enum fs_state state); -void selinux_restorecon(char *overlaydir); #endif diff --git a/libfstools/mount.c b/libfstools/mount.c index 3d4111f..8646c19 100644 --- a/libfstools/mount.c +++ b/libfstools/mount.c @@ -86,24 +86,6 @@ pivot(char *new, char *old) return 0; } -void -selinux_restorecon(char *overlaydir) -{ - struct stat s; - pid_t restorecon_pid; - int status; - - /* on non-SELinux system we don't have /sbin/restorecon, return */ - if (stat("/sbin/restorecon", &s)) - return; - - restorecon_pid = fork(); - if (!restorecon_pid) - exit(execl("/sbin/restorecon", "restorecon", overlaydir, (char *) NULL)); - else if (restorecon_pid > 0) - waitpid(restorecon_pid, &status, 0); -} - /** * fopivot - switch to overlay using passed dir as upper one * @@ -130,13 +112,6 @@ fopivot(char *rw_root, char *ro_root) upperdir, workdir); /* - * Initialize SELinux security label on newly created overlay - * filesystem where /upper doesn't yet exist - */ - if (stat(upperdir, &st)) - selinux_restorecon(rw_root); - - /* * Overlay FS v23 and later requires both a upper and * a work directory, both on the same filesystem, but * not part of the same subtree. diff --git a/libfstools/overlay.c b/libfstools/overlay.c index 6790337..4cc319e 100644 --- a/libfstools/overlay.c +++ b/libfstools/overlay.c @@ -195,7 +195,6 @@ switch2jffs(struct volume *v) ULOG_ERR("failed - mount -t jffs2 %s %s: %m\n", v->blk, OVERLAYDIR); return -1; } - selinux_restorecon(OVERLAYDIR); if (mount("none", "/", NULL, MS_NOATIME | MS_REMOUNT, 0)) { ULOG_ERR("failed - mount -o remount,ro none: %m\n"); |