Commit graph

430 commits

Author SHA1 Message Date
Dan Walsh
d9376680bd policycoreutils: sandbox: do not try forever to find available category set
We calculate the number of available legit category sets for a given
user and then try to find one that many times.  If we don't find one,
bail out.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-12-05 16:10:37 -05:00
Dan Walsh
78b077cd09 policycoreutils: sandbox: make sure the domain launching sandbox has at least 100 categories
100 is very high, but at least we know the chances of finding a valid
combination is high.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-12-05 16:10:37 -05:00
Dan Walsh
7ece124c51 policycoreutils: sandbox: Allow user to specify the DPI value for X in a sandbox
Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-12-05 16:10:37 -05:00
Dan Walsh
a6065e5ab7 policycoreutils: po: Makefile use -p to preserve times to allow multilib simultatious installs of po files
Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-12-05 16:10:37 -05:00
Eric Paris
cfb2a06e39 policycoreutils: sandbox: move sandbox.conf.5 to just sandbox.5
Since this file lives in /etc/sysconfig/ it does not include a .conf
extention.  Thus the man page should not include a .conf in the
filename.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-12-05 16:10:35 -05:00
Eric Paris
14e4b70b93 Bump Version and Changelog for commit 2011-11-03 15:26:36 -04:00
Dan Walsh
10fb8fdbb1 policycoreutils: restorecond: Add .local/share as a directory to watch
Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 16:22:06 -04:00
Dan Walsh
b9b7bddb28 policycoreutils: setfiles: fix use before initialized
There are code paths where ret can be returned without being initialized

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 16:22:06 -04:00
Dan Walsh
24b31a9da5 policycoreutils: semodule: Document semodule -p in man page
Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 16:22:06 -04:00
Eric Paris
e018eec325 policycoreutils: setfiles: close /proc/mounts file when finished
When testing for mount points to exclude we read /proc/mounts.  Close
this file when we are finished reading it.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 16:22:06 -04:00
Eric Paris
d5475a909a policycoreutils: make use of the new realpath_not_final function
Instead of coding the exact same thing and calling it symlink_realpath
use the function exported by libselinux.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 16:22:06 -04:00
Dan Walsh
1486820665 policycoreutils: semanage: Add -o description to the semanage man page
Just a bit of documentation.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 16:22:06 -04:00
Stephen Smalley
5e50b01fa4 policycoreutils: fix sandbox Makefile to support DESTDIR
Fix sandbox Makefile so that make DESTDIR=~/out install works again.

Signed-off-by:  Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 16:22:06 -04:00
Guido Trentalancia
88234671ed policycoreutils: semodule_package: remove semodule_unpackage on clean
semodule_unpackage was not being removed on clean.  Simple Makefile fix.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 16:22:05 -04:00
Eric Paris
e134013ab7 policycoreutils: sandbox: introduce package name and language stuff
Add support for translations to the sandbox utility.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 16:22:05 -04:00
Dan Walsh
4a145b76d0 policycoreutils: restorecond: make restorecond -u exit when terminal closes
Make restorecond -u watch the terminal io channel for and exit indicator
and then exit itself if it is not being run from dbus.  If being run
from dbus, dbus takes care of the session cleanup.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 16:22:05 -04:00
Dan Walsh
9961ca6499 policycoreutils: restorecon: Always check return code on asprintf
Do not assume it is always a success and error gracefully when it isn't.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 16:22:05 -04:00
Eric Paris
48681bb49c policycoreutils: restorecond: make restorecond dbuss-able
Basically this patch makes restorecond a dbus session service that can
be run in the users session to watch the creation of files in the
homedir.  Most of the changes are just to get it to run as a dbus
session and then to allow it to read its own config.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 16:22:05 -04:00
Eric Paris
672eb80648 policycoreutils: semanage: set modified correctly
I think I was trying to allow an admin to set a bunch of booleans
from a file, but I later added -i and -o options, which would seem to
be a better way to handle many changes at once.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 16:22:05 -04:00
Eric Paris
a67cd948c4 policycoreutils: semanage: missing modify=True
Basically we want to trigger a modify of booleans record if the user
specifies --on or --off on a boolean.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 16:22:05 -04:00
Eric Paris
9ef48acb37 policycoreutils: semanage: update local boolean settings is dealing with localstore
If someone modifies the boolean settings using semanage, we would
expect them to be reflected on the local system.  This change would
change the active settings IFF you are changing the currently running
system.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 16:22:05 -04:00
Eric Paris
1c15c8b537 policycoreutils: fixfiles: label /root but not /var/lib/BackupPC
This patch removes /root from the excluded dirs.

This also adds /var/lib/BackupPC to list of directories to ignore
labeling.  Mainly because this directory tends to be Huge and causes a
huge spike in the amount of time it takes to relabel.  Especially if
there is a relabel caused by a policy update.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 16:22:05 -04:00
Eric Paris
9cc0749a73 policycoreutils: audit2allow: use audit2why internally
Rather than do things ourselves, use audit2why.

Signed-off-by: Eric Paris <eparis@redhat.com>
2011-11-02 16:22:05 -04:00
Dan Walsh
5c2a0d143d policycoreutils: sandbox: Maintain the LANG environment into the sandbox
When running an app within a sandbox, the application currently
switches to no LANG.  This patch will cause the sandboxed app to use
the users LANG.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 16:22:05 -04:00
Steve Lawrence
2f68def633 libsepol: Move ebitmap_* functions from mcstrans to libsepol
This patches moves some ebitmap functions (and, xor, not, etc.) from
mcstrans into libsepol, where they really belong and could be used by
other applications (e.g. CIL)

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 15:37:11 -04:00
Eric Paris
468bff0952 tree: Makefiles: syntax, convert all ${VAR} to $(VAR)
This is purely personal preference.  Most of the Makefiles use $() for
Makefile variables, but a couple of places use ${}.  Since this obscured
some later Makefile changes I figured I'd just make them all the same up
front.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 15:37:08 -04:00
Eric Paris
5054b9019a bump version and changelog 2011-09-27 13:54:19 -04:00
Eric Paris
cfdfe498b7 policycoreutils: semanage: fix indentation error in seobject
Some versions of python are reporting an indentation error when trying
to use this file.  Fix the whitespace messup.

Signed-off-by: Eric Paris <eparis@redhat.com>
2011-09-27 13:52:16 -04:00
Eric Paris
418dbc70e8 Bump version and changelog for all components. 2011-09-16 15:34:36 -04:00
Dan Walsh
7a653efffc policycoreutils: sandbox: do not load unused generic init functions
Change sandbox init script to not load functions any longer, we don't use them

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
2011-09-16 11:54:04 -04:00
Guido Trentalancia
eb695e5a56 whole tree: default make target to all not install
Change the default "make" target for the libraries from "install" to
"all" in the makefiles.

Signed-off-by: Guido Trentalancia <guido@trentalancia.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-09-16 11:54:04 -04:00
Dan Walsh
9df5601b60 .gitignore: More files to ignore
add .pyc and the new unpackage to git ignore

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
2011-09-16 11:54:04 -04:00
Dan Walsh
42a523c0bd policycoreutils: semanage: Catch RuntimeErrors, that can be generated when SELinux is disabled
Exit cleanly instead of python getting angry when SELinux is disabled.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-09-16 11:54:03 -04:00
Dan Walsh
b1331909a0 policycoreutils: sepolgen: audit2allow is mistakakenly not allowing valid module names
module names must begin with a letter, optionally followed by letters,
numbers, "-", "_", "."\n'  some of these were being denied.

Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2011-09-16 11:54:03 -04:00
Dan Walsh
adbd558c1c policycoreutils: semanage: Dont print heading if no items selected
If you tell semanage to list the contents of an object and the list is
empty, we should not print the header.

Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2011-09-16 11:54:03 -04:00
Dan Walsh
90469f7f75 policycoreutils: semanage: show running and disk setting for booleans
Basically this patch will show the booleans current state in the system and
the state on disk.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2011-09-16 11:54:02 -04:00
Harry Ciao
e4bc1b223d libsepol: libsemanage: policycoreutils: Create a new preserve_tunables flag in sepol_handle_t.
By default only the effective branch of a tunable conditional would be
expanded and written to raw policy, while all needless unused branches
would be discarded.

Add a new option '-P' or "--preserve_tunables" to the semodule program.
By default it is 0, if set to 1 then the above preserve_tunables flag
in the sepol_handle_t would be set to 1 accordingly.

Signed-off-by: Harry Ciao <qingtao.cao@windriver.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-09-16 11:54:02 -04:00
Dan Walsh
216f456401 policycoreutils: sandbox: cntrl-c should kill entire process control group
Change the signal handler to handle ctrl-C and exit properly

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-09-16 11:54:00 -04:00
Dan Walsh
e8575bf497 policycoreutils: sandbox: add level based kill option
add kill option to seunshare to kill all processes that are still running
with the execcon MCS label.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-09-16 11:54:00 -04:00
Eric Paris
f37a6a71cb policycoreutils: sandbox: do not bind mount so much
pam_namespace and sandbox both do the bind mounts internally now.  No
reason to force this on everyone.  Hopefully the sandbox init script
will be disappearing with systemd doing this by default.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-09-16 11:54:00 -04:00
Eric Paris
31edb319af policycoreutils: sandbox: rewrite /tmp handling
seunshare now creates a runtime temporary directory owned by root and
with the sticky bit set properly.  Files from the user-specified directory
are copied to the runtime directory and the changes synced back (using rsync)
at the end of the seunshare run.

This is hoped to address CVE-2011-1011

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-09-16 11:53:46 -04:00
Eric Paris
4347a5c01d policycoreutils: sandbox: add sandbox cgroup support
Add cgroup support

Signed-off-by: Eric Paris <eparis@redhat.com>
2011-09-15 19:20:44 -04:00
Eric Paris
3e532cffac policycoreutils: sandbox: add -Wall and -Werror to makefile
Just like everything else we should be erroring out on warnings.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-09-15 19:20:43 -04:00
Dan Walsh
1d54976d73 policycoreutils: setfiles: do not wrap * output at 80 characters
Russell Coker pointed out most displays are no 80 chars so we should just
put out * and let the terminal wrap itself.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Acked-by: Eric Paris <eparis@redhat.com>
2011-09-15 19:20:43 -04:00
Dan Walsh
f23e078018 policycoreutils: setfiles: Fix potential crash using dereferenced ftsent
If fts_read() fails for any reason ftsent will be NULL.  Previously we
would have reported the error and then continued processing.  Now we
report the error and stop using the NULL pointer.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-09-15 19:20:43 -04:00
Eric Paris
a2db3f2df8 policycoreutils: setfiles: switch from stat to stat64
When we converted from nftw to fts we had to remove the automatic large
file support had to be removed.  Thus we switch from stat to stat64 on
all archs.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-09-15 19:20:42 -04:00
Eric Paris
f14912ee6e policycoreutils: audit2allow: sepolgen-ifgen use the attr helper
This patch adds support to actually use the new sepolgen-ifgen attr
helper.  We included the helper which generates attribute information
but this patch makes use of it.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-09-15 19:20:42 -04:00
Eric Paris
f4ecef50b2 policycoreutils: audit2allow: use alternate policy file
Add a --policy option to audit2allow to make it use an
alternate use specified policy instead of the running
policy.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-09-15 17:19:20 -04:00
Eric Paris
5a2173519c policycoreutils: sepolgen-ifgen: new attr-helper does something
This program is used by sepolgen-ifgen to get the access for all of the
attributes in the policy so that it can resolve the typeattribute statements
in the interfaces.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-09-15 17:19:20 -04:00
Eric Paris
1f8cf403be update changelog and versions for 2011-08-26 2011-08-26 15:11:58 -04:00
Dan Walsh
ddc5063c16 policycoreutils: setfiles: Fix process_glob to handle error situations properly
Rather than error when a glob does not match return success as this is
not a problem.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Eric Paris <eparis@redhat.com>
2011-08-26 14:31:57 -04:00
Dan Walsh
a0e2e16878 policycoreutils: sandbox: Allow seunshare to run as root
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2011-08-26 14:31:56 -04:00
Dan Walsh
37644bfa93 policycoreutils: sandbox: trap sigterm to make sure sandbox exits with the proper exit code
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-26 14:31:55 -04:00
Dan Walsh
83e6416bca policycoreutils: sandbox: pass DPI from the desktop
Fix sandbox to pass DPI from the desktop to the sandbox program.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-26 14:31:54 -04:00
Eric Paris
f6558d9cec policycoreutils: sandbox: seunshare: introduce helper spawn_command
Introduce a helper which will spawn children and wait for them to exit
so we don't have to keep writing that code over and over.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-26 14:31:50 -04:00
Eric Paris
bf22cff3ea policycoreutils: sandbox: seunshare: introduce new filesystem helpers
These are just simple new helpers which make it easy to check uid, gid,
if two stat results are the same and things like that.

Signed-off-by: Eric Paris <eparis@redhat.com>
2011-08-26 14:28:25 -04:00
Dan Walsh
149afc688a policycoreutils: sandbox: add -C option to not drop all capabilities
Some sandbox might want to be able to run a suid app.  Add the -C option
to allow capabilities to stay in the bounding set, and thus be allowed
inside the sandbox.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-26 14:28:23 -04:00
Eric Paris
d6c09608cd policycoreutils: sandbox: split seunshare caps dropping
Split drop_capabilities into drop_privs, which does the same thing, and
drop_caps, which only drops caps but doesn't affect the uid.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-26 14:28:22 -04:00
Eric Paris
64b7a309c5 policycoreutils: sandbox: use dbus-launch
Instead of directly calling, use dbus-launch.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-26 14:28:19 -04:00
Eric Paris
26ff83cf87 policycoreutils: sandbox: numerous simple updates to sandbox
Little things like better error messages, usage text, code duplication
and the like.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-26 14:28:18 -04:00
Eric Paris
da7ae7951c policycoreutils: sandbox: do not require selinux context
seunshare can be used on non-selinux systems.  It can also be used
without transition to a new context.  Thus we should not require that a
context be set.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-26 14:28:16 -04:00
Eric Paris
3c5abbc341 policycoreutils: sandbox: Makefile: new man pages
we have man pages which aren't being instelled with make install.  We
also do not include -Werror -Wall -Wextra in the build like we do with
other packages, so include those.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-26 14:28:14 -04:00
Eric Paris
baf4d59407 policycoreutils: sandbox: rename dir to srcdir
Just a simple variable rename to make it clear what it does.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-26 14:28:12 -04:00
Eric Paris
d725841239 policycoreutils: sandbox: allow users specify sandbox window size
This allows users to create sandbox windows of a specified size on the
command line.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-26 14:28:11 -04:00
Eric Paris
74bb5c01d6 policycoreutils: sandbox: check for paths up front
When launching a sandbox x environment we should check up front to make
sure that the seunshare and sandboxsh files exist and bail politely if
they do not exist.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-26 14:28:09 -04:00
Eric Paris
1701e786ea policycoreutils: sandbox: use defined values for paths rather than open coding
Rather than putting pathnames all throughout the file define them as
variables and reuse these variables where needed.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-26 14:28:07 -04:00
Eric Paris
406ae12e31 policycoreutils: sandbox: move seunshare globals to the top
Just coding style, globals go at the top of .c files, not randomly
throughout.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-26 14:28:05 -04:00
Eric Paris
89e3dd6c30 policycoreutils: sandbox: whitespace fix
couple of whitespace at the end of the line.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-26 14:28:03 -04:00
Dan Walsh
8fb9a4571d policycoreutils: semodule_package: Add semodule_unpackage executable
Much like semodule_package this utility will unpack!

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-26 14:28:02 -04:00
Eric Paris
242a98cd21 policycoreutils: setfiles: get rid of some stupid globals
We have some useless globals in setfiles that don't need to be.  Stop
it.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-26 14:28:00 -04:00
Eric Paris
5ffa296798 policycoreutils: setfiles: move exclude_non_seclabel_mounts to a generic location
move exclude_non_seclabel_mounts from setfiles.c to restore.c so it can
be used by other functions later.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-26 14:27:59 -04:00
Eric Paris
6b6b475dcf update changelog and VERSION for latest changes 2011-08-17 11:17:28 -04:00
Guido Trentalancia
3ed7221bf7 policycoreutils: run_init: clarification of the usage in the manual page
It's a very minor thing really, but I believe (on the basis of an
off-list question) that the manual page for policycoreutils/run_init can
be improved by the following short patch which aims to further clarify
the intended usage of such tool and mention that it caters for one
(somewhat hidden) compile-time option.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-15 11:25:24 -04:00
Dan Walsh
d761cc9849 policycoreutils: semanage: fix usage header around booleans
Fix header to not display all of the options and fix Booleans to only list
supported options

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-15 11:25:24 -04:00
Eric Paris
f97e508567 policycoreutils: semanage: remove useless empty lines
This patch just removes some blank lines that we don't need.  Makes it
all purdy.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-15 11:25:23 -04:00
Eric Paris
1654b964bc policycoreutils: semanage: update man page with new examples
semanage rocks, so make the man page rock!

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-15 11:25:23 -04:00
Eric Paris
e883871de2 policycoreutils: semanage: update usage text
Add -D and -l and -n in the usage text where they belong.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-15 11:25:23 -04:00
Eric Paris
d01c33c90e policycoreutils: semanage: introduce file context equivalencies
This adds a new -e options to semanage fcontext which allows one to
specify filesystem equivalancies.  An example would be if an admin were
to run out of space and to start putting home directories in /home1.
They can use the equivalencies to specify that /home1 is labeled exactly
like /home.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-15 11:25:23 -04:00
Eric Paris
f78aa2f81b policycoreutils: semanage: enable and disable modules
Add tools to store the state of modules and to enable and disable those
modules.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-15 11:25:23 -04:00
Eric Paris
e25ea71a5b policycoreutils: semanage: output all local modifications
Introduce a new -o option which will output all local modifications in a
method which can be 're-inputted' on another host.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-15 11:25:23 -04:00
Eric Paris
f3fbc5d6de policycoreutils: semanage: introduce extraction of local configuration
Add a new option -E which will extract the local configuration changes
made for the given record type.  This will be used by a further output
option to be able to dump local configuration in a form which can be
imported later.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-15 11:25:23 -04:00
Eric Paris
2c3e6f6115 policycoreutils: semanage: cleanup error on invalid operation
Before you would get:
$ semanage fcontext toys
/usr/sbin/semanage Invalid command fcontext toys

Now you get:
$ semanage fcontext toys
/usr/sbin/semanage: Invalid command: semanage fcontext toys

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-15 11:25:23 -04:00
Eric Paris
877447a9e7 policycoreutils: semanage: handle being called with no arguments
Return quickly instead of tring to parse arguments if there are
no arguments.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-15 11:25:23 -04:00
Eric Paris
a0d1dc8a01 policycoreutils: semanage: return sooner to save CPU time
Right now we do lots of needless string comparisons even though we know
we are finished doing work immediately after an operation.  So return
sooner.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-15 11:25:23 -04:00
Eric Paris
d2f0f42570 policycoreutils: semanage: surround getopt with try/except
One of the getopt parsers didn't have a try/except pair to show usage
when a user did it wrong.  Fix that.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-15 11:25:23 -04:00
Eric Paris
0c4d0788ab policycoreutils: semanage: use define/raise instead of lots of conditionals
Right now the validation code has lots of conditionals which check if we
are trying to add and delete or add and modify or something like that.
Instead make a single function which just sets if this operation is
trying to do an action and if it gets called twice will realize this is
invalid and will raise and exception.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-15 11:25:23 -04:00
Eric Paris
123559545f policycoreutils: semanage: some options are only valid for local changes
Some options like --locallist and --deleteall only effect local changes
not global things.  Split these validation options into their own bit of
code.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-15 11:25:23 -04:00
Eric Paris
cfddb3fa9a policycoreutils: semanage: introduce better deleteall support
The help text, man pages, and stuff didn't include everything about
deleteall rules.  Try to update them.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-15 11:25:23 -04:00
Eric Paris
643b9b703c policycoreutils: semanage: do not allow spaces in file context
The entire tool chain does not support file context with a space in the
regex.  If one of these gets into the file_context files, all sorts of stuff
goes nuts.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-15 11:25:22 -04:00
Eric Paris
4c96df7d77 policycoreutils: semanage: distinguish between builtin and local permissive types
This just distinguishes between permissive types that were definied in
policy and those that were set by the user using semanage.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-15 11:25:22 -04:00
Eric Paris
12e29ee1dd policycoreutils: semanage: centralized ip node handling
Right now we have very little in the way of IP address validation.  We
also do not properly support IPv6 netmasks.  This patch centralizes IP
address validation and fixes the netmask support.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-15 11:25:22 -04:00
Eric Paris
66564a67cf policycoreutils: setfiles: make the restore function exclude() non-static
Stuff wants to use it later.  Make it non-static.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-15 11:25:22 -04:00
Eric Paris
17c577ace7 policycoreutils: setfiles: use glob to handle ~ and . in filenames
Use the glob library to handle ~ and . in filenames passed from the
command line.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-15 11:25:22 -04:00
Dan Walsh
5bd734dd73 policycoreutils: fixfiles: do not hard code types
We had a number of places where fixfiles would search for or set hard
coded types.  If policy used something other than tmp_t var_t file_t or
unlabeled_t we would go wrong.  This patch does 2 things.  It uses the
kernel provided selinuxfs interfaces to determine the label on unlabeled
and unknown files and it uses the --reference option with chcon to set
new labels.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-15 11:25:22 -04:00
Eric Paris
35f4e6a870 policycoreutils: fixfiles: stop trying to be smart about filesystems
The type of a filesystem (ext*, btrfs, etc) really doesn't matter when
it comes to the ability to set labels.  Stop trying to be smart and just
call restorecon.  It will either work or it won't and out heuristic
isn't helping.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-15 11:25:22 -04:00
Eric Paris
1da72eea26 policycoreutils: fixfiles: use new kernel seclabel option
The kernel now outputs a mount option called 'seclabel' which indicates
if the filesystem supposed security labeling.  Use that instead of
having to update some hard coded list of acceptable filesystems (that
may or may not be acceptable depending on if they were compiled with
security xattrs)

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-15 11:25:20 -04:00
Eric Paris
e2769ff670 policycoreutils: fixfiles: pipe everything to cat before sending to LOGFILE
We do this so we can eliminate foolish avcs about restorecon trying to
write to a random directory.  We allow apps to communicate with fds
globably.  So this allows the access no AVC's I am happy

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-11 23:35:52 -04:00
Eric Paris
275560b2a3 policycoreutils: fixfiles: introduce /etc/selinux/fixfiles_exclude_dirs
Introduce a new file /etc/selinux/fixfiles_exclude_dirs which contains a
list of directories which should not be relabeled.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-11 23:35:52 -04:00
Eric Paris
5e096d9ceb policycoreutils: semodule: support for alternative root paths
Add a -p option to semodule which will allow it to operate on the
specified semanaged root instead of the default.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-11 23:35:52 -04:00
Eric Paris
4749940426 update repo for 2011-08-03 with version and changelog updates 2011-08-03 18:09:02 -04:00
Eric Paris
2ac99a505e policycoreutils: semanage: fix indention
Part of the if clause used tabs, part spaces.  Be consistent.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:38 -04:00
Eric Paris
e1ae7b43f1 policycoreutils: semodule_package: fix man page typo
Just drop an extra bit of cruft from the man page.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:38 -04:00
Eric Paris
c52ff76180 policycoreutils: semodule_expand: update man page with -a
Update the man page to include -a.  Passing -a causes semodule_expand to
not check assertions.  Include this in the man info.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:38 -04:00
Eric Paris
f2a74f4f87 policycoreutils: semanage: handle os errors
Rather than traceback, handle os errors and exit cleanly.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:38 -04:00
Eric Paris
b5c0a182ef policycoreutils: semanage: fix traceback with bad options
$ semanage fcontext add delete
Traceback (most recent call last):
  File "/usr/sbin/semanage", line 565, in <module>
    process_args(sys.argv[1:])
  File "/usr/sbin/semanage", line 396, in process_args
    raise ValueError(_("%s bad option") % o)
UnboundLocalError: local variable 'o' referenced before assignment

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:37 -04:00
Eric Paris
b1820fcca6 policycoreutils: semanage: show usage on -h or --help
Raise a more sensicle useage rather than value error on help request
from user.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:37 -04:00
Eric Paris
72a83a110d policycoreutils: semanage: introduce more deleteall options
Some semanage objects have a deleteall function, some don't.  This adds
them to login seluser node and interface.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:37 -04:00
Eric Paris
849e7d5be7 policycoreutils: semanage: verify ports < 65536
We could currently create a rule with a port number of one million.
This doesn't make sense.  Bounds test it.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:37 -04:00
Eric Paris
c3226ebac9 policycoreutils: transaction into semanageRecords
In order to allow semanage to perform a transaction on several seobjects
at the same time, the transaction lock has to be at the class level
versus being in each object.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:37 -04:00
Eric Paris
3fd3a927e2 policycoreutils: make get_handle a method of semanageRecords
Right now it is needlessly global.  Make it a method of semanageRecords.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:37 -04:00
Eric Paris
7e00948bdb policycoreutils: remove a needless blank line
Yeah, that's really it.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:37 -04:00
Eric Paris
5763e720d8 policycoreutils: make process_one error if not initialized correctly
Rather than blow up in horible ways, error out if we detect
initialization wasn't done properly.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:37 -04:00
Eric Paris
2b4d32dc4b policycoreutils: fixfiles: correct usage for r_opts.rootpath
The error usable displays r_opts.rootpath, but r_opts is supposed to be
an internal code thing, not something users care about.  When printing
the error message just call it 'rootpath'

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:37 -04:00
Eric Paris
89ca0c2e29 policycoreutils: put -p in help for restorecon and fixfiles
restorecon and fixfiles both have the -p option to display a * every
10000 files.  Put it in the usage and man pages.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:37 -04:00
Eric Paris
2d0c192355 policycoreutils: fixfiles: do not try to only label known filesystems
In the old fixfiles we had to make sure we only attempted to relabel
files that were on file systems that supported extended attributes.
With the new restorecon, we no longer need this.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:37 -04:00
Eric Paris
593154505a policycoreutils: fixfiles clean up /var/run and /var/lib/debug
clean up /var/run and /var/lib/debug just like we do for /tmp and
/var/tmp since they can easily get unlabeled files.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:37 -04:00
Eric Paris
2bd5fd1642 policycoreutils: fixfiles delete tmp sockets and pipes rather than relabel then
We cannot reasonably relabel pipes and sockets in /tmp to tmp_t so just
delete them instead of trying to put and unuable label.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:37 -04:00
Eric Paris
6084f72aaf policycoreutils: fixfile use find -delete instead of pipe to rm
fixfiles uses a find command then than pipes that to rm -f.  Just use
the find delete predicate instead of causing all of those extra calls to
rm.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:37 -04:00
Eric Paris
da484b88d5 policycoreutils: chcat man page typo
Fix the page to point to the the seusers file, not the seuser file.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:37 -04:00
Eric Paris
6a1c070ea6 policycoreutils: add man page for genhomedircon
Nothing special, just a man page to say what it's about.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:37 -04:00
Eric Paris
a57385c578 policycoreutils: setfiles fix typo
Apparently we cannot spelll.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:36 -04:00
Eric Paris
4c63498a4c policycoreutils: setsebool should inform users they need to be root
Add a different error message when setsebool is unable to run because
the user is not root.  This just helps people who try to change booleans
based on setroubleshoot output and don't know what went wrong.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:36 -04:00
Eric Paris
98dcd24976 policycoreutils: setsebool typos
Apparently we can't spelll.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:36 -04:00
Eric Paris
10374e5e89 policycoreutils: open_init_tty man page typos
Apparently we can't spelll.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:36 -04:00
Eric Paris
0b8af757b6 policycoreutils: Don't add user site directory to sys.path
SELinux pythons applications should not allow the user to change the
sys.path

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:36 -04:00
Eric Paris
e3ffa8c31f policycoreutils: newrole retain CAP_SETPCAP
We retain CAP_SETPCAP so that we can drop the additional capabilities
we held onto to set up namespaces.

While we are at it, just add some console whine in case things fail.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-03 18:02:36 -04:00
Eric Paris
78b4b56857 Made updates to checkpolicy libselinux and policycoreutils so update
version and changelogs

Signed-off-by: Eric Paris <eparis@redhat.com>
2011-08-02 14:10:39 -04:00
Eric Paris
39066bd0ac policycoreutils: seunshare: define _GNU_SOURCE earlier
If one tries to build policycoreutils it won't work because of:

seunshare.c: In function ‘main’:
seunshare.c:242:21: error: ‘CLONE_NEWNS’ undeclared (first use in this
function)
seunshare.c:242:21: note: each undeclared identifier is reported only
once for each function it appears in
make[1]: *** [seunshare.o] Error 1

Moving the #define _GNU_SOURCE earlier in the file means it is set when
sched.h is includes via some of dependancy chain.  Thus it can build.

Signed-off-by: Eric Paris <eparis@redhat.com>
2011-08-02 13:58:07 -04:00
Eric Paris
30ad11feb9 policycoreutils: make ignore_enoent do something
We have dumb code in setfiles which will set a static variable called
ignore_enoent.  Thing is, nothing uses it.  So move the setting to where
it is useful and use it!

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-02 13:34:05 -04:00
Chris Adams
1236eef264 restorecond: first user logged in is not noticed
The first user that logs in will not be caught by restorecond.  The utmp
checking function only returns that there was a change when the previous
list of users was non-NULL.

Here's a patch that works for me (this is against the latest Red Hat
Enterprise Linux 5 policycoreutils release, but I checked the current
source tree and the same problem is present):

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-02 13:32:23 -04:00
Eric Paris
bbad2cb655 Repo: update .gitignore
update .gitignore to include files that are normally created when
working and building inside the git repo

Sigend-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-02 13:31:51 -04:00
Eric Paris
510003b63f Minor version bump for updates as of 2011-08-01
checkpolicy
libselinux
libsemanage
libsepol
policycoreutils

Signed-off-by: Eric Paris <eparis@redhat.com>
2011-08-01 13:49:21 -04:00
Eric Paris
5aecaf1e68 semanage: update manpage to explain transactions capabilities
semanage -S targeted -i - << _EOF
login -a -s xguest_u xguest
boolean -m --on allow_polyinstantiation
boolean -m --on xguest_connect_network
boolean -m --on xguest_mount_media
boolean -m --on xguest_use_bluetooth
_EOF

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-01 13:40:20 -04:00
Martin Orr
c588b44219 restorecond: Ignore IN_IGNORED inotify events
With kernel 2.6.31, restorecond uses 99% of my CPU.

This is because removing and readding the watch on utmp triggers inotify to
return an IN_IGNORED event for the old watch descriptor.  If the watch gets
allocated the same wd when it is readded, then restorecond thinks that utmp
has changed, so removes and readds the watch again, potentially looping.

With kernel <= 2.6.30, this never happened, because the kernel didn't reuse
watch descriptors.  So the IN_IGNORED event comes with a wd that is no
longer in use, and gets ignored.  But kernel 2.6.31 reuses the same watch
descriptor.

This patch fixes that by ignoring inotify events whose only bit set is
IN_IGNORED.

Note: it is not clear to me why it is necessary to remove and readd the
watch in the first place.

Note for testing: you need to log in (to cause a change in utmp) after
starting restorecond to trigger the bug.  In fact you need to log in twice
before the kernel reuses a watch descriptor.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-01 13:40:20 -04:00
Daniel J Walsh
71b51fdbd6 Rearranged audit2allow.1 to match the newer ways we use the tool.
Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-01 13:40:20 -04:00
Steve Lawrence
44121f6624 Minor version bump for release
Bump checkpolicy to 2.1.0
Bump libselinux to 2.1.0
Bump libsepol to 2.1.0
Bump libsemanage to 2.1.0
Bump policycoreutils to 2.1.0
Bump sepolgen to 1.1.0
2011-07-27 15:32:54 -04:00
Steve Lawrence
c7512cf11c Revision version bump
Bump checkpolicy to 2.0.24
Bump libselinux to 2.0.102
Bump libsepol to 2.0.43
Bump policycoreutils to 2.0.86

Signed-off-by: Steve Lawrence <slawrence@tresys.com>
2011-04-12 08:29:53 -04:00
Richard Haines
fe17b3d2d9 mcstransd select correct colour range.
mcstransd: Now selects the range color for a matching 'range' entry in secolor.conf file, and not the first range to pass the dominance check.

The second patch has the man pages to support the colour functions that match how mcstransd manages colour selection.

Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
Signed-off-by: Steve Lawrence <slawrence@tresys.com>
2011-04-11 10:27:13 -04:00
Steve Lawrence
b676c84dbd bump policycoreutils to 2.0.85
Signed-off-by: Steve Lawrence <slawrence@tresys.com>
2010-12-20 15:13:33 -05:00
Steve Lawrence
cba027c249 Exit newrole if capabilities can't be dropped
Signed-off-by: Steve Lawrence <slawrence@tresys.com>
2010-12-20 15:13:33 -05:00
Daniel J Walsh
16d1c1cbe5 Move newrole to use libcap-ng
Signed-off-by: Steve Lawrence <slawrence@tresys.com>
2010-12-20 15:13:28 -05:00
Steve Lawrence
7bb6003219 bump policycoreutils to 2.0.84
Signed-off-by: Steve Lawrence <slawrence@tresys.com>
2010-11-16 11:23:01 -05:00
Steve Lawrence
7e0f012474 Cleanup/minor fixes to mcstrans
The majority of the patch is just handling the case of memory
allocation failures and making sure things get cleaned up correctly in
those cases.

This also moves duplicate code in parse_ebitmap() and parse_raw() into
parse_category(), and also updates the parse function to ensure the
config files are in the correct format.

Signed-off-by: Steve Lawrence <slawrence@tresys.com>
2010-10-27 16:50:00 -04:00
Xavier Toth
c89625db93 Add mcstrans to policycoreutils
SELinux Project contribution of mcstrans. mcstrans is a userland package
specific to SELinux which allows system administrators to define
sensitivity levels and categories and provides a daemon for their
translation into human readable form. This version is a merge of Joe
Nalls git tree ( http://github.com/joenall/mcstrans) and patches
supplied by Dan Walsh and others at RedHat.

Ted

Signed-off-by: Steve Lawrence <slawrence@tresys.com>
2010-07-21 15:40:00 -04:00
Chad Sellers
02fd1f3308 bump policycoreutils to 2.0.83 2010-06-10 16:58:04 -04:00
Steve Lawrence
582fd00c7b Author: Steve Lawrence
Email: slawrence@tresys.com
Subject: Updated sandbox patch.
Date: Mon, 07 Jun 2010 17:53:41 -0400

On Thu, 2010-05-27 at 08:57 -0400, Daniel J Walsh wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 05/26/2010 04:06 PM, Steve Lawrence wrote:
> > On Wed, 2010-05-19 at 15:59 -0400, Daniel J Walsh wrote:
> > Fixed patch that handles Spaces in homedir.
>
> > The following patch makes a few updates the the sandbox patch, though I
> > have a question:
>
> > Is the sandbox.init script needed anymore? It looks like seunshare was
> > changed to now bind mount and make private the necessary directories.
> > The only thing that seems missing is making root rshared. Also, if the
> > init script is obsolete, do the mounts also need the MS_REC flag for
> > recursive bind/private like they are mounted in the init script? e.g.
>
> The init script is needed for the xguest package/more specifically
> pam_namespace, but also needed for
> mount --make-rshared /
>
> Whether the init script belongs in policycoreutils is questionable though.
>
>
> > mount(dst, dst, NULL, (MS_BIND | MS_REC), NULL)
> > mount(dst, dst, NULL, (MS_PRIVATE | MS_REC), NULL)
>
> We probably should add these.  Although it is not likely.
>
> > Changes the following patch makes:
>
> > sandbox.py
> > - Removes unused 'import commands'
> > - Fixes the chcon function, and replaces the deprecated os.path.walk
> >   with os.walk. I think this way is a bit easier to read too.
>
> I think chcon should be added to libselinux python bindings and then
> leave the recursive flag.  (restorecon is currently in python bindings._
>
> > - Removes the 'yum install seunshare' message. This tool is not specific
> >   to RPM based distros.
>
> People are using seunshare without X now that I have added the -M flag.
>  So I will move it from the -gui package to the base package with
> sandbox and then this should not be necessary.
> > - Remove try/except around -I include to be consistent with the -i
> >   option. If we can't include a file, then this should bail, no matter
> >   if it's being included via -i or -I.
>
> Ok, I was thinking you could list a whole bunch of files in the -I case
> and if one does not exist, allow it to continue.  But I don't really care.
> > - Fix homedir/tmpdir typo in chcon call
>
> > sandbox.init (maybe obsoleted?)
> > - Fix restart so it stops and starts
> > - unmount the bind mounts when stopped
> I doubt this will work.  Two many locks in /tmp /home
> > - Abort with failure if any mounts fail
>
> > seunshare.c
> > - Define the mount flag MS_PRIVATE if it isn't already. The flag is only
> >   defined in the latest glibc but has been in the kernel since 2005.
> > - Simplify an if-statment. Also, I'm not sure the purpose of the
> >   strncmmp in that conditional, so maybe I've oversimplified.
> This is wrong.  The problem comes about when you mount within the same
> directory.
>
> seunshare -t /home/dwalsh/sanbox/tmp -h /home/dwalsh/sandbox/home   ...
>
> seunshare -t /tmp/sandbox/tmp -h /tmp/sandbox/home
>
> If you do not have the check one of the above will fail.
>
> In the first example if Homedir is mounted first,
> /home/dwalsh/sanbox/tmp will no longer exist when seunshare attempts to
> mount it on /tmp.
>
> Similarly, if /tmp is mounted first in the second example.
> /tmp/sandbox/home will no longer exist.
>
> You have to check to make sure one of the directories is not included in
> the other.
>
> It seems
> >   like maybe an error should be thrown if tmpdir_s == pw_dir or
> >   homedir_s == "/tmp", but maybe I'm missing something.
>
> See above.
>
> I was blowing up because I use
>
> ~/sandbox/tmp and ~/sandbox/home for my mountpoints.

<snip>

Below is an updated patch that makes a few changes the the latest
Sandbox Patch [1]. This requires the chcon patch [2].

Changes this patch makes:

sandbox.py
- Remove unused 'import commands'
- Uses new chcon method in libselinux [2]
- Removes the 'yum install seunshare' message
- Converts an IOError to a string for printing a warning if a file
  listed in -I does not exist

sandbox.init
- Print the standard Starting/Stoping messages with the appropriate
  OK/FAIL
- Abort with failure if any mounts fail

seunshare.c
- Add the MS_REC flag during mounts to perform recursive mounts
- Define the mount flags MS_PRIVATE and MS_REC if they aren't already.
  The flags are only defined in the latest glibc but have been in the
  kernel since 2005.
- Calls realpath(3) on tmpdir_s and homedir_s. If relative paths are
  used, it wouldn't correctly detect that tmpdir is inside homedir and
  change the mount order. This fixes that.

[1] http://marc.info/?l=selinux&m=127429948731841&w=2
[2] http://marc.info/?l=selinux&m=127594712200878&w=2

Signed-off-by: Chad Sellers <csellers@tresys.com>
2010-06-10 16:37:59 -04:00
Daniel J Walsh
d6848ea77d Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: Updated sandbox patch.
Date: Wed, 19 May 2010 15:59:28 -0400

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Fixed patch that handles Spaces in homedir.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkv0QyAACgkQrlYvE4MpobNBXQCgmUu92HsN5PiksOTZoGxSp0W+
1noAoKoCujFPLHduJ9BP3hrveeXvGKXO
=iqC+
-----END PGP SIGNATURE-----

Signed-off-by: Chad Sellers <csellers@tresys.com>
2010-06-10 16:35:55 -04:00
Joshua Brindle
edf1df5429 bump sepolgen to 2.0.82 2010-03-24 15:40:05 -04:00
Daniel J Walsh
03cd8c2d47 This patch allows audit2allow to look at all avc's since the last time the machine booted.
Acked-by: Karl MacMillan <kmacmillan@tresys.com>
2010-03-18 16:36:22 -04:00
Joshua Brindle
b5b2c2c2fe bump policycoreutils to 2.0.81 and sepolgen to 1.0.20 2010-03-12 08:32:38 -05:00
Daniel J Walsh
f509e1e8b9 Audit2allow generating dontaudit rules.
On 03/08/2010 11:11 AM, Karl MacMillan wrote:
> Accidentally sent this straight to Josh.
>
> Karl
>
> On Thu, Mar 4, 2010 at 4:46 PM, Karl MacMillan<karlwmacmillan@gmail.com>  wrote:
>
>> I meant this - I don't want to pass around a boolean flag when we have
>> a flag for rule type. This allows cleanly adding support for, say,
>> generating both allow rules and auditallow rules at the same time.
>>
>>
<snip>

Ok this one only adds a flag to the policygenerator to tell it to
generate dontaudit rules.

No passing of args.

Acked-by: Karl MacMillan <karlwmacmillan@gmail.com>
2010-03-12 08:30:04 -05:00
Joshua Brindle
a73f32c3e3 bump policycoreutils to 2.0.80 2010-03-07 10:04:24 -05:00
Daniel J Walsh
654dcb897e Last attempt at upstreaming semodule_disable patch.
This patch allows you to disable/Enable policy modules.

It never seems to get upstreamed.  :^(

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2010-03-06 17:56:24 -05:00
Chad Sellers
aafcaeb751 bump policycoreutils to 2.0.79 2010-01-26 16:56:04 -05:00
Chad Sellers
3084b9a1f9 Fix double free in newrole when it fails to exec.
Signed-off-by: Chad Sellers <csellers@tresys.com>
2009-12-30 16:59:48 -05:00
Joshua Brindle
7b9904bef3 bump libsemanage to 2.0.43 and policycoreutils to 2.0.78 2009-11-27 13:02:43 -05:00
Daniel J Walsh
70849975f8 This patch removes OUTPUT from fixfiles which was never used and was broken
Patches come from

Moray.Henderson@ict.om.org

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2009-11-27 12:44:16 -05:00
Daniel J Walsh
0e84ca614a Small fixes for chcat in policycoreutils
chcat can generate oserror exception so need to catch and add chcat to the Makefile.

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2009-11-27 12:14:40 -05:00
Chad Sellers
3d2f8e21d2 Bump policycoreutils to 2.0.77
Signed-off-by: Chad Sellers <csellers@tresys.com>
2009-11-19 17:16:03 -05:00
Chad Sellers
ae50dd55e0 Fix bug in semanage fcontext
Apparently I failed to split out the whitespace changes from a
previous patchset, and a bit of the equivalence patch of the
day snuck in. This causes a stack trace when you execute
semanage fcontext -l. This patch reverts the accidentally
included code.

Signed-off-by: Chad Sellers <csellers@tresys.com>
2009-11-19 15:01:13 -05:00
Chad Sellers
32ae03e8a7 semanage node -a bug
This patch fixes a bug that causes semanage node -a to not work
(failing with a python traceback). You can test the bug with any
semanage node -a command, such as:

semanage node -a -t node_t -p ipv4 -M 255.255.255.0 192.168.1.0

Signed-off-by: Chad Sellers <csellers@tresys.com>
2009-11-19 14:32:42 -05:00
Chad Sellers
88a57ca14b Bump policycoreutils to 2.0.76
Bump libsepol to 2.0.41
Bump libsemanage to 2.0.42
2009-11-18 16:44:55 -05:00
Daniel J Walsh
eb014c79f1 Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: Add modules support to semanage
Date: Thu, 12 Nov 2009 11:23:15 -0500

On 11/11/2009 01:52 PM, Chad Sellers wrote:
> On 9/30/09 2:33 PM, "Daniel J Walsh" <dwalsh@redhat.com> wrote:
>
>> Includes enable and disable.
>>
> I presume I should hold off on this patch until you have a chance to
> resubmit the libsemanage support that it relies on. Let me know if that's
> not the case.
>
> Thanks,
> Chad
>
Lets do this patch.

Moves load_policy from /usr/sbin to /sbin

Removed cruft.

Signed-off-by: Chad Sellers <csellers@tresys.com>
2009-11-18 15:33:00 -05:00
Daniel J Walsh
b946922238 Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: Remove setrans management from semanage
Date: Wed, 30 Sep 2009 14:07:49 -0400

This will not work correctly using the current mcstrans code base.  I believe an admin has to edit this code directly and probably should have never been added to semanage.

Signed-off-by: Chad Sellers <csellers@tresys.com>
2009-11-10 17:35:20 -05:00
Chad Sellers
08de9ab134 Bump policycoreutils to 2.0.75 2009-11-02 17:07:54 -05:00
Thomas Liu
2a1933d830 Author: Thomas Liu
Email: tliu@redhat.com
Subject: policycoreutils: share setfiles restore function with restorecond
Date: Wed, 19 Aug 2009 15:51:44 -0400

This is the first of two patches.

This patch splits all of the restore functionality in setfiles
into another two files, restore.c and restore.h.

The reason for this is shown in the next patch, which patches
restorecond to share this code.

To use it, instantiate a restore_opts struct with the proper options
and then pass a pointer to it into restore_init, and call restore_destroy
later.

Signed-off-by: Thomas Liu <tliu@redhat.com>
Signed-off-by: Dan Walsh <dwalsh@redhat.com>

I've rebased this so that it will apply to current trunk.

Signed-off-by: Chad Sellers <csellers@tresys.com>
2009-11-02 17:02:25 -05:00
Eamon Walsh
0857e3e478 Add subdirectory .gitignore files.
These take care of executables and generated source files.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-10-20 21:25:55 -04:00
Joshua Brindle
6e7e247f6c bump libsemanage to 2.0.38 and policycoreutils to 2.0.74 2009-09-16 16:59:13 -04:00
Caleb Case
71178d5669 setfiles fails to relabel if selinux not enabled
Setfiles now checks the capabilities on the mounted file systems for
'seclabel' (see setfiles/setfiles.c:723:exclude_non_seclabel_mounts) on
newer kernels (>=2.6.30 see setfiles.c:734). However the 'seclabel'
feature is not available if selinux is not enabled. The result is that
setfiles silently fails to relabel any filesystems.

The patch below removes the check for seclabel if selinux is disabled.

As an alternative maybe seclabel should be available even if selinux is
disabled? It seems that whether a fs supports security labels is
independent of selinux being enabled.

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2009-09-16 11:18:18 -04:00
Manoj Srivastava
96f592422a Author: Manoj Srivastava
Email: srivasta@golden-gryphon.com
Subject: policycoreutils: The error message on forkpty() failure is not clear or useful.
Date: Sun, 23 Aug 2009 09:40:58 -0500

Hi,

        This has been reported against the Debian BTS.

        The current error message when forkpty() fails is not clear or
 useful. (Arguably, the erro message in the child branch cold also be
 improved)  The following patch makes indicate what went wrong.  Probably
 something better than this could be devised, but this is still a lot
 better than the current code.

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2009-09-16 11:16:19 -04:00
Daniel J Walsh
c282c4024d I think I sent this patch before, it is the upgrade patch.
Basically it makes semodule -u file.pp, install file.pp if it does not exist.  This matches the rpm syntax, and allows us too update/install many packages with a transaction without know whether the package is updated or installed.

Currently we can only do a -i which could hammer a newwer version.

commit 3a5ed0fdf42200d0efd6cb1064eab91d2eb5ca52
Author: Dan Walsh <dwalsh@redhat.com>
Date:   Mon Aug 24 11:36:41 2009 -0400

    i Upgrade patch
2009-09-16 10:50:10 -04:00
Joshua Brindle
eaaafe2151 bump policycoreutils to 2.0.73 and libsemanage to 2.0.37 2009-09-04 13:26:37 -04:00
Daniel J Walsh
5aa2efb8f9 Author: Daniel J Walsh Email: dwalsh@redhat.com Subject: Patch to semanage Date: Thu, 27 Aug 2009 17:39:27 -0400
Redone to match man page and remove reload_policy.

Chad Sellers: This patch adds the dontaudit directive to semanage to enable/disable dontaudit rules in policy.

Signed-off-by: Chad Sellers <csellers@tresys.com>
2009-09-04 13:20:32 -04:00
Daniel J Walsh
1f60e9b7a3 Author: Daniel J Walsh Email: dwalsh@redhat.com Subject: Patch to semanage Date: Fri, 17 Jul 2009 06:10:37 -0400
Patch to semanage

Chad Sellers: I pulled this patch out of the larger patch. This patch fixes 2 small bugs in seobject.py. The first left the setrans file with the wrong permissions. The second returned a malformed dictionary from portRecords get_all method.

Signed-off-by: Chad Sellers <csellers@tresys.com>
2009-09-04 13:19:31 -04:00
Daniel J Walsh
8ad29a2725 Author: Daniel J Walsh Email: dwalsh@redhat.com Subject: Patch to semanage Date: Fri, 17 Jul 2009 06:10:37 -0400
Some white space fixing in seobject.py

Chad Sellers: I pulled the whitespace patch out of the larger patch as a separate commit to make the patch more manageable.

Signed-off-by: Chad Sellers <csellers@tresys.com>
2009-09-04 13:18:44 -04:00
Stephen Smalley
b07d7f45a6 policycoreutils 2.0.72 2009-09-03 11:00:42 -04:00
Stephen Smalley
cc45b9a237 restorecon and symbolic links
Based on a patch by Martin Orr.

Restore the code to compute the realpath of all but the last component
of a symlink, and relabel both the symlink and (if it exists) the target
of the symlink when a symlink is specified to restorecon.

Thus, restorecon -R /etc/init.d will restore both the /etc/init.d symlink
context and the directory tree starting from /etc/rc.d/init.d.

This fixes the restorecon /dev/stdin performed by the Debian udev init
script that was broken by policycoreutils 2.0.70.

[sds: switched use of _realpath suffix for process_one, and dropped warning
on non-existent target]

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2009-09-03 10:02:56 -04:00
Stephen Smalley
33c961d35e policycoreutils 2.0.71 2009-08-11 10:24:16 -04:00
Stephen Smalley
b0c1077c34 Patch setfiles to only warn if add_remove fails to lstat on user initiated excludes.
On Tue, 2009-08-11 at 08:12 -0400, Daniel J Walsh wrote:
> On 08/10/2009 04:12 PM, Stephen Smalley wrote:
> > On Mon, 2009-08-10 at 16:03 -0400, Stephen Smalley wrote:
> >> On Mon, 2009-08-10 at 11:13 -0400, Daniel J Walsh wrote:
> >>> Currently in F12 if you have file systems that root can not read
> >>>
> >>> # restorecon -R -v /var/lib/libvirt/
> >>> Can't stat directory "/home/dwalsh/.gvfs", Permission denied.
> >>> Can't stat directory "/home/dwalsh/redhat", Permission denied.
> >>>
> >>> After patch
> >>>
> >>> # ./restorecon -R -v /var/lib/libvirt/
> >>
> >> But if you were to run
> >> ./restorecon -R /home/dwalsh
> >> that would try to descend into .gvfs and redhat, right?
> >>
> >> I think you want instead to ignore the lstat error if the error was
> >> permission denied and add the entry to the exclude list so that
> >> restorecon will not try to descend into it.  It is ok to exclude a
> >> directory to which you lack permission.  Try this:
> >
> > Also, why limit -e to only directories?  Why not let the user exclude
> > individual files if they choose to do so?  In which case we could drop
> > the mode test altogether, and possibly drop the lstat() call altogether?
> > Or if you truly want to warn the user about non-existent paths, then
> > take the lstat() and warning to the 'e' option processing in main()
> > instead of doing it inside of add_exclude().
> >
> I agree lets remove the directory check and warn on non existing files.

Does this handle it correctly for you?

Remove the directory check for the -e option and only apply the
existence test to user-specified entries.  Also ignore permission denied
errors as it is ok to exclude a directory or file to which the caller
lacks permission.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2009-08-11 10:19:46 -04:00
Stephen Smalley
4445704ed1 policycoreutils 2.0.70 2009-08-04 15:59:52 -04:00
Stephen Smalley
37c5c30998 setfiles: only call realpath() on user-supplied pathnames
Change setfiles/restorecon to only call realpath() on the user-supplied
pathnames prior to invoking fts_open().  This ensures that commands such
as restorecon -R /etc/init.d and (cd /etc && restorecon shadow gshadow)
will work as expected while avoiding the overhead of calling realpath()
on each file during a file tree walk.

Since we are now only acting on user-supplied pathnames, drop the
special case handling of symlinks (when a user invokes restorecon
-R /etc/init.d he truly wants it to descend /etc/rc.d/init.d).  We can
also defer allocation of the pathname buffer to libc by passing NULL
(freeing on the out path) and we can drop the redundant exclude() check
as it will now get handled on the normal path.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2009-08-04 15:58:38 -04:00
Joshua Brindle
1e5fdf6140 bump policycoreutils to 2.0.69 2009-07-30 22:14:16 -04:00
Daniel J Walsh
73a1f3a8f3 Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: Fixfiles has a bug when looking at btrfs file systems.
Date: Thu, 09 Jul 2009 16:06:58 -0400

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2009-07-30 21:52:30 -04:00
Stephen Smalley
6be2be0a07 policycoreutils: get setfiles to skip mounts without seclabel
On Fri, 2009-07-24 at 16:12 -0400, Stephen Smalley wrote:
> On Fri, 2009-07-17 at 10:48 -0400, Thomas Liu wrote:
> > Get setfiles to check paths for seclabel and skip them
> > if it is not supported.
> >
> > Parse /proc/mounts and add paths that do not have seclabel
> > to the exclude list.  If another path shows up that does
> > have seclabel, remove it from the exclude list, since setfiles
> > will try and when it fails it will skip it.
> >
> > Also made one of the error messages in add_exclude more
> > descriptive.
> >
> > Signed-off-by: Thomas Liu <tliu@redhat.com>
> > Signed-off-by: Dan Walsh <dwalsh@redhat.com>
> > ---
>
> Thanks, merged in policycoreutils 2.0.68.

Applied this patch on top to free the buffer allocated by getline() and
to free any removed entries from the excludeArray.  valgrind
--leak-check=full then shows no leakage.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2009-07-27 09:22:15 -04:00
Stephen Smalley
709a754bfc policycoreutils 2.0.68 2009-07-24 16:10:18 -04:00
Thomas Liu
a6a29764a6 policycoreutils: get setfiles to skip mounts without seclabel
Get setfiles to check paths for seclabel and skip them
if it is not supported.

Parse /proc/mounts and add paths that do not have seclabel
to the exclude list.  If another path shows up that does
have seclabel, remove it from the exclude list, since setfiles
will try and when it fails it will skip it.

Also made one of the error messages in add_exclude more
descriptive.

Signed-off-by: Thomas Liu <tliu@redhat.com>
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2009-07-24 16:08:44 -04:00
Stephen Smalley
fbaf056b69 policycoreutils 2.0.67 2009-07-07 14:28:35 -04:00
Christopher Pardy
2c91f6377d semodule: maintain old functionality
Patch for semodule command
semodule -B
Will now turn on dontaudit rules
semodule -DB
Will turn off dontaudit rules.
With other patch all other semanage commands will maintain state.

Created by Dan Walsh

Signed-off-by: Christopher Pardy <cpardy@redhat.com>
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2009-07-07 14:21:29 -04:00
Stephen Smalley
b320c69d2e policycoreutils 2.0.66 2009-07-07 08:25:23 -04:00
Thomas Liu
cce1729067 setfiles converted to fts
This is version 5 of the setfiles to fts patch.

The code has been cleaned up to adhere to the CodingStyle guidelines.

I have confirmed that the stat struct that fts returns for a symlink when using
the FTS_PHYSICAL flag is in fact the stat struct for the symlink, not the file
it points to (st_size is 8 bytes).

Instead of using fts_path for getfilecon/setfilecon it now uses fts_accpath,
which should be more efficient since fts walks the file hierarchy for us.

FreeBSD setfsmac uses fts in a similar way to how this patch does and one
thing that I took from it was to pass the FTSENT pointer around instead of
the names, because although fts_accpath is more efficient for get/setfilecon,
it is less helpful in verbose output (fts_path will give the entire path).

Here is the output from running restorecon on /

(nftw version)
restorecon -Rv / 2>/dev/null
restorecon reset /dev/pts/ptmx context system_u:object_r:devpts_t:s0->system_u:object_r:ptmx_t:s0

(new version)
./restorecon -Rv / 2>/dev/null
./restorecon reset /dev/pts/ptmx context system_u:object_r:devpts_t:s0->system_u:object_r:ptmx_t:s0

Here are some benchmarks each was run twice from a fresh
boot in single user mode (shown are the second runs).

(nftw version)
restorecon -Rv /usr
real	1m56.392s
user	1m49.559s
sys	0m6.012s

(new version)
./restorecon -Rv /usr
real	1m55.102s
user	1m50.427s
sys	0m4.656s

So not much of a change, though some work has been pushed from kernel space
to user space.

It turns out setting the FTS_XDEV flag tells fts not to descend into
directories with different device numbers, but fts will still give back the
actual directory.  I think nftw would completely avoid the directories as well
as their contents.

This patch fixed this issue by saving the device number of the directory
that was passed to setfiles and then skipping all action on any directories
with a different device number when the FTS_XDEV flag is set.

Also removed some code that removed beginning and trailing slashes
from paths, since fts seems to handle it.

Signed-off-by: Thomas Liu <tliu@redhat.com>

[sds:  Moved local variable declarations to beginning of process_one.]
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2009-07-07 08:21:34 -04:00
Joshua Brindle
bf7a7c998f bump policycoreutils to 2.0.65 2009-06-24 10:55:46 -04:00
Joshua Brindle
347aacc37c remove gui from po/Makefile and po/POTFILES and regenerate po files 2009-06-24 10:54:56 -04:00
Joshua Brindle
33844aa60d bump libselinux to 2.0.82 and policycoreutils to 2.0.64 2009-06-22 11:32:27 -04:00
Daniel J Walsh
5467587bcc Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: chcat fixes
Date: Thu, 21 May 2009 08:13:26 -0400

On 05/20/2009 04:05 PM, Chad Sellers wrote:
> On 5/20/09 3:00 PM, "Daniel J Walsh"<dwalsh@redhat.com>  wrote:
>
>> Expansion of categores is still broken.  Here is a patch to fix.
>>
> This message appears to be missing a patch.
>
> Thanks,
> Chad
>

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2009-06-22 11:26:00 -04:00
Daniel J Walsh
275d7f658e Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: setfiles will only put out a "*" if > 1000 files are fixed.
Date: Wed, 20 May 2009 13:08:14 -0400

setfiles was always putting out a \n, even when not many files were
being fixed. yum transactions were being desturbed by this.

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2009-06-19 13:16:24 -04:00
Daniel J Walsh
323a16ff37 Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: Add btrfs to fixfiles.
Date: Wed, 20 May 2009 15:02:33 -0400

Hopefully the last time we will ever need to update.  Once patch gets
out with kernel support to tell me which file systems support xattr, we
can remove this hack.

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2009-06-19 11:12:57 -04:00
Joshua Brindle
7fc77104fa bump policycoreutils to 2.0.63 2009-05-05 20:16:31 -04:00
Daniel J Walsh
b6a1a954f5 Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: patch to policycoreutils
Date: Wed, 01 Apr 2009 10:10:43 -0400

Multiple patches to policycoreutils.

First added /root/.ssh and /root/.ssh/*  to allow people to place keys
in /root directory and have them labeled by restorcond

<snipdue to previously ack'd patch>

Clean up permissive domains creation in semanage so it does not leave
crap in /var/lib/selinux

---
Also have fixfiles operate recursively when in RPM mode, per:

Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: Re: patch to policycoreutils
Date: Wed, 22 Apr 2009 21:50:48 -0400

If a package owned a directory like /var/lib/libvirt/images, when it is
relabeling we would want it to relabel not only the directory but the
contents of the directory

Signed-off-by: Chad Sellers <csellers@tresys.com>
2009-04-10 19:17:47 -04:00
Daniel J Walsh
35490f2fa5 Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: Help with python seobject.loginRecords
Date: Thu, 12 Mar 2009 09:29:17 -0400

On 03/11/2009 05:00 PM, Stephen Smalley wrote:
> On Wed, 2009-03-11 at 16:49 -0400, Daniel J Walsh wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Joe Nall wrote:
>>> On Mar 11, 2009, at 2:35 PM, Daniel J Walsh wrote:
>>>
>>>> On 03/11/2009 12:15 PM, Joe Nall wrote:
>>>>> I need to add login mappings in python firstboot modules during system
>>>>> configuration. In my first module a simple:
>>>>>
>>>>> seobject.loginRecords().add(username, "siterep_u",
>>>>> "SystemLow-SystemHigh")
>>>>>
>>>>> works. In subsequent modules, I get an exception:
>>>>>
>>>>> libsemanage.enter_rw: this operation requires a transaction
>>>>> libsemanage.enter_rw: could not enter read-write section
>>>>> Traceback (most recent call last):
>>>>> File "./t", line 6, in<module>
>>>>> seobject.loginRecords().add("test3", "sysadm_u", "SystemLow-SystemHigh")
>>>>> File "/usr/lib64/python2.5/site-packages/seobject.py", line 442, in add
>>>>> raise error
>>>>> ValueError: Could not add login mapping for test3
>>>>>
>>>>> What is the right way to do this?
>>>>>
>>>>> joe
>>>>>
>>>>>
>>>>> --
>>>>> This message was distributed to subscribers of the selinux mailing list.
>>>>> If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov
>>>>> with
>>>>> the words "unsubscribe selinux" without quotes as the message.
>>>> Probably an MLS issue.  firtstboot is running in a context that is not
>>>> allowed to lock/manage selinux.
>>> I'm installing in permissive and switching to enforcing after firstboot.
>>> You are correct that firstboot_t doesn't have the policy for all the
>>> stuff I'm trying to do yet.
>>>
>>>> You probably should exec semanage rather then calling seobject so you
>>>> could do a transition and not have to give a huge app like first boot
>>>> the ability to manage security policy.
>>> That is what is installing right now. I would still like an
>>> explanation/code snippet of correct usage for future use
>>>
>>> joe
>>>
>>>
>> This works on F10 Targeted policy
>>
>> # python -c "import seobject; seobject.loginRecords().add("pwalsh",
>> "staff_u", "s0")
>> # python -c 'import seobject; seobject.loginRecords().delete("pwalsh")'
>>
>> Could it be a translation problem?
>
> Try running multiple calls within the same python interpreter.
> I think seobject.py isn't using libsemanage correctly.  For example, in
> add(), you do:
>                         self.begin()
>                          self.__add(name, sename, serange)
>                          self.commit()
> but begin() only ever invokes semanage_begin_transaction() the very
> first time:
>         def begin(self):
>                 if self.transaction:
>                        return
>                 rc = semanage_begin_transaction(self.sh)
>
> So after the first commit(), you'll start failing.
>
I think this patch fixes the transaction patch in semanage.

Signed-off-by: Chad Sellers <csellers@tresys.com>
2009-04-10 17:14:47 -04:00
Joshua Brindle
c7e13bfea3 bump policycoreutils to 2.0.62 2009-02-17 12:18:05 -05:00
Joshua Brindle
f77e475fd8 Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: Add btrfs to fixfiles
Date: Tue, 17 Feb 2009 11:42:11 -0500

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hopefully will convert to seclabel when it is available.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkma6OMACgkQrlYvE4MpobNegwCfSBpm7O9wIKK+O89gC+Lwx+PV
rmsAn12IADGzhFu4thYK5qakacviWwfZ
=PtIL
-----END PGP SIGNATURE-----

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2009-02-17 11:43:11 -05:00
Joshua Brindle
be583ce332 Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: Several fixes to restorecond
Date: Tue, 17 Feb 2009 11:40:54 -0500

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Init script should be 755

libflashplayer.so has moved in the homedir and is now correct so no
longer needs to have labeling checked.

restorecond supports glob matching and should not complain on multiple
hard links if they match a glob.

So if a file has > 1 link and is an exact match complain, otherwise do not.

Also fix a couple of error messages.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkma6JYACgkQrlYvE4MpobOoIACfUgUfpCuhvVTWyHgsq7/8hY0z
9WcAmgPK2KktAlY84HhtRmdu/Hy+9eE/
=zcCj
-----END PGP SIGNATURE-----

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2009-02-17 11:42:15 -05:00
Joshua Brindle
f5a700d107 Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: policycoreutils_restorecond.patch
Date: Tue, 13 Jan 2009 08:53:50 -0500

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Add more error checking.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAklsnO4ACgkQrlYvE4MpobOqdgCgvkzLK6bi1m9oTv217A7CYIvZ
BRcAn005E3lop2wmkaH5DcfVwVv3kCYD
=Xjf4
-----END PGP SIGNATURE-----

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2009-02-16 11:48:37 -05:00
Joshua Brindle
244fd583d8 Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: policycoreutils_semanage.patch
Date: Tue, 13 Jan 2009 08:55:56 -0500

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Add missing locallist option
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAklsnWwACgkQrlYvE4MpobPZJwCguhEXCkkeS+4QPeBIDMD/sMTv
yMoAoLz7d20UABT1La/JcUaMrXr/XLF7
=L7QI
-----END PGP SIGNATURE-----

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2009-02-16 11:46:40 -05:00
Joshua Brindle
d8b1ea603b Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: Make removing of a module a warning rather then an error.
Date: Tue, 13 Jan 2009 08:57:17 -0500

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This way if I say a command line

semodule -r mypol -i newmypol

and mypol was not there the semodule command does not error out.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAklsnb0ACgkQrlYvE4MpobNwFACfTqc17wREKC2aAhLOIkfbqgeg
GxgAn2/ZBz5ljtyK1aiVkqoCBj98y9Ey
=I4uX
-----END PGP SIGNATURE-----

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2009-02-16 11:41:02 -05:00
Joshua Brindle
498861044a Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: audit2allow patch
Date: Tue, 13 Jan 2009 08:52:51 -0500

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Remove --tefile from manpage, option does not exist.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAklsnLIACgkQrlYvE4MpobOrGQCgs76GOeXnSKrLCX69GpCAiIZN
f4AAn312U9ill0sLCKWP1bsL661mctEH
=D9bQ
-----END PGP SIGNATURE-----

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2009-02-16 11:39:00 -05:00
Joshua Brindle
36df93ed82 bump policycoreutils to 2.0.61 2009-01-12 10:42:48 -05:00
Joshua Brindle
8b092bade5 Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: chcat patch.
Date: Fri, 07 Nov 2008 09:39:32 -0500

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Prevent chcat from expanding number of categories above max size of
command line.  Arbitrarily picked 25.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkkUUyQACgkQrlYvE4MpobMDDwCg0DMLERlnHZyVmORa9de9f5tf
fQsAoJZpO646H5CFuXZuW6htHpPfHz/z
=4OcI
-----END PGP SIGNATURE-----

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2009-01-12 10:19:59 -05:00
Joshua Brindle
5cbb573fa5 Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: Small fixes for audit2allow
Date: Mon, 01 Dec 2008 15:19:09 -0500

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2009-01-12 10:19:59 -05:00
Joshua Brindle
8c51c70d59 Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: semodule patch to use new semanage interfaces
Date: Fri, 07 Nov 2008 09:41:24 -0500

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Allows semodule to read bzip compressed policy packages directly.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkkUU5QACgkQrlYvE4MpobMHGQCdGwEl3h1ZwV92u1mfgrr3z7XT
NGYAoIwz76N7QFdEr8I0t3ncGhbo6heq
=raBi
-----END PGP SIGNATURE-----

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2009-01-12 10:19:58 -05:00
Stephen Smalley
f64fea9a0b Bump policycoreutils to 2.0.60 2008-11-12 16:26:21 -05:00
Stephen Smalley
b4fca3c40f semanage: Use semanage_mls_enabled
Change semanage/seobject to use semanage_mls_enabled() rather than
is_selinux_mls_enabled().  I dropped the mls enabled tests altogether
from the semanage front-end script since setting up a handle is done by
seobject.py; if those checks are actually important, we could move them
inside of the seobject methods, but I'm not clear on the real benefit of
those checks.  In seobject.py, I moved the setting of the is_mls_enabled
variable inside of get_handle(store) after the connect.  I also dropped
the is_mls_enabled test from setransRecords since no handle/connection
exists there (since translations are not managed via libsemanage), and
again I'm not clear that the check there was overly important/useful.

Signed-off-by:  Stephen Smalley <sds@tycho.nsa.gov>
2008-11-12 16:00:06 -05:00
Joshua Brindle
223bb406d8 Bump libsemanage to 2.0.29 and policycoreutils to 2.0.59 2008-11-09 11:20:40 -05:00
Joshua Brindle
c35dcc43bc Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: Latest policycoreutils package has a minor problem
Date: Mon, 10 Nov 2008 09:04:39 -0500

Checking _local twice.

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2008-11-09 11:16:51 -05:00
Joshua Brindle
2c41d9d1a7 bump policycoreutils to 2.0.58 2008-11-07 19:25:17 -05:00
Joshua Brindle
1f4d94f4c4 Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: seobject_fcontext patch allows you to modify a preexisting file context.
Date: Fri, 07 Nov 2008 09:46:36 -0500

Currently semanage is not allowed to change a file context mapping if it
matches exactly,  this patch allows you to modify the file context.

Signed-off-by: Joshua Brindle <method@manicmethod.com>

NOTE: original patch modified to remove unused list in fcontext get_all()
2008-11-07 19:20:39 -05:00
Joshua Brindle
dd808a1342 Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: policycoreutils patch
Date: Thu, 23 Oct 2008 13:15:11 -0400

Change semange fcontext -a to check for local customizations rather then
 global, so you can modify a file context.

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2008-11-07 16:55:34 -05:00
Joshua Brindle
cb69455465 Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: policycoreutils audit2allow patch
Date: Fri, 07 Nov 2008 09:36:44 -0500

audit2why can throw a runtime exception and typo in man page.

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2008-11-07 16:50:34 -05:00
Joshua Brindle
bcd43e0bf1 Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: newrole error message corrections.
Date: Fri, 07 Nov 2008 09:37:52 -0500

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2008-11-07 16:49:04 -05:00
Joshua Brindle
c28138ef18 bump policycoreutils to 2.0.57 2008-09-18 09:56:06 -04:00
Joshua Brindle
1dce6736bd Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: Latest translations of SELinux policoreutils patch
Date: Fri, 12 Sep 2008 11:57:31 -0400

http://people.fedoraproject.org/~dwalsh/SELinux/policycoreutils-po.patch
2008-09-18 09:52:36 -04:00
Joshua Brindle
a4c9f58e03 Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: Changes to semanage to allow it to handle transactions.
Date: Fri, 12 Sep 2008 11:52:31 -0400

Joshua Brindle wrote:
> Daniel J Walsh wrote:
> semanage -S targeted -i - << __eof
> user -a -P user -R "unconfined_r system_r" -r s0-s0:c0.c1023 unconfined_u
> user -a -P user -R guest_r guest_u
> user -a -P user -R xguest_r xguest_u
> __eof
> semanage -S targeted -i - << __eof
> login -m  -s unconfined_u -r s0-s0:c0.c1023 __default__
> login -m  -s unconfined_u -r s0-s0:c0.c1023 root
> __eof
>
> So you can add multiple records in a single pass.
>>

> This patch seems to cause some issues:

> [root@misterfreeze selinux-pristine]# semanage --help
> Traceback (most recent call last):
>   File "/usr/sbin/semanage", line 433, in <module>
>     usage(_("Requires 2 or more arguments"))
>   File "/usr/sbin/semanage", line 98, in usage
>     """) % message)
> TypeError: float argument required

Patch off your latest policycoreutils.

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2008-09-07 22:00:20 -04:00
Joshua Brindle
5214ee3d97 bump policycoreutils to 2.0.56 and sepolgen to 1.0.14 2008-09-07 18:57:50 -04:00
Joshua Brindle
f33c230526 Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: Changes to semanage to allow it to handle transactions.
Date: Mon, 08 Sep 2008 15:05:36 -0400

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

semanage -S targeted -i - << __eof
user -a -P user -R "unconfined_r system_r" -r s0-s0:c0.c1023 unconfined_u
user -a -P user -R guest_r guest_u
user -a -P user -R xguest_r xguest_u
__eof
semanage -S targeted -i - << __eof
login -m  -s unconfined_u -r s0-s0:c0.c1023 __default__
login -m  -s unconfined_u -r s0-s0:c0.c1023 root
__eof

So you can add multiple records in a single pass.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkjFd4AACgkQrlYvE4MpobMaoQCgxeqYTX2mpRIiIr0461/fvblU
3fQAoIbM8x9rWL0f8iPz0UeoM2mf60XW
=hxC3
-----END PGP SIGNATURE-----

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2008-09-07 18:53:26 -04:00
Joshua Brindle
64d7ef5d44 Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: Add glob support for restorecond
Date: Mon, 08 Sep 2008 15:03:51 -0400

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have added supported for GLOB expressions in restorecond.  In order to
get nsplugin to work well, you need all of the contents of the homedir
labeled correctly.  Unfortunately gnome creates directories at a fairly
random pace.  FCFS.  So it is very difficult to get transitions to
happen properly.  As a tradeoff, we can use restorecond to watch the
homedir and relabel the directory when it is created.  I know this is a
potential race condition. where some of the files created in the
directory will still have the wrong context, but I don't know of a
better solution.

Telling everyone they need to restorcon -R -v ~ is not a great solution.
 If you are worried about information flow you should never rely on
restorecond.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkjFdxcACgkQrlYvE4MpobPtjACg3uyqaHD78FRxdaG5mfitnoB/
lh0AnjvfDC2vmCWisxzWq2qFsZMMu3XK
=JiG7
-----END PGP SIGNATURE-----

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2008-09-07 18:51:09 -04:00
Joshua Brindle
2928ff2189 Author: Daniel J Walsh
Email: dwalsh@redhat.com
Subject: fixfiles fixes
Date: Mon, 08 Sep 2008 15:03:35 -0400

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Removes all files from /tmp, previous one would leave /tmp/.a and /tmp/.b

Fixed context on unlabeled_t and file_t files in /tmp and /var/tmp.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkjFdwYACgkQrlYvE4MpobMZJACfRsCuVFja3fvYZYtptyW2h3lH
yAQAn0xmDAYELt+res60OIcL3UDrUFRv
=09W1
-----END PGP SIGNATURE-----

Signed-off-by: Joshua Brindle <method@manicmethod.com>
2008-09-07 18:47:23 -04:00
Stephen Smalley
107d46ff3e Update policycoreutils VERSION and ChangeLog. 2008-08-26 09:40:22 -04:00
Stephen Smalley
55fe3dbba5 Fix locallist (-lC) functionality for semanage node. 2008-08-26 09:36:09 -04:00
Christian Kuester
49706ad9f8 Revised Patch for local nodecon support in semanage (was: Adding local nodecon's through semanage)
Stephen Smalley schrieb:

Hi List,

> On Tue, 2008-07-08 at 08:30 -0400, Stephen Smalley wrote:
>> On Tue, 2008-07-08 at 12:13 +0200, Christian Kuester wrote:
>>>> Other tidbits on the semanage patch that I noticed:
>>>> - semanage node -l was broken, requires additional argument that has
>>>> been added to the list methods subsequently.  Also would be nice to
>>>> support locallist/-C option.
>>>> - semanage node -p option should take a string rather than an integer
>>>> and map it to the proper symbolic constant for ipv4/ipv6.
>> Please be sure to test each of the nodeRecords methods.
> Are you still pursuing getting this cleaned up and merged?

Sorry, it took some time. The revised patch for nodecon support in
the semanage tool is attached.

It now takes strings as arguments for the ip protocol. list/locallist
work as expected and output is more readable. I also made changes for
the semanage.8 man page.

Kind Regards,
Christian

--
tarent Gesellschaft für Softwareentwicklung und IT-Beratung mbH

Heilsbachstr. 24, 53123 Bonn  | Poststr. 4-5, 10178 Berlin
fon: +49(228) / 52675-0       | fon: +49(30) / 27594853
fax: +49(228) / 52675-25      | fax: +49(30) / 78709617

Geschäftsführer
Boris Esser, Elmar Geese
HRB AG Bonn 5168
Ust-ID: DE122264941

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2008-08-21 16:48:03 -04:00
Joshua Brindle
13cd4c8960 initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00