[vlc-devel] commit: Add --enable-run-as-root option to configure. (Antoine Cellerier )

git version control git at videolan.org
Fri Sep 19 21:46:34 CEST 2008


vlc | branch: 0.9-bugfix | Antoine Cellerier <dionoea at videolan.org> | Fri Sep 19 21:37:02 2008 +0200| [c3f723fbac32a8b952995170a2befae150df90b8] | committer: Antoine Cellerier 

Add --enable-run-as-root option to configure.

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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c3f723fbac32a8b952995170a2befae150df90b8
---

 bin/vlc.c    |    2 ++
 configure.ac |   10 ++++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/bin/vlc.c b/bin/vlc.c
index 2ede943..7bc6cb3 100644
--- 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, "");
 
diff --git a/configure.ac b/configure.ac
index b36610d..82cf056 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1588,6 +1588,16 @@ if test "${enable_optimizations}" != "no"; then
 fi
 
 dnl
+dnl Allow runing as root (usefull for people runing on embedded platforms)
+dnl
+AC_ARG_ENABLE(run-as-root,
+[  --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
 AC_ARG_ENABLE(coverage,




More information about the vlc-devel mailing list