Browse Source

Make /etc/protocols available inside the chroot

Since stretch, getprotobynumber() and friends no longer cache the
content of /etc/protocols. As a result, the protocols are no longer
resolved in the output of "softflowctl statistics".

So copy /etc/protocols into the chroot, and make sure it's available.
Christoph Biedl 3 years ago
parent
commit
f25053c3c7
3 changed files with 5 additions and 2 deletions
  1. 1 0
      debian/control
  2. 1 0
      debian/softflowd.init
  3. 3 2
      debian/softflowd.tmpfile

+ 1 - 0
debian/control

@@ -13,6 +13,7 @@ Package: softflowd
 Architecture: any
 Depends: ${misc:Depends}, ${shlibs:Depends},
     lsb-base,
+    netbase,
 Description: Flow-based network traffic analyser
  Softflowd is a flow-based network traffic anaylser capable of Cisco
  Netflow data export. Softflowd semi-statefully tracks traffic

+ 1 - 0
debian/softflowd.init

@@ -26,6 +26,7 @@ if [ "$1" = 'start' ] ; then
         [ -L /var/run/softflowd.ctl ] || rm /var/run/softflowd.ctl
     fi
     [ -e /var/run/softflowd.ctl ] || ln -s /var/run/softflowd/default.ctl /var/run/softflowd.ctl
+    install -D -p /etc/protocols "$PRIVDROP_CHROOT_DIR/etc/protocols"
 fi
 
 # Load the VERBOSE setting and other rcS variables

+ 3 - 2
debian/softflowd.tmpfile

@@ -1,3 +1,4 @@
 
-d /run/softflowd/chroot      0755 root root
-L /run/softflowd/default.ctl -    -    -    - /var/run/softflowd.ctl
+d /run/softflowd/chroot               0755 root root
+L /run/softflowd/default.ctl          -    -    -    - /var/run/softflowd.ctl
+C /run/softflowd/chroot/etc/protocols -    -    -    - /etc/protocols