summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ck-sysdeps-linux.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ck-sysdeps-linux.c b/src/ck-sysdeps-linux.c
index e4f6e86..1331cca 100644
--- a/src/ck-sysdeps-linux.c
+++ b/src/ck-sysdeps-linux.c
@@ -998,14 +998,22 @@ ck_make_tmpfs (guint uid, guint gid, const gchar *dest)
{
#ifdef HAVE_SYS_MOUNT_H
gchar *opts;
+ gchar *context;
int result;
TRACE ();
- opts = g_strdup_printf ("mode=0700,uid=%d", uid);
+ context = ck_selinux_lookup_context(dest);
+ if (context) {
+ opts = g_strdup_printf ("mode=0700,uid=%d,rootcontext=%s", uid, context);
+ } else {
+ opts = g_strdup_printf ("mode=0700,uid=%d", uid);
+ }
+ g_debug ("mounting tmpfs. uid=%d, gid=%d, dest=%s, opts=%s", uid, gid, dest, opts);
result = mount("none", dest, "tmpfs", 0, opts);
+ g_free (context);
g_free (opts);
if (result == 0) {