nbd/0001_fix_setgroup.patch
Martin Pluskal 96c7154348 - Update to version 1.18.0:
* Client: Add the "-g" option to avoid even trying the NBD_OPT_GO
    message
  * Server: fixes to inetd mode
  * Don't make gnutls and libnl automagic.
  * Server: bugfixes in handling of some export names during verification.
  * Server: clean supplementary groups when changing user.
  * Client: when using the netlink protocol, only set a timeout
    when there actually is a timeout, rather than defaulting to 0
    seconds
  * Improve documentation on the nbdtab file
  * Minor improvements to some error messages
  * Improvements to test suite so it works better on non-GNU
    userland environments
- Refresh 0001_fix_setgroup.patch

OBS-URL: https://build.opensuse.org/package/show/network:utilities/nbd?expand=0&rev=62
2019-01-15 15:13:19 +00:00

31 lines
1.1 KiB
Diff

From 0cd9e3ba2a0f54d930d813bfde9ff9d57a12d9ed Mon Sep 17 00:00:00 2001
From: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Date: Tue, 24 Jul 2018 15:59:39 -0300
Subject: [PATCH] server: clean supplementary groups when setuid
Upstream: merged
References: https://github.com/NetworkBlockDevice/nbd/commit/0cd9e3ba2a0f54d930d813bfde9ff9d57a12d9ed
References: gh#NetworkBlockDevice/nbd#79
References: https://github.com/NetworkBlockDevice/nbd/pull/79
When nbd-server drops privileges, it was leaving supplementary
groups untouched. As nbd-server was normally dropping from root,
nbd-server kept membership to root supplementary groups.
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
---
nbd-server.c | 1 +
1 file changed, 1 insertion(+)
Index: nbd-3.18/nbd-server.c
===================================================================
--- nbd-3.18.orig/nbd-server.c
+++ nbd-3.18/nbd-server.c
@@ -3471,6 +3471,7 @@ void dousers(const gchar *const username
err(str);
}
setgroups(0, NULL);
+ setgroups(0, NULL);
if(setuid(pw->pw_uid)<0) {
err("Could not set UID: %m");
}