From a39349267020e61f0015efc621ffac98545bd8f0 Mon Sep 17 00:00:00 2001 From: dwalsh Date: Apr 01 2004 20:28:43 +0000 Subject: fix selinux handling --- diff --git a/userhelper.c b/userhelper.c index f270647..9c8109a 100644 --- a/userhelper.c +++ b/userhelper.c @@ -1145,8 +1145,6 @@ get_user_for_auth(shvarFile *s) /* Ensure that the system knows who the user is before * returning the user's name. */ - new_context = strdup(context_str(ctx)); - context_free(ctx); pwd = getpwnam(ruid_user); if (pwd != NULL) { ret = ruid_user; @@ -1154,6 +1152,11 @@ get_user_for_auth(shvarFile *s) context_user_set(ctx, "root"); ret = NULL; } + new_context = strdup(context_str(ctx)); + context_free(ctx); +#ifdef DEBUG_USERHELPER + g_print("userhelper: context = '%s'\n", new_context); +#endif } #endif if (ret == NULL) { @@ -1720,7 +1723,7 @@ wrap(const char *user, const char *program, !S_ISREG(sbuf.st_mode) || (sbuf.st_mode & S_IWOTH)) { #ifdef DEBUG_USERHELPER - g_print("userhelper: bad file permissions\n"); + g_print("userhelper: bad file permissions: %s \n", apps_filename); #endif exit(ERR_UNK_ERROR); } @@ -2120,11 +2123,11 @@ wrap(const char *user, const char *program, #ifdef DEBUG_USERHELPER g_print("userhelper: running '%s' with root privileges " "in context '%s' on behalf of '%s'\n", cmdline, - context_str(new_context), user); + new_context, user); #endif syslog(LOG_NOTICE, "running '%s' with root privileges " "in '%s' context on behalf of '%s'", cmdline, - context_str(new_context), user); + new_context, user); } else { #ifdef DEBUG_USERHELPER g_print("userhelper: running '%s' with root privileges " diff --git a/usermode.spec b/usermode.spec index 5166721..ce2e6a3 100644 --- a/usermode.spec +++ b/usermode.spec @@ -6,7 +6,7 @@ Summary: Tools for certain user account management tasks. Name: usermode Version: 1.70 -Release: 1 +Release: 2 License: GPL Group: Applications/System Source: usermode-%{version}-%{release}.tar.gz @@ -120,6 +120,9 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/applications/* %changelog +* Thu Apr 1 2004 Dan Walsh 1.70-1 +- Change user context to "root" if username context "user_t" not in passwd file + * Wed Mar 31 2004 Nalin Dahyabhai 1.70-1 - fix accidental mixup of role and type setting up new selinux context - log the new selinux context if we're running an app in a new selinux context