diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2006-01-09 16:54:35 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2006-01-09 16:54:35 +0100 |
commit | f415169064b21ab8e025f1f36cdcb3258d2de679 (patch) | |
tree | 14e773884f1a60cf6aa423cc46badca49b13b86c /vdr.c | |
parent | df65f4a2f142fa6759d88cdca125ddef63ade65a (diff) | |
download | vdr-f415169064b21ab8e025f1f36cdcb3258d2de679.tar.gz vdr-f415169064b21ab8e025f1f36cdcb3258d2de679.tar.bz2 |
Skipping all SetCaps() and SetUser() calls when it is started as 'root' and "-u root" is given
Diffstat (limited to 'vdr.c')
-rw-r--r-- | vdr.c | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -22,7 +22,7 @@ * * The project's page is at http://www.cadsoft.de/vdr * - * $Id: vdr.c 1.233 2006/01/08 11:49:03 kls Exp $ + * $Id: vdr.c 1.234 2006/01/09 16:44:15 kls Exp $ */ #include <getopt.h> @@ -339,14 +339,16 @@ int main(int argc, char *argv[]) if (getuid() == 0) { StartedAsRoot = true; - if (!SetKeepCaps(true)) - return 2; - if (!SetUser(VdrUser)) - return 2; - if (!SetKeepCaps(false)) - return 2; - if (!SetCapSysTime()) - return 2; + if (strcmp(VdrUser, "root")) { + if (!SetKeepCaps(true)) + return 2; + if (!SetUser(VdrUser)) + return 2; + if (!SetKeepCaps(false)) + return 2; + if (!SetCapSysTime()) + return 2; + } } // Help and version info: |