diff --git a/libsemanage-fedora.patch b/libsemanage-fedora.patch index 199f383..001bbde 100644 --- a/libsemanage-fedora.patch +++ b/libsemanage-fedora.patch @@ -51,6 +51,34 @@ index c58961b..8e4d116 100644 return status; } +diff --git libsemanage-2.8/src/genhomedircon.c libsemanage-2.8/src/genhomedircon.c +index 3e61b51..c35f878 100644 +--- libsemanage-2.8/src/genhomedircon.c ++++ libsemanage-2.8/src/genhomedircon.c +@@ -1074,10 +1074,20 @@ static int get_group_users(genhomedircon_settings_t * s, + + const char *grname = selogin + 1; + +- if (getgrnam_r(grname, &grstorage, grbuf, +- (size_t) grbuflen, &group) != 0) { +- goto cleanup; ++ errno = 0; ++ while ( ++ (retval = getgrnam_r(grname, &grstorage, grbuf, (size_t) grbuflen, &group)) != 0 && ++ errno == ERANGE ++ ) { ++ char *new_grbuf; ++ grbuflen *= 2; ++ new_grbuf = realloc(grbuf, grbuflen); ++ if (new_grbuf == NULL) ++ goto cleanup; ++ grbuf = new_grbuf; + } ++ if (retval == -1) ++ goto cleanup; + + if (group == NULL) { + ERR(s->h_semanage, "Can't find group named %s\n", grname); diff --git libsemanage-2.8/src/semanage_store.c libsemanage-2.8/src/semanage_store.c index f1984c5..58dded6 100644 --- libsemanage-2.8/src/semanage_store.c diff --git a/libsemanage.spec b/libsemanage.spec index 75723e4..9619447 100644 --- a/libsemanage.spec +++ b/libsemanage.spec @@ -4,13 +4,13 @@ Summary: SELinux binary policy manipulation library Name: libsemanage Version: 2.8 -Release: 6%{?dist} +Release: 7%{?dist} License: LGPLv2+ Source: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20180524/libsemanage-2.8.tar.gz # download https://raw.githubusercontent.com/fedora-selinux/scripts/master/selinux/make-fedora-selinux-patch.sh # run: # $ VERSION=2.8 ./make-fedora-selinux-patch.sh libsemanage -# HEAD https://github.com/fedora-selinux/selinux/commit/decd49caec76a87817686f84716503151cf2be5d +# HEAD https://github.com/fedora-selinux/selinux/commit/2fee0bccb66a6cafcf0d178b8c75c23ebd3f9924 Patch1: libsemanage-fedora.patch URL: https://github.com/SELinuxProject/selinux/wiki Source1: semanage.conf @@ -179,6 +179,9 @@ sed -i '1s%\(#! */usr/bin/python\)\([^3].*\|\)$%\13\2%' %{buildroot}%{_libexecdi %{_libexecdir}/selinux/semanage_migrate_store %changelog +* Mon Dec 10 2018 Petr Lautrbach - 2.8-7 +- genhomedircon - improve handling large groups + * Tue Nov 13 2018 Petr Lautrbach - 2.8-6 - Fix RESOURCE_LEAK and USE_AFTER_FREE coverity scan defects