Commit graph

517 commits

Author SHA1 Message Date
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
b6ccfd7c91 checkpolicy: allow ~ in filename transition rules
We found that we wanted a filename transition rule for ld.so.cache~
however ~ was not a valid character in a filename.

Fix-from: Miroslav Grepl <mgrepl@redhat.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-12-05 16:09:30 -05:00
Eric Paris
f00d415747 checkpolicy: test: Makefile: include -W and -Werror
Include the same error type options we build everything else with.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-12-05 16:09:30 -05:00
Eric Paris
58179a9988 checkpolicy: dismod: fix unused parameter errors
Either by dropping the parameter or marking it as unused depending on
what works.  We can't redefine hashtab_map callbacks as they must take all
three options, so just mark those unused.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-12-05 16:09:30 -05:00
Eric Paris
44d8a2fed9 checkpolicy: dis* fixed signed vs unsigned errors
A number of places we used unsigned variables and compared them against
signed variables.  This patch makes everything unsigned.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-12-05 16:09:30 -05:00
Eric Paris
14e4b70b93 Bump Version and Changelog for commit 2011-11-03 15:26:36 -04:00
Dan Walsh
077e863517 sepolgen: Return name field in avc data
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
9cbd404ceb sepolgen: Ignore permissive qualifier if found in an interface
During Rawhide releases we change all "unconfined_domains" to
permissive domains in order to find new AVC messages without breaking
rawhide boxes.  The way we do this is changing the unconfined_domain
interface and putting permissive $1; in it.  sepolgen does not like
this and blows up the build.  This patch tells sepolgen to ignore the
permissive in an interface.

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
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
Eric Paris
d4a39ca15b policycoreutils: label_file: style changes to make Eric happy.
Sometimes sticking to 80 characters sucks a lot.  I don't care.  Buy a
wider monitor so I can read the code.

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
Eric Paris
1d274aca2d checkpolicy: drop libsepol dynamic link in checkpolicy
Checkpolicy was using the static link to libsepol, but also defining a
dynamic link (that wasn't needed).  This confuses gdb.  Drop the dynamic
link request.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 16:22:01 -04:00
Dan Walsh
2c4eca16dd libsemanage: create man5dir if not exist
Make new man page directory if it doesn't exist.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 15:37:11 -04:00
Guido Trentalancia
06f53004d9 libsemanage: semanage.conf man page
Add a new semanage.conf man page.

Signed-off-by: Eric Paris <eparis@redhat.com>
2011-11-02 15:37:11 -04:00
Eric Paris
0a778ba601 libsepol: expand: do filename_trans type comparison on mapped representation
The filename_trans code had a bug where duplicate detection was being
done between the unmapped type value of a new rule and the type value of
rules already in policy.  This meant that duplicates were not being
silently dropped and were instead outputting a message that there was a
problem.  It made things hard because the message WAS using the mapped
type to convert to the string representation, so it didn't look like a
dup!

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 15:37:11 -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
2b06f47400 libselinux: rename and export symlink_realpath
symlink_realpath is used by both libselinux and policycoreutils.
Instead of coding it twice, export the libselinux version under a new
name that makes it sound more generic.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 15:37:11 -04:00
Dan Walsh
74a9a52966 libselinux: audit2why: close fd on enomem
Potential file descriptor leak on this code path, need to close file
descriptor if out of memory.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 15:37:11 -04:00
Dan Walsh
dd563b35e1 libselinux: seusers: fix to handle large sets of groups
If a user was in too many groups the check_group function might not pass
a large enough buffer to getgrnam_r to handle things.  This could return
ERANGE which we then aborted.  Instead we should make the buffer larger and
try again.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 15:37:10 -04:00
Dan Walsh
3b5e45f004 libselinux: Don't reinitialize avc_init if it has been called previously
Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 15:37:10 -04:00
Dan Walsh
9c46a0a315 libselinux: simple interface for access checks
Some programs, like passwd, need to do simeple one time access checks.
Rather than set up a full avc cache and use that infrastructure they
were directly using security_compute_av.  A problem with this approach
is the lack of audit on denials.  This patch creates a new interface
that is simple to use and which will still listen to things like
permissive and output audit messages on denials.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 15:37:10 -04:00
Dan Walsh
86e8daafc3 libselinux: maintain mode even if umask is tighter
When certain programs were run which created new files they would get
default permissions based on the current users umask.  However these
files should get the same permissions as those files which they
replaced.  Do that.

Patch from: Stephen Smalley

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 15:37:10 -04:00
Eric Paris
023c9c1fde libselinux: label: cosmetic cleanups
Return early to save an indent.  Clean up all memory on ENOMEM
conditions.  Use '\0' instead of 0 for nul terminiator.  Style changes
to make Eric happy.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 15:37:10 -04:00
Eric Paris
c81a43c753 libselinux: libsemanage: libsepol: regenerate .pc on VERSION change
The makefile which generated the package config files did not have the
VERSION file as a dependancy.  Thus if you updated a tree you have
previously build the .pc file wouldn't be rebuilt and the old version
would be reinstalled.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 15:37:10 -04:00
Eric Paris
b3b19fdce5 libselinux: load_policy: handle selinux=0 and /sys/fs/selinux not exist
Handle situation where selinux=0 passed to the kernel and both /selinux and
/sys/fs/selinux directories do not exist.  We used to handle selinux=0
(or kernel compile without selinux) by getting ENODEV when we tried to
mount selinuxfs on /selinux.  Now selinux=0 means that /sys/fs/selinux
won't exist and we never create the real directory /selinux at all. So
we get ENOENT instead of ENODEV.  The solution is to check to see if the
mount failure was for ENODEV and if not to check if selinuxfs exists in
/proc/filesystems at all.  If it doesn't exist, that's equivalent to
ENODEV.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-11-02 15:37:10 -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
fdeeccaa0e Revert "checkpolicy: Redo filename/filesystem syntax to support filename trans rules"
This reverts commit d72a9ec825.  It should
never have been added.  It breaks the correct wrapping of filenames in "
2011-11-02 13:04:39 -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
6a53023740 libsemanage: fix semanage_store_access_check calling arguments
A few calls to semanage_store_access_check() in the libsemanage
tests passed an argument even though it is a void function.

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