Commit graph

690 commits

Author SHA1 Message Date
Stephen Smalley
65f5868c23 Move policycoreutils/semodule_package to semodule-utils.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-11-16 11:19:51 -05:00
Stephen Smalley
b97d959a6a Move policycoreutils/sepolgen-ifgen into python/audit2allow.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-11-16 11:19:51 -05:00
Stephen Smalley
c9c97d6e8b Move policycoreutils/semodule_{deps,expand,link} to semodule-utils.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-11-16 11:19:50 -05:00
Stephen Smalley
48dc232627 Move policycoreutils/{sepolicy,audit2allow,semanage,scripts/chcat*} and sepolgen to python.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-11-16 11:19:50 -05:00
Stephen Smalley
63e6dba9ca Move policycoreutils/sepolicy dbus service files to dbus.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-11-16 11:19:50 -05:00
Stephen Smalley
97bf196c89 Move policycoreutils/sandbox to sandbox.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-11-16 11:19:50 -05:00
Stephen Smalley
00be13634a Move policycoreutils/restorecond to restorecond.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-11-16 11:19:50 -05:00
Stephen Smalley
4cc808671a Move policycoreutils/mcstrans to mcstrans.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-11-16 11:19:50 -05:00
Stephen Smalley
2e4d0bc862 Move policycoreutils/gui to gui.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-11-16 11:19:50 -05:00
Stephen Smalley
df3ba03b9f Updated policycoreutils ChangeLog
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-11-15 10:56:24 -05:00
Laurent Bigonville
917f398d7c policycoreutils: Use GObject introspection binding instead of python-gobject in selinux_server.py
Signed-off-by: Laurent Bigonville <bigon@bigon.be>
2016-11-15 10:54:18 -05:00
Laurent Bigonville
1270be188a policycoreutils: Force GTK3.0 for sepolicy gui
This removes the following warning when running sepolicy gui command:

/usr/lib/python3/dist-packages/sepolicy/gui.py:29: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.

Signed-off-by: Laurent Bigonville <bigon@bigon.be>
2016-11-15 10:54:13 -05:00
Stephen Smalley
5e911ee825 Updated policycoreutils ChangeLog
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-11-08 10:34:47 -05:00
Laurent Bigonville
2d7ca0b862 policycoreutils: Make sepolicy work with python3
Add python3 support for sepolicy

Signed-off-by: Laurent Bigonville <bigon@bigon.be>
2016-11-08 10:34:08 -05:00
Stephen Smalley
71ee7217d7 Updated policycoreutils ChangeLog
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-11-08 10:07:45 -05:00
Laurent Bigonville
eed0e4259f Sandbox: Use next() over the sepolicy.info() result
sepolicy.info() now returns a generator, use next() to get the results.

Signed-off-by: Laurent Bigonville <bigon@bigon.be>
2016-11-08 10:05:39 -05:00
Stephen Smalley
ff413bb55e Updated policycoreutils ChangeLog
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-11-02 09:13:14 -04:00
Laurent Bigonville
22e8b70867 policycoreutils: Use "new" sepolicy icon in .desktop file for sepolicy gui
New hires icons have been added to the repository end 2013 but the
sepolicy .desktop file is not using it, let's fix that.
2016-11-02 09:12:32 -04:00
Stephen Smalley
3a8f55efc0 Updated policycoreutils ChangeLog
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-10-31 12:50:08 -04:00
Nicolas Iooss
266c16ff53 policycoreutils: semodule_package: do not fail with an empty fc file
When running sepolgen tests on a Linux 4.7 kernel, one test fails with
the following message:

    /usr/bin/semodule_package:  Failed to mmap
    tmp/module_compile_test.mod.fc:  Invalid argument

The .fc file is empty, which is why it cannot be used with mmap().
Anyway the current code supports empty files (with if() conditions in
main()) so do not try to mmap an empty file in file_to_data().

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2016-10-31 12:46:54 -04:00
Nicolas Iooss
cb68b534e3 policycoreutils: restorecond: use pkg-config to find dbus-glib-1 files
On Ubuntu some header files are located in /usr/lib/x86_64-linux-gnu/,
not /usr/lib64/:

    $ pkg-config --cflags dbus-glib-1
    -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include
    -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include

Use pkg-config instead of hard-coded paths to find glib and dbus-glib
headers and libraries.

This is needed in order to use environments provided for example by
https://travis-ci.org/.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2016-10-31 12:44:10 -04:00
Stephen Smalley
a610f08d2e Updated policycoreutils ChangeLog
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-10-21 12:59:37 -04:00
Vit Mojzis
530904eaaa policycoreutils/gui: fix system-config-selinux editing features
Return column definitions to portsPage (gui fails to load otherwise).

fcontextPage:
  "ftype" dropdown was filled from 2 sources (system-config-selinux.glade
  and fcontextPage - from seobject module) which resulted in duplicate
  and invalid options. When given to "semanage fcontext -f", ftype has to be
  converted to 1 letter argument mode.

TreeView.get_selection().get_selected() can return "None" if no item is selected
(the list can be empty). Test if correct iterator was acquired.

Fixes:
  https://bugzilla.redhat.com/show_bug.cgi?id=1344842

Signed-off-by: vmojzis <vmojzis@redhat.com>
2016-10-21 12:58:41 -04:00
Stephen Smalley
b4cca24240 Update VERSION and ChangeLog files for 2.6 final release.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-10-14 11:31:26 -04:00
Stephen Smalley
4257778f18 Update VERSION and ChangeLog files for 2.6-rc2 release.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-10-06 10:23:40 -04:00
Stephen Smalley
0cea223d33 Update VERSION and ChangeLog files for 2.6-rc1 release.
Intentionally jumping versions in sepolgen to make it consistent
with the rest.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-09-30 12:15:08 -04:00
Stephen Smalley
87c174fe09 policycoreutils: setfiles: make -I imply -D
-I only makes sense if we are also enabling digests.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-09-30 12:12:28 -04:00
Stephen Smalley
b11640ab4c Updated policycoreutils ChangeLog
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-09-30 11:08:04 -04:00
Stephen Smalley
49883982f6 policycoreutils: setfiles: reverse the sense of -D
Reverse the sense of the -D option, from disabling setting/use of
security.restorecon_last to enabling it, making disabled the default state.

Rationale:
1) Users often use restorecon to fix labels on files whose labels are
wrong even through nothing has changed in file_contexts, e.g. after
copying/moving files to a different location.  They won't expect
restorecon to suddenly stop relabeling by default because the hash of
file_contexts hasn't changed.

2) Only processes running with CAP_SYS_ADMIN can set
security.restorecon_last, so this will fail for non-root users anyway.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-09-30 11:03:06 -04:00
Stephen Smalley
d8bc2b7657 Updated policycoreutils ChangeLog
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-09-29 10:42:57 -04:00
Nicolas Iooss
ca3cc145d8 policycoreutils: setfiles: ignore restorecon_xattr in git
Commit f1352e7399 ("policycoreutils: setfiles - Utility to find
security.restorecon_last entries") introduced restorecon_xattr binary
without adding it to .gitignore.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2016-09-29 10:42:23 -04:00
Stephen Smalley
f0dc773856 Updated policycoreutils ChangeLog
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-09-27 09:48:54 -04:00
Laurent Bigonville
a992b9993d sandbox: Use dbus-run-session instead of dbus-launch when available
According to dbus upstream: "dbus-launch is fairly horrible code,
complicated by the historical need for it to support X11 autolaunching,
so the D-Bus maintainers would like to move it out of the critical path
and minimize its use."

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=836289

Signed-off-by: Laurent Bigonville <bigon@bigon.be>
2016-09-27 09:48:03 -04:00
James Carter
a982bc61b5 Updated libselinux and policycoreutils ChangeLogs.
Signed-off-by: James Carter <jwcart2@tycho.nsa.gov>
2016-09-26 14:11:22 -04:00
Richard Haines
f1352e7399 policycoreutils: setfiles - Utility to find security.restorecon_last entries
This patch adds restorecon_xattr(8) to find and/or remove
security.restorecon_last entries added by setfiles(8) or
restorecon(8). Uses the services of selinux_restorecon_xattr(3).

Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
2016-09-26 14:05:58 -04:00
Richard Haines
2496c85734 policycoreutils: setfiles - Add option to stop setting the digest
Add -D option to setfiles and restorecon - Do not set or update
directory SHA1 digests when relabeling files. This will allow
users the option of not using the "security.restorecon_last"
extended attribute feature.

Also review and update the man pages.

Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
2016-09-26 14:05:49 -04:00
James Carter
b0f76c3a4c Updated libsemanage and policycoreutils ChangeLogs.
Signed-off-by: James Carter <jwcart2@tycho.nsa.gov>
2016-09-26 11:47:03 -04:00
Petr Lautrbach
7a728e46a5 libsemanage: Use pp module name instead of filename
When a user installs a module, the filename is used as the module name.
This change was introduced with CIL language where a module name is not
stored in the module itself. It means that when a pp module has
different filename and stored module name, the filename is used instead
of the stored module name. It brings problems with compatibility for
scripts and modules which were built and used on older system and were
migrated to the new userspace.

This patch changes the behavior of semanage_direct_install_file() which
is used by 'semodule -i' so that when a module with pp language
extension is installed, it tries to get and use a stored module name
instead of a filename. A warning message is provided.

The warning message in policycoreutils/hll/pp is updated to reflect this
change:

$ semodule -X 400 -i /root/testfile.pp
Warning: SELinux userspace will refer to the module from /root/testfile.pp as testmod rather than testfile

$ /usr/libexec/selinux/hll/pp /root/testfile.pp testfile.cil
Warning: SELinux userspace will refer to the module from /root/testfile.pp as testmod rather than testfile

Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
2016-09-26 11:38:45 -04:00
Stephen Smalley
badb849805 Updated ChangeLogs
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-09-26 11:03:33 -04:00
Nicolas Iooss
d977330c98 policycoreutils: Remove LDFLAGS from CFLAGS
Mixing LDFLAGS in CFLAGS can lead to compiler errors. For example in
policycoreutils/sandbox:

    $ make CC=clang LDFLAGS='-Wl,-as-needed,-no-undefined'
    clang -Wl,-as-needed,-no-undefined -I/usr/include
    -DPACKAGE="\"policycoreutils\"" -Wall -Werror -Wextra -W   -c -o
    seunshare.o seunshare.c
    clang-3.8: error: -Wl,-as-needed,-no-undefined: 'linker' input
    unused

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2016-09-26 11:02:40 -04:00
Stephen Smalley
2059435f9a Updated policycoreutils ChangeLog
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-09-23 16:38:03 -04:00
Jason Zaman
7e04f545f2 sepolicy: update setup.py to remove C module
Signed-off-by: Jason Zaman <jason@perfinion.com>
2016-09-23 16:33:49 -04:00
Jason Zaman
97d5f6a24f sepolicy: make search() use setools4 api
Signed-off-by: Jason Zaman <jason@perfinion.com>
2016-09-23 16:33:49 -04:00
Jason Zaman
f10a096354 sepolicy: make info() use setools4 api
Also make it return generators instead of an explicit list.

Signed-off-by: Jason Zaman <jason@perfinion.com>
2016-09-23 16:33:49 -04:00
Jason Zaman
7fa9658fa2 sepolicy: info() and search() will return generators
The next patch will update info() and search() to use the setools4 api.
setools4 makes heavy use of generators so info() and search() will as
well. Pre-emptively update users to cast to a list where required.

Signed-off-by: Jason Zaman <jason@perfinion.com>
2016-09-23 16:33:49 -04:00
Jason Zaman
18410c86f7 sepolicy: update some users of search() to use setools directly
search() is an overly complex wrapper around setools, several users are
simplified by just directly using setools.

Signed-off-by: Jason Zaman <jason@perfinion.com>
2016-09-23 16:33:49 -04:00
Jason Zaman
cf6bd6ae04 sepolicy: initialize setools4
Signed-off-by: Jason Zaman <jason@perfinion.com>
2016-09-23 16:33:49 -04:00
Jason Zaman
c3176aeee8 sepolicy: rearrange vars together at the top
This has no functional or code changes other than grouping lines
together for clarity.

Signed-off-by: Jason Zaman <jason@perfinion.com>
2016-09-23 16:33:49 -04:00
Stephen Smalley
6abc179335 Updated policycoreutils ChangeLog
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-09-23 15:53:12 -04:00
Petr Lautrbach
acca96a135 sandbox: create a new session for sandboxed processes
It helps to prevent sandboxed processes to inject arbitrary commands
into the parent.

Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
2016-09-23 15:49:57 -04:00