- Initialize the supplementary groups of the dnsmasq user

(bsc#859298).

OBS-URL: https://build.opensuse.org/package/show/network/dnsmasq?expand=0&rev=81
This commit is contained in:
Reinhard Max 2016-06-16 12:44:49 +00:00 committed by Git OBS Bridge
parent 3508d04081
commit a427dadb0d
3 changed files with 24 additions and 0 deletions

16
dnsmasq-groups.patch Normal file
View File

@ -0,0 +1,16 @@
--- src/dnsmasq.c.orig
+++ src/dnsmasq.c
@@ -557,11 +557,10 @@ int main (int argc, char **argv)
if (!option_bool(OPT_DEBUG) && getuid() == 0)
{
int bad_capabilities = 0;
- gid_t dummy;
- /* remove all supplimentary groups */
+ /* set the supplimentary groups of the daemon user */
if (gp &&
- (setgroups(0, &dummy) == -1 ||
+ (initgroups(daemon->username, gp->gr_gid) == -1 ||
setgid(gp->gr_gid) == -1))
{
send_event(err_pipe[1], EVENT_GROUP_ERR, errno, daemon->groupname);

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Jun 16 12:39:18 UTC 2016 - max@suse.com
- Initialize the supplementary groups of the dnsmasq user
(bsc#859298).
-------------------------------------------------------------------
Tue Feb 2 21:34:39 UTC 2016 - mpluskal@suse.com

View File

@ -34,6 +34,7 @@ Source5: rc.dnsmasq-suse
Source6: SuSEFirewall.dnsmasq-dhcp
Source7: SuSEFirewall.dnsmasq-dns
Source8: %{name}-rpmlintrc
Patch0: dnsmasq-groups.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: dbus-1-devel
BuildRequires: dos2unix
@ -66,6 +67,7 @@ server's leases.
%prep
%setup -q
%patch0
# Some docs have the DOS line ends
dos2unix contrib/systemd/dbus_activation