debian: install udev rule and create related group

postinst script based on the example here:
https://www.debian.org/doc/manuals/securing-debian-manual/bpp-lower-privs.en.html

Signed-off-by: Oliver Smith <osmith@sysmocom.de>
This commit is contained in:
Oliver Smith 2023-06-28 17:03:54 +02:00
parent 45889a8c0c
commit 2f72e1ebce
3 changed files with 13 additions and 1 deletions

2
debian/control vendored
View File

@ -12,7 +12,7 @@ Homepage: http://sispmctl.sourceforge.net/
Package: sispmctl
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Depends: ${shlibs:Depends}, ${misc:Depends}, adduser (>= 3.11)
Description: Control Gembird SIS-PM programmable power outlet strips
The sispmctl tool can control Gembird SIS-PM Silver Shield programmable
power outlet strips (also known under the name Revolt Intelli-Plug) from

View File

@ -1,2 +1,3 @@
/usr/bin/sispmctl
/usr/share/man/man1/sispmctl.1
/usr/share/doc/sispmctl/examples/60-sispmctl.rules /lib/udev/rules.d/

11
debian/sispmctl.postinst vendored Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
case "$1" in
configure)
if ! getent group | grep -q "^sispmctl:" ; then
echo -n "Adding group sispmctl.."
addgroup --quiet --system sispmctl 2>/dev/null ||true
echo "..done"
fi
;;
esac