Refactor PKGBUILD and Systemd unit
I initially totally missed that udp2raw
is in extra already and thus created a PKGBUILD
myself... PKGBUILD
I created from scratch. I feel like the following differences could also benefit the official package:
-
udp2raw
- Don't ship a
make fast
binary that is actually meant for development (make fast
is without-O2
, but with-ggdb
), but usemake dynamic
instead - Remove
udp2raw_script.sh
fiddling around with the output ofudp2raw -g
to createiptables
rules, but use the built-inudp2raw --gen-add
andudp2raw --clear
instead - Remove
udp2raw.install
and consequently thesetcap
call; I'm no expert in this matter, thus I might be wrong, but I don't think that this is the best approach, because it allows any unprivileged user to useudp2raw
, and a flaw inudp2raw
could thus allow any unprivileged user to gainCAP_NET_RAW
andCAP_NET_ADMIN
capabilities; using ambient capabilities is better, and the easiest way to use ambient capabilities is the Systemd unit; we should thus encourage users to always use the Systemd unit instead, users simply shouldn't try to do this manually
- Don't ship a
- Systemd unit
- Add
ConditionFileNotEmpty
to check whether the requiredudp2raw
config actually exists - Don't order the Systemd service after
network-online.target
, but afternetwork.target
:udp2raw
itself doesn't need the network to be "up", it might actually be part of what needs tbd for the network to get "up" - Don't let the Systemd service run
udp2raw
withUser=nobody
(which is deprecated), but useDynamicUser=yes
instead - Replace the deprecated
PermissionsStartOnly
option by the+
prefix - Lock down the execution environment of
udp2raw
as much as possible
- Add
- Packaging and misc stuff
- Fix
pkgdesc
inPKGBUILD
- Add
udp2raw
'sREADME.md
to/usr/share/doc/udp2raw/
- Add a
.gitignore
- Fix
Note (doesn't affect me personally, just noticed it): I think that we could add more arch
es here. Yes, I know, Arch only supports x86_64
, but I feel like we could add them now in case Arch ever wants to officially support more arches.
WDYT?