Starting vlc-0.9.0 as root

*nix specific usage questions

Starting vlc-0.9.0 as root

Postby Gujs on Fri Jul 18, 2008 2:26 pm

Hello,

Need some help with starting vlc with root user. I tried this:
Code: Select all
vlc -vvv
VLC is not supposed to be run as root. Sorry.
If you need to use real-time priorities and/or privileged TCP ports
you can use /usr/bin/vlc-wrapper (make sure it is Set-UID root first and
cannot be run by non-trusted users first).

And then I tried:
Code: Select all
vlc-wrapper -vvv
Cannot determine unprivileged user for VLC!

Can somebody help me enable root user to be able starting vlc.

Thanks,
Gregor
Gujs
Blank Cone
Blank Cone
 
Posts: 74
Joined: Fri Oct 22, 2004 7:28 pm

Re: Starting vlc-0.9.0 as root

Postby kmf31 on Fri Jul 18, 2008 8:36 pm

Why do you need to run vlc as root ?

Do you call vlc-wrapper as "root" or a simple "user" ? I think you should do the second and then vlc will have eventual root-priviliges (if you really need them and provided that vlc-wrapper is indeed setuid).
kmf31
Cone that earned his stripes
Cone that earned his stripes
 
Posts: 183
Joined: Sun Mar 11, 2007 10:47 pm

Re: Starting vlc-0.9.0 as root

Postby Gujs on Fri Jul 18, 2008 11:12 pm

Do you know how to setuid for starting vlc with vlc-wrapper?
Gujs
Blank Cone
Blank Cone
 
Posts: 74
Joined: Fri Oct 22, 2004 7:28 pm

Re: Starting vlc-0.9.0 as root

Postby silencer on Sat Jul 19, 2008 4:21 am

I would like to know it too.

I need to execute vlc as root because, well... I always use the root account (I know, I know, I shouldn't :))

greets! :)
silencer
silencer
New Cone
New Cone
 
Posts: 1
Joined: Sat Jul 19, 2008 4:08 am

Re: Starting vlc-0.9.0 as root

Postby Gujs on Mon Jul 21, 2008 9:44 am

For now I just compiled vlc with this code commented out from source in src/vlc.c file:

Code: Select all
/*   
if (geteuid () == 0)
    {
        fprintf (stderr, "VLC is not supposed to be run as root. Sorry.\n"
        "If you need to use real-time priorities and/or privileged TCP ports\n"
        "you can use %s-wrapper (make sure it is Set-UID root first and\n"
        "cannot be run by non-trusted users first).\n", ppsz_argv[0]);
        return 1;
    }
*/


This is just temporary solution until I find out how to use vlc-wrapper.

Regards,
Gregor
Gujs
Blank Cone
Blank Cone
 
Posts: 74
Joined: Fri Oct 22, 2004 7:28 pm

Re: Starting vlc-0.9.0 as root

Postby xtophe on Mon Jul 21, 2008 1:06 pm

for setuid, see the manual of chmod.

for the use of vlc-wrapper i think it's supposed to be used from sudo.
So as a normal user: sudo vlc-wrapper ....

if you launch it as root you can also try to use the VLC_USER environement variable

hth,
Xtophe
xtophe
Big Cone-huna
Big Cone-huna
 
Posts: 1123
Joined: Mon Nov 24, 2003 11:12 am
Location: Bristol, England

Re: Starting vlc-0.9.0 as root

Postby gjs278 on Fri Aug 01, 2008 7:34 am

This was a pretty stupid idea on VLC's part. I really don't care about the security risks of using a video player on my root account, if I want to. Feel free to warn me. I don't see any reason in preventing me from doing it though. Seriously, stick with making video players, preach to me later. Linux is supposed to be all about choice, and right now you've really limited me.
gjs278
New Cone
New Cone
 
Posts: 4
Joined: Fri Aug 01, 2008 7:31 am

Re: Starting vlc-0.9.0 as root

Postby Rémi Denis-Courmont on Sat Aug 02, 2008 7:20 pm

This was a pretty stupid idea on VLC's part.


The only stupid idea is yours.

Code: Select all
I really don't care about the security risks of using a video player on my root account,


Yeah, and we do care that our users do not expose themselves to needless security risks, and that they do not expose others as well. Without reckless users, we would not have botnets, you know. Besides, this is common industry practice (try to run Apache with "User root" for instance).
Rémi Denis-Courmont (Résumé)
Private support requests will be discarded.
Rémi Denis-Courmont
Developer
Developer
 
Posts: 2628
Joined: Mon Jun 07, 2004 4:01 pm
Location: Espoo, Finland

Re: Starting vlc-0.9.0 as root

Postby gjs278 on Tue Aug 05, 2008 4:26 am

Rémi Denis-Courmont wrote:Yeah, and we do care that our users do not expose themselves to needless security risks, and that they do not expose others as well. Without reckless users, we would not have botnets, you know. Besides, this is common industry practice (try to run Apache with "User root" for instance).

Then why do you allow this thread to even exist? A user clearly pointed out the code to remove to get rid of your "feature", wouldn't that be putting the precious users at risk!? Imagine all the vicious bits and bytes going through his and everyone who followed his directions computers. Please put a stop to this!

Your Apache example doesn't work that well, it chooses to WARN you instead of completely stopping you. It clearly tells you a way to get around the root warning.

"If you still desire to serve pages as root then\n\tadd -DBIG_SECURITY_HOLE to the CFLAGS env variable"

VLC just tells me "I'm sorry captain, that is against my directive." While I appreciate your concerns for my security, and understand the risks of running as a root account, I don't see why you have to block me from doing something when a warning would just be good enough. Any problems (there won't be any) that result after that you can just blame on me.
gjs278
New Cone
New Cone
 
Posts: 4
Joined: Fri Aug 01, 2008 7:31 am

Re: Starting vlc-0.9.0 as root

Postby j-b on Tue Aug 05, 2008 5:23 am

I don't like this thread, at all. I don't like the tone used here.

VLC must not be started as root for many reasons, security wise.

VLC hasn't had the same security audits that apache had. Therefore, as we don't want to be blame for those issues, we block the launch of VLC as root.
We are doing the support and this is difficult for us.

If you don't like this policy, then recompile your VLC to match this. If you don't like that this isn't mainline, then help us.

If you have a good reason to start VLC as root, I am all hears.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer and Sites administrator
If you want an answer to your question, just be specific and verbose. Don't PM.
j-b
Site Admin
Site Admin
 
Posts: 12671
Joined: Fri Jul 22, 2005 3:29 pm
Location: Cone, France

Re: Starting vlc-0.9.0 as root

Postby gjs278 on Tue Aug 05, 2008 11:13 am

j-b wrote:I don't like this thread, at all. I don't like the tone used here.

VLC must not be started as root for many reasons, security wise.

VLC hasn't had the same security audits that apache had. Therefore, as we don't want to be blame for those issues, we block the launch of VLC as root.
We are doing the support and this is difficult for us.

If you don't like this policy, then recompile your VLC to match this. If you don't like that this isn't mainline, then help us.

If you have a good reason to start VLC as root, I am all hears.

I have recompiled it and applied the changes. The only issue I have with that now is that VLC is out of my package manager and I won't receive updates, possibly important to security, in a timely fashion unless I manually check.

I'll be honest with you guys. It's a media player. I use it to play video formats that mplayer doesn't support right away and for streaming/dj purposes. I'm not running .m3u's filled with shellcode that'll cause buffer overflows that could potentially leave remote access to my pc even though that wouldn't get past the router firewall, I just want to play a couple of videos.

I appreciate your concern concerning me running my root account. It's a personal machine. I'm not running a server powering the user accounts for hundreds of web hosts, I'm just doing day to day stuff. I happen to dislike using sudo and having to type in my password every 30 minutes or whatever. I make system changes routinely and don't want to get stuck editing a file in the middle of vi only to find out I forgot to sudo it and will have to do that now.

Nobody goes on this machine but me. If a super exploit hits me through VLC, you guys can say I told you so. But so far, two years of running basically any application that I feel like under root has caused me no trouble. I have more than enough backups split across computers in my house to feel safe, and I would keep backing things up regardless if I'm root or a user account.

Would you guys block VLC from working on an administrator account in Windows? That's essentially what I'm doing on my machine. Of course you wouldn't. Basically all of your Window users are on admin accounts, that would be too unpopular. In that situation you could always tell the user to fix the code themselves, but this shouldn't be about only making options known to the knowledgeable. Someone who doesn't understand C code or compiling would be stuck right now in my situation.

At the least, there should be an opt-out for this "feature" short of recompiling the code.
gjs278
New Cone
New Cone
 
Posts: 4
Joined: Fri Aug 01, 2008 7:31 am

Re: Starting vlc-0.9.0 as root

Postby Rémi Denis-Courmont on Tue Aug 05, 2008 4:56 pm

We have been warning about not using root for several years. We meant it. Too many people have failed to take the warning into account, just because they could not be bothered to fix their configuration. If you need to access devices, put your non-privileged user into the right group. If you need to open files, fix the file or file systems permissions (you have root access anyway, right). If you need the HTTP, RTSP or HTTP/TLS port, use the vlc-wrapper. Same thing if you need real-time priorities (which probably do not work right anyway, except on OSX).

If VLC does not work as non-root, either your distro or your configuration is broken. Put the blame where it belongs. Not here.
Rémi Denis-Courmont (Résumé)
Private support requests will be discarded.
Rémi Denis-Courmont
Developer
Developer
 
Posts: 2628
Joined: Mon Jun 07, 2004 4:01 pm
Location: Espoo, Finland

Re: Starting vlc-0.9.0 as root

Postby j-b on Tue Aug 05, 2008 6:57 pm

gjs278 wrote:
j-b wrote:I don't like this thread, at all. I don't like the tone used here.

VLC must not be started as root for many reasons, security wise.

VLC hasn't had the same security audits that apache had. Therefore, as we don't want to be blame for those issues, we block the launch of VLC as root.
We are doing the support and this is difficult for us.

If you don't like this policy, then recompile your VLC to match this. If you don't like that this isn't mainline, then help us.

If you have a good reason to start VLC as root, I am all hears.

I have recompiled it and applied the changes. The only issue I have with that now is that VLC is out of my package manager and I won't receive updates, possibly important to security, in a timely fashion unless I manually check.

I'll be honest with you guys. It's a media player. I use it to play video formats that mplayer doesn't support right away and for streaming/dj purposes. I'm not running .m3u's filled with shellcode that'll cause buffer overflows that could potentially leave remote access to my pc even though that wouldn't get past the router firewall, I just want to play a couple of videos.

I appreciate your concern concerning me running my root account. It's a personal machine. I'm not running a server powering the user accounts for hundreds of web hosts, I'm just doing day to day stuff. I happen to dislike using sudo and having to type in my password every 30 minutes or whatever. I make system changes routinely and don't want to get stuck editing a file in the middle of vi only to find out I forgot to sudo it and will have to do that now.

Nobody goes on this machine but me. If a super exploit hits me through VLC, you guys can say I told you so. But so far, two years of running basically any application that I feel like under root has caused me no trouble. I have more than enough backups split across computers in my house to feel safe, and I would keep backing things up regardless if I'm root or a user account.

Would you guys block VLC from working on an administrator account in Windows? That's essentially what I'm doing on my machine. Of course you wouldn't. Basically all of your Window users are on admin accounts, that would be too unpopular. In that situation you could always tell the user to fix the code themselves, but this shouldn't be about only making options known to the knowledgeable. Someone who doesn't understand C code or compiling would be stuck right now in my situation.

At the least, there should be an opt-out for this "feature" short of recompiling the code.


You didn't answer why you need VLC as root...

Moreover, VLC is not 'just a media player', it is a network stream player, a server, a streamer and a transcoder and therefore dangerous for your security.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer and Sites administrator
If you want an answer to your question, just be specific and verbose. Don't PM.
j-b
Site Admin
Site Admin
 
Posts: 12671
Joined: Fri Jul 22, 2005 3:29 pm
Location: Cone, France

Re: Starting vlc-0.9.0 as root

Postby gjs278 on Wed Aug 06, 2008 1:45 am

Rémi Denis-Courmont wrote:If VLC does not work as non-root, either your distro or your configuration is broken. Put the blame where it belongs. Not here.

That's not a problem at all for me. In fact, VLC would work perfectly on a user account. Except when I turn on my machine, I login to the root account. VLC would work just as well under the root account as a user account, except a slight "feature" is interfering.

j-b wrote:You didn't answer why you need VLC as root...

Moreover, VLC is not 'just a media player', it is a network stream player, a server, a streamer and a transcoder and therefore dangerous for your security.

I need VLC as root because I login to X as root. I do all of my work as root. I enjoy never having to see the words "permission denied."
gjs278
New Cone
New Cone
 
Posts: 4
Joined: Fri Aug 01, 2008 7:31 am

Re: Starting vlc-0.9.0 as root

Postby CraigG4C on Sun Aug 10, 2008 5:38 pm

You didn't answer why you need VLC as root...

Moreover, VLC is not 'just a media player', it is a network stream player, a server, a streamer and a transcoder and therefore dangerous for your security.


I also habitually run as root. I smoke and drink, too.

Look, we are the ones taking the risk. We understand the risk. We have decided to accept that risk, for whatever reason, on our particular machines. We are not doing it on an enterprise-mission-critical cluster of a dozen Xeons. It is our risk to take. We cheerfully and joyfully absolve you of any and all responsibility whatever when our machine is taken over by terrorists.

Thank you for the info. I promise that my patched version will live only, only, only on my little machine.

Here's my patch:

--- vlc-0.9.0-test3/src/vlc.c.orig 2008-08-03 15:21:35.000000000 -0400
+++ vlc-0.9.0-test3/src/vlc.c 2008-08-10 13:46:13.000000000 -0400
@@ -51,7 +51,8 @@
{
int i_ret;

- if (geteuid () == 0)
+#warning This version hacked to allow running by root, posing potentially severe security risks.
+ if (0 && (geteuid () == 0))
{
fprintf (stderr, "VLC is not supposed to be run as root. Sorry.\n"
"If you need to use real-time priorities and/or privileged TCP ports\n"
CraigG4C
New Cone
New Cone
 
Posts: 1
Joined: Sun Aug 10, 2008 4:47 pm

Next

Return to VLC media player for Linux and friends Troubleshooting

Who is online

Users browsing this forum: moviemaniac and 5 guests