summaryrefslogtreecommitdiff
path: root/vdr.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2006-01-13 16:16:32 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2006-01-13 16:16:32 +0100
commitb11dcb15de18b20b55f2b0ceea3df6f540c75774 (patch)
tree8a0a1edea2e535ec5cfd2bd15fca5e27393bffbb /vdr.c
parent317b15f5a06007ebe6f475c6700424ae9d07d1c1 (diff)
downloadvdr-b11dcb15de18b20b55f2b0ceea3df6f540c75774.tar.gz
vdr-b11dcb15de18b20b55f2b0ceea3df6f540c75774.tar.bz2
Dropped the default vdr user
Diffstat (limited to 'vdr.c')
-rw-r--r--vdr.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/vdr.c b/vdr.c
index 5d387909..b9da3fb4 100644
--- a/vdr.c
+++ b/vdr.c
@@ -22,7 +22,7 @@
*
* The project's page is at http://www.cadsoft.de/vdr
*
- * $Id: vdr.c 1.235 2006/01/13 15:33:54 kls Exp $
+ * $Id: vdr.c 1.236 2006/01/13 16:16:32 kls Exp $
*/
#include <getopt.h>
@@ -157,14 +157,13 @@ int main(int argc, char *argv[])
// Command line options:
-#define DEFAULTVDRUSER "vdr"
#define DEFAULTSVDRPPORT 2001
#define DEFAULTWATCHDOG 0 // seconds
#define DEFAULTPLUGINDIR PLUGINDIR
#define DEFAULTEPGDATAFILENAME "epg.data"
bool StartedAsRoot = false;
- const char *VdrUser = DEFAULTVDRUSER;
+ const char *VdrUser = NULL;
int SVDRPport = DEFAULTSVDRPPORT;
const char *AudioCommand = NULL;
const char *ConfigDirectory = NULL;
@@ -192,6 +191,9 @@ int main(int argc, char *argv[])
#if defined(VFAT)
VfatFileSystem = true;
#endif
+#if defined(VDR_USER)
+ VdrUser = VDR_USER;
+#endif
cPluginManager PluginManager(DEFAULTPLUGINDIR);
int ExitCode = 0;
@@ -337,7 +339,7 @@ int main(int argc, char *argv[])
// Set user id in case we were started as root:
- if (getuid() == 0) {
+ if (VdrUser && getuid() == 0) {
StartedAsRoot = true;
if (strcmp(VdrUser, "root")) {
if (!SetKeepCaps(true))
@@ -394,8 +396,8 @@ int main(int argc, char *argv[])
" -r CMD, --record=CMD call CMD before and after a recording\n"
" -s CMD, --shutdown=CMD call CMD to shutdown the computer\n"
" -t TTY, --terminal=TTY controlling tty\n"
- " -u USER, --user=USER run as user USER (default: %s); only applicable\n"
- " if started as root\n"
+ " -u USER, --user=USER run as user USER; only applicable if started as\n"
+ " root\n"
" -v DIR, --video=DIR use DIR as video directory (default: %s)\n"
" -V, --version print version information and exit\n"
" --vfat encode special characters in recording names to\n"
@@ -408,7 +410,6 @@ int main(int argc, char *argv[])
LIRC_DEVICE,
DEFAULTSVDRPPORT,
RCU_DEVICE,
- DEFAULTVDRUSER,
VideoDirectory,
DEFAULTWATCHDOG
);
@@ -473,7 +474,7 @@ int main(int argc, char *argv[])
}
isyslog("VDR version %s started", VDRVERSION);
- if (StartedAsRoot)
+ if (StartedAsRoot && VdrUser)
isyslog("switched to user '%s'", VdrUser);
if (DaemonMode)
dsyslog("running as daemon (tid=%d)", cThread::ThreadId());