]> granicus.if.org Git - cronie/commitdiff
Raw context should be used. Especially when mcstransd in older
authorMarcela Mašláňová <mmaslano@redhat.com>
Thu, 6 Oct 2011 07:01:12 +0000 (09:01 +0200)
committerMarcela Mašláňová <mmaslano@redhat.com>
Thu, 6 Oct 2011 07:01:12 +0000 (09:01 +0200)
releases is running.

src/security.c

index f6940a5336a4da50e1a83739f4f5bb5ad42fcba6..34c940e4d3242bc0b68ee19e5c0c3336e65e4b76 100644 (file)
@@ -456,6 +456,7 @@ get_security_context(const char *name, int crontab_fd,
 #ifdef WITH_SELINUX
        security_context_t scontext = NULL;
        security_context_t file_context = NULL;
+       security_context_t rawcontext=NULL;
        int retval = 0;
        char *seuser = NULL;
        char *level = NULL;
@@ -474,6 +475,10 @@ get_security_context(const char *name, int crontab_fd,
 
        retval = get_default_context_with_level(name == NULL ? "system_u" : seuser,
                level, NULL, &scontext);
+       if (selinux_trans_to_raw_context(scontext, &rawcontext) == 0) {
+               freecon(scontext);
+               scontext = rawcontext;
+       }
        free(seuser);
        free(level);
        if (retval) {