Bug #5620
open
satip server on port 554 unnecessarily limited to root only
Added by Andreas Tockhorn over 6 years ago.
Updated over 6 years ago.
Description
At the moment it is only possible to start the satip server on port 554 being root. For security reasons, I do not want to give the whole tvheadend root privileges. But unfortunately I have to use port 554 instead of 9983 as for example my Panasonic TV as a satip client only works when tvheadend as satip server listens on port 554.
Instead, I would like to use mechanisms like authbind or setcap to use port 554 without being root. But this does only work when the function satips_rtsp_port in server.c does not check against getuid()!=0 and changes the port to 9983. I suggest printing only an information or warning there. If tvheadend has not the appropriate permissions (not being root or using any other mechanism) an error message will be printed later when trying to bind to port 554 anyway.
You don't need to run tvheadend as root, you can start as root and drop privileges later.
Ok. I have to check. For me there is still the question what's the sense for this check. I dont see any. Without it I have even more choices on how to get port 554 used.
I had some time to dive deeper into the topic of privilege seperation. From my understanding, this would cause larger effort on changing tvheadend sources. Furthermore, it does still rely on starting as rooting, binding to port 554 and afterwards dropping root privileges. If this is not done appropriately, it might stil cause a security flaw. In addition, I cannot really imagine what is the correct point in time at which the privilege can be dropped, since the satip server can be reconfigured or being activated at any time.
So I still suggest removing the limitation to being root and staff the tvheadend binary with only that additional capability, e.g. by using sudo setcap CAP_NET_BIND_SERVICE=+eip /path/to/tvheadend-binary.
Have you tried port forwarding?
No, I have not. But I am sure it will work. Nevertheless, it is not a real solution but a workaround. I still don't see the sense of checking/forcing for being root just to start at a port below 1024.
Also available in: Atom
PDF