Package: libteam-utils
Version: 1.26-1
Severity: important

Dear Maintainer,

Teamd reports a message like:
  This program is not intended to be run as root.
When trying to run. Teamd cannot be run as a simple user either because
it needs permissions you don't get as user.

Instead, I believe it must be compiled with `configure 
--with-user=randomuser` so that it may downgrade its permissions.

The commit that introduced it is:
  
https://github.com/jpirko/libteam/commit/a6e7faccf949c1650c4f3da765459a113c454b19

I believe the patch attached fixes the issue. A fix for stretch would
be very much appreciated if possible.

-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.18.5+ (SMP w/4 CPU cores)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: SELinux: enabled - Mode: Permissive - Policy name: default

Versions of packages libteam-utils depends on:
ii  libc6         2.28-7
ii  libdaemon0    0.14-7
ii  libdbus-1-3   1.12.12-1
ii  libjansson4   2.12-1
pn  libteam5      <none>
ii  libteamdctl0  1.28-1

libteam-utils recommends no packages.

libteam-utils suggests no packages.
diff -Nur a/debian/control b/debian/control
--- a/debian/control    2016-08-27 12:18:08.000000000 +0000
+++ b/debian/control    2019-02-23 04:36:47.336504690 +0000
@@ -11,6 +11,7 @@
               ,libnl-genl-3-dev
               ,libnl-route-3-dev (>= 3.2.19)
               ,pkg-config
+              ,libcap-dev
 Standards-Version: 3.9.8
 Homepage: http://libteam.org
 Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/libteam.git
@@ -90,7 +91,7 @@
 
 Package: libteam-utils
 Architecture: linux-any
-Depends: ${shlibs:Depends}, ${misc:Depends}
+Depends: adduser, ${shlibs:Depends}, ${misc:Depends}
 # if-pre-up, if-post-down:
 #    ,jq
 Recommends:
diff -Nur a/debian/libteam-utils.postinst b/debian/libteam-utils.postinst
--- a/debian/libteam-utils.postinst     1970-01-01 00:00:00.000000000 +0000
+++ b/debian/libteam-utils.postinst     2019-02-23 04:31:34.820251196 +0000
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+    configure|reconfigure)
+        adduser --system --disabled-password --disabled-login --home 
/var/run/teamd \
+                   --no-create-home --quiet --force-badname --group _teamd
+        ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff -Nur a/debian/libteam-utils.postrm b/debian/libteam-utils.postrm
--- a/debian/libteam-utils.postrm       1970-01-01 00:00:00.000000000 +0000
+++ b/debian/libteam-utils.postrm       2019-02-23 06:35:52.419126722 +0000
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+#DEBHELPER#
+
+case "$1" in
+    purge)
+        rm -rf /var/run/teamd
+    ;;
+    *)
+    ;;
+esac
+
+exit 0
diff -Nur a/debian/rules b/debian/rules
--- a/debian/rules      2013-12-04 17:21:55.000000000 +0000
+++ b/debian/rules      2019-02-23 04:29:37.496156030 +0000
@@ -11,7 +11,9 @@
        #./autogen.sh
        dh_auto_configure -- \
                           --disable-silent-rules \
-                          --enable-static=no
+                          --enable-static=no \
+                          --with-user=_teamd \
+                          --with-group=_teamd \
 
 override_dh_auto_install:
        dh_auto_install --destdir=$(CURDIR)/debian/tmp

Reply via email to