- Polgengui raises the wrong type of exception. #471078

- Change semanage to not allow it to semanage module -D
- Change setsebool to suggest run as root on failure
This commit is contained in:
Dan Walsh 2011-01-06 14:38:19 -05:00
parent 448a84b06a
commit c76dc0c642
2 changed files with 39 additions and 2 deletions

View File

@ -4845,3 +4845,39 @@ index 8f4f663..b0a7e09 100644
} }
} }
diff --git a/policycoreutils/setsebool/setsebool.c b/policycoreutils/setsebool/setsebool.c
index dc037dd..d6c041b 100644
--- a/policycoreutils/setsebool/setsebool.c
+++ b/policycoreutils/setsebool/setsebool.c
@@ -82,8 +82,13 @@ static int selinux_set_boolean_list(size_t boolcnt,
if (errno == ENOENT)
fprintf(stderr, "Could not change active booleans: "
"Invalid boolean\n");
- else if (errno)
- perror("Could not change active booleans");
+ else if (errno) {
+ if (getuid() == 0) {
+ perror("Could not change active booleans");
+ } else {
+ perror("Could not change active booleans. Please try as root");
+ }
+ }
return -1;
}
@@ -115,8 +120,13 @@ static int semanage_set_boolean_list(size_t boolcnt,
goto err;
} else if (managed == 0) {
- fprintf(stderr,
- "Cannot set persistent booleans without managed policy.\n");
+ if (getuid() == 0) {
+ fprintf(stderr,
+ "Cannot set persistent booleans without managed policy.\n");
+ } else {
+ fprintf(stderr,
+ "Cannot set persistent booleans, please try as root.\n");
+ }
goto err;
}

View File

@ -7,7 +7,7 @@
Summary: SELinux policy core utilities Summary: SELinux policy core utilities
Name: policycoreutils Name: policycoreutils
Version: 2.0.85 Version: 2.0.85
Release: 2%{?dist} Release: 3%{?dist}
License: GPLv2 License: GPLv2
Group: System Environment/Base Group: System Environment/Base
# Based on git repository with tag 20101221 # Based on git repository with tag 20101221
@ -329,9 +329,10 @@ fi
exit 0 exit 0
%changelog %changelog
* Tue Jan 4 2011 Dan Walsh <dwalsh@redhat.com> 2.0.85-3 * Wed Jan 5 2011 Dan Walsh <dwalsh@redhat.com> 2.0.85-3
- Polgengui raises the wrong type of exception. #471078 - Polgengui raises the wrong type of exception. #471078
- Change semanage to not allow it to semanage module -D - Change semanage to not allow it to semanage module -D
- Change setsebool to suggest run as root on failure
* Wed Dec 22 2010 Dan Walsh <dwalsh@redhat.com> 2.0.85-2 * Wed Dec 22 2010 Dan Walsh <dwalsh@redhat.com> 2.0.85-2
- Fix restorecond watching utmp file for people logging in our out - Fix restorecond watching utmp file for people logging in our out