From 9eb4289586d2f51db082b70efe7ad99d36c55812 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Dec 03 2007 20:54:52 +0000 Subject: - Fix handling of /etc/shells so genhomedircon will work --- diff --git a/libsemanage-rhat.patch b/libsemanage-rhat.patch index f6c6f05..dbd1ad1 100644 --- a/libsemanage-rhat.patch +++ b/libsemanage-rhat.patch @@ -1,18 +1,75 @@ -diff --exclude-from=exclude -N -u -r nsalibsemanage/src/genhomedircon.c libsemanage-2.0.11/src/genhomedircon.c ---- nsalibsemanage/src/genhomedircon.c 2007-10-01 09:54:35.000000000 -0400 -+++ libsemanage-2.0.11/src/genhomedircon.c 2007-10-01 12:24:39.000000000 -0400 -@@ -668,12 +668,11 @@ +diff --exclude-from=exclude -N -u -r nsalibsemanage/src/genhomedircon.c libsemanage-2.0.14/src/genhomedircon.c +--- nsalibsemanage/src/genhomedircon.c 2007-10-05 13:09:53.000000000 -0400 ++++ libsemanage-2.0.14/src/genhomedircon.c 2007-12-03 15:47:19.000000000 -0500 +@@ -130,11 +130,13 @@ + char *temp = NULL; + semanage_list_t *list = NULL; + size_t buff_len = 0; ++ int len; - for (i = 0; i < nseusers; i++) { - seuname = semanage_seuser_get_sename(seuser_list[i]); -+ name = semanage_seuser_get_name(seuser_list[i]); + shells = fopen(PATH_SHELLS_FILE, "r"); + if (!shells) + return default_shell_list(); +- while (getline(&temp, &buff_len, shells) >= 0) { ++ while ((len = getline(&temp, &buff_len, shells)) > 0) { ++ if (temp[len-1] == '\n') temp[len-1] = 0; + if (strcmp(temp, PATH_NOLOGIN_SHELL)) { + if (semanage_list_push(&list, temp)) { + free(temp); +@@ -790,7 +792,7 @@ + homedir_context_tpl = make_template(s, &HOME_DIR_PRED); + homeroot_context_tpl = make_template(s, &HOME_ROOT_PRED); + user_context_tpl = make_template(s, &USER_CONTEXT_PRED); +- if (!homedir_context_tpl || !homeroot_context_tpl || !user_context_tpl) { ++ if (!homedir_context_tpl || !homeroot_context_tpl) { + retval = STATUS_ERR; + goto done; + } +@@ -828,16 +830,18 @@ -- if (strcmp(seuname, s->fallback_user) == 0) -+ if (strcmp(name,"root") && strcmp(seuname, s->fallback_user) == 0) - continue; + ustr_sc_free(&temp); + } +- if (write_user_context(s, out, user_context_tpl, +- ".*", s->fallback_user, +- s->fallback_user_prefix) != STATUS_SUCCESS) { +- retval = STATUS_ERR; +- goto done; +- } ++ if (user_context_tpl) { ++ if (write_user_context(s, out, user_context_tpl, ++ ".*", s->fallback_user, ++ s->fallback_user_prefix) != STATUS_SUCCESS) { ++ retval = STATUS_ERR; ++ goto done; ++ } -- name = semanage_seuser_get_name(seuser_list[i]); -- - if (strcmp(name, DEFAULT_LOGIN) == 0) - continue; +- if (write_gen_home_dir_context(s, out, user_context_tpl, +- homedir_context_tpl) != STATUS_SUCCESS) { +- retval = STATUS_ERR; ++ if (write_gen_home_dir_context(s, out, user_context_tpl, ++ homedir_context_tpl) != STATUS_SUCCESS) { ++ retval = STATUS_ERR; ++ } + } + done: +diff --exclude-from=exclude -N -u -r nsalibsemanage/src/handle.c libsemanage-2.0.14/src/handle.c +--- nsalibsemanage/src/handle.c 2007-08-20 19:15:37.000000000 -0400 ++++ libsemanage-2.0.14/src/handle.c 2007-11-10 06:21:33.000000000 -0500 +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + #include + + #include "direct_api.h" +@@ -131,7 +132,7 @@ + + /* This just sets the storename to what the user requests, no + verification of existance will be done until connect */ +- sh->conf->store_path = storename; ++ sh->conf->store_path = strdup(storename); + sh->conf->store_type = storetype; + + return; diff --git a/libsemanage.spec b/libsemanage.spec index ce46200..011b6c0 100644 --- a/libsemanage.spec +++ b/libsemanage.spec @@ -1,12 +1,13 @@ -%define libsepolver 2.0.6-1 +%define libsepolver 2.0.14-1 %define libselinuxver 2.0.0-1 Summary: SELinux binary policy manipulation library Name: libsemanage -Version: 2.0.12 -Release: 1%{?dist} +Version: 2.0.14 +Release: 5%{?dist} License: GPL Group: System Environment/Libraries Source: http://www.nsa.gov/selinux/archives/libsemanage-%{version}.tgz +Patch: libsemanage-rhat.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: libselinux-devel >= %{libselinuxver} swig ustr-devel @@ -40,6 +41,7 @@ needed for developing applications that manipulate binary policies. %prep %setup -q +%patch -p1 -b .rhat %build make clean @@ -76,6 +78,20 @@ rm -rf ${RPM_BUILD_ROOT} %{_mandir}/man3/* %changelog +* Mon Dec 3 2007 Dan Walsh - 2.0.14-5 +- Fix handling of /etc/shells so genhomedircon will work + +* Thu Nov 29 2007 Dan Walsh - 2.0.14-3 +- Allow semanage_genhomedircon to work with out a USER int homedir.template + +* Sat Nov 10 2007 Dan Walsh - 2.0.14-2 +- Fix semanage_select_store to allocate memory, fixes crash on invalid store + +* Tue Nov 6 2007 Dan Walsh - 2.0.14-1 +- Upgrade to latest from NSA + * Call rmdir() rather than remove() on directory removal so that errno isn't polluted from Stephen Smalley. + * Allow handle_unknown in base to be overridden by semanage.conf from Stephen Smalley. + * Fri Oct 5 2007 Dan Walsh - 2.0.12-1 - Upgrade to latest from NSA * ustr cleanups from James Antill. diff --git a/sources b/sources index 386a4b2..3dd5026 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -bce237102b053289bcaa751ab04a0fa4 libsemanage-2.0.12.tgz +d8ab010248ca7e297986e65a7d22fb79 libsemanage-2.0.14.tgz