From 2a9c9b49a71c5424107cf1dbe26c2c73136119ba Mon Sep 17 00:00:00 2001 From: Dan Walsh Date: Wed, 25 Sep 2013 12:46:19 -0400 Subject: [PATCH] Do not fail on missing SELinux User Record when adding login record --- libsemanage-rhat.patch | 16 ++++++---------- libsemanage.spec | 5 ++++- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/libsemanage-rhat.patch b/libsemanage-rhat.patch index e7bff36..7f50fdc 100644 --- a/libsemanage-rhat.patch +++ b/libsemanage-rhat.patch @@ -199,10 +199,10 @@ index 57ef49f..4b040c3 100644 return retval; } diff --git a/libsemanage/src/seuser_record.c b/libsemanage/src/seuser_record.c -index 8823b1e..d92633e 100644 +index 8823b1e..cfcd039 100644 --- a/libsemanage/src/seuser_record.c +++ b/libsemanage/src/seuser_record.c -@@ -140,19 +140,50 @@ const char *semanage_seuser_get_sename(const semanage_seuser_t * seuser) +@@ -140,19 +140,46 @@ const char *semanage_seuser_get_sename(const semanage_seuser_t * seuser) hidden_def(semanage_seuser_get_sename) @@ -234,15 +234,11 @@ index 8823b1e..d92633e 100644 + semanage_user_key_free(key); + if (rc == STATUS_ERR) + goto err; -+ else if (rc == STATUS_NODATA) { -+ ERR(handle, "SELinux user %s does not exist", sename); -+ errno = EINVAL; -+ rc = STATUS_ERR; -+ goto err; ++ else if (rc == STATUS_SUCCESS) { ++ mls_range = semanage_user_get_mlsrange(u); ++ semanage_seuser_set_mlsrange(handle, seuser, mls_range); ++ semanage_user_free(u); + } -+ mls_range = semanage_user_get_mlsrange(u); -+ semanage_seuser_set_mlsrange(handle, seuser, mls_range); -+ semanage_user_free(u); + } free(seuser->sename); seuser->sename = tmp_sename; diff --git a/libsemanage.spec b/libsemanage.spec index ad111c1..358550b 100644 --- a/libsemanage.spec +++ b/libsemanage.spec @@ -7,7 +7,7 @@ Summary: SELinux binary policy manipulation library Name: libsemanage Version: 2.1.10 -Release: 11%{?dist} +Release: 12%{?dist} License: LGPLv2+ Group: System Environment/Libraries Source: libsemanage-%{version}.tgz @@ -179,6 +179,9 @@ rm -rf ${RPM_BUILD_ROOT} %endif # if with_python3 %changelog +* Wed Sep 25 2013 Dan Walsh - 2.1.10-12 +- Do not fail on missing SELinux User Record when adding login record + * Mon Sep 23 2013 Dan Walsh - 2.1.10-11 - Add msg to audit records