]> git.sesse.net Git - vlc/commitdiff
Add --enable-run-as-root option to configure.
authorAntoine Cellerier <dionoea@videolan.org>
Fri, 19 Sep 2008 19:37:02 +0000 (21:37 +0200)
committerAntoine Cellerier <dionoea@videolan.org>
Fri, 19 Sep 2008 19:37:02 +0000 (21:37 +0200)
Embedded platforms often only have the root user. Do not, I repeat, Do not enable this option if you don't know what you're doing.

bin/vlc.c
configure.ac

index 9b094cb48eb35e2f61bdca402d39e9e9839f993c..30c83fcc827992831000f319b32efa8b8bdc76e4 100644 (file)
--- a/bin/vlc.c
+++ b/bin/vlc.c
@@ -51,6 +51,7 @@ int main( int i_argc, const char *ppsz_argv[] )
 {
     int i_ret;
 
+#ifndef ALLOW_RUN_AS_ROOT
     if (geteuid () == 0)
     {
         fprintf (stderr, "VLC is not supposed to be run as root. Sorry.\n"
@@ -59,6 +60,7 @@ int main( int i_argc, const char *ppsz_argv[] )
         "cannot be run by non-trusted users first).\n", ppsz_argv[0]);
         return 1;
     }
+#endif
 
     setlocale (LC_ALL, "");
 
index 43cba1dd114cb3af22d5fdd25134829ce8a971c4..675857de18c4a080144daa33fa1154f2084d66ad 100644 (file)
@@ -1529,6 +1529,16 @@ AH_TEMPLATE(NDEBUG,
             [Define to 1 if debug code should NOT be compiled])
 AS_IF([test "x${enable_debug}" = "xno"], [AC_DEFINE(NDEBUG)])
 
+dnl
+dnl Allow runing as root (usefull for people runing on embedded platforms)
+dnl
+AC_ARG_ENABLE(debug,
+[  --enable-run-as-root    allow runing VLC as root (default disabled)])
+AS_IF([test "${enable_run_as_root}" == "yes"],[
+    AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
+              [Define to 1 to allow runing VLC as root (uid 0).])
+])
+
 dnl
 dnl  Test coverage
 dnl