- Fix output of getsebool.

This commit is contained in:
Daniel J Walsh 2004-11-12 13:03:50 +00:00
parent 38be80f2c3
commit 437c89fe9f
2 changed files with 49 additions and 3 deletions

View File

@ -1,5 +1,48 @@
--- libselinux-1.19.1/utils/setsebool.c.rhat 2004-11-09 09:14:24.000000000 -0500
+++ libselinux-1.19.1/utils/setsebool.c 2004-11-09 09:19:31.770804491 -0500
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man8/getsebool.8 libselinux-1.19.1/man/man8/getsebool.8
--- nsalibselinux/man/man8/getsebool.8 2004-11-02 14:26:19.000000000 -0500
+++ libselinux-1.19.1/man/man8/getsebool.8 2004-11-12 08:02:41.221727482 -0500
@@ -8,13 +8,12 @@
.SH "DESCRIPTION"
.B getsebool
-reports the current state of either a particular SELinux boolean or
-all SELinux booleans. The state consists of two values, the active
-value and the pending value. The active value indicates the value
-that is presently applied to the policy. The pending value indicates
+reports where a particular SELinux boolean or
+all SELinux booleans are active or inactive.
+In certain situations a boolean can be in one state with a pending
+change to the other state. getsebool will report this as a pending change.
+The pending value indicates
the value that will be applied upon the next boolean commit.
-Typically, these values will be the same; they only differ when in the
-middle of a boolean change transaction.
The setting of boolean values occurs in two stages; first the pending
value is changed, then the booleans are committed, causing their
diff --exclude-from=exclude -N -u -r nsalibselinux/utils/getsebool.c libselinux-1.19.1/utils/getsebool.c
--- nsalibselinux/utils/getsebool.c 2004-11-09 09:13:54.000000000 -0500
+++ libselinux-1.19.1/utils/getsebool.c 2004-11-11 09:27:51.000000000 -0500
@@ -83,8 +83,14 @@
rc = -1;
goto out;
}
- printf("%s --> active: %d pending: %d\n", names[i],
- active, pending);
+ if (pending != active) {
+ printf("%s --> %s pending: %s\n", names[i],
+ ( active ? "active" : "inactive"),
+ ( pending ? "active" : "inactive"));
+ } else {
+ printf("%s --> %s\n", names[i],
+ ( active ? "active" : "inactive"));
+ }
}
out:
diff --exclude-from=exclude -N -u -r nsalibselinux/utils/setsebool.c libselinux-1.19.1/utils/setsebool.c
--- nsalibselinux/utils/setsebool.c 2004-11-09 09:13:54.000000000 -0500
+++ libselinux-1.19.1/utils/setsebool.c 2004-11-11 09:10:41.000000000 -0500
@@ -35,6 +35,8 @@
if (strcmp(argv[1], "-P") == 0) {

View File

@ -1,7 +1,7 @@
Summary: SELinux library and simple utilities
Name: libselinux
Version: 1.19.1
Release: 1
Release: 2
License: Public domain (uncopyrighted)
Group: System Environment/Libraries
Source: http://www.nsa.gov/selinux/archives/libselinux-%{version}.tgz
@ -85,6 +85,9 @@ rm -rf ${RPM_BUILD_ROOT}
%{_mandir}/man8/*
%changelog
* Fri Nov 12 2004 Dan Walsh <dwalsh@redhat.com> 1.19.1-2
- Fix output of getsebool.
* Tue Nov 9 2004 Dan Walsh <dwalsh@redhat.com> 1.19.1-1
- Update from upstream, fix setsebool -P segfault