Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get ympd to run under unprivileged user #12

Closed
realG opened this issue Apr 23, 2014 · 4 comments
Closed

Cannot get ympd to run under unprivileged user #12

realG opened this issue Apr 23, 2014 · 4 comments

Comments

@realG
Copy link

realG commented Apr 23, 2014

Hi. First off, let me say your web gui is killer, beautiful design and great layout!

I've got it running on Raspbian, but cannot seem to get it to run under an unprivileged user. Under root it works great

$ sudo ./ympd --webport 80
MPD Connecting to 127.0.0.1:6600
MPD connected.

but sudo ./ympd --user pi --webport 80 produces no output on the command line. I can see the process is created

$ ps aux | grep ympd
pi 5697 79.8  0.1   2940   796 ?        R    00:45   1:01 /usr/bin/ympd --user pi --webport 80

but the web interface is not reachable. Am I doing something dumb? Any help is greatly appreciated!

@ajs124
Copy link
Contributor

ajs124 commented Apr 23, 2014

This is not a problem with ympd. You just can't bind to such low ports as an unprivileged user. I didn't verify it, but if I recally correctly it's nothing below 1024.

@realG
Copy link
Author

realG commented Apr 23, 2014

Ah, so I was indeed being dumb. Changed to -webport 8080 and works like a charm. Thanks!

@realG realG closed this as completed Apr 23, 2014
@notandy notandy reopened this Apr 23, 2014
@notandy
Copy link
Owner

notandy commented Apr 23, 2014

Hi, indeed as user you cannot bind to ports below 1024. But especially for that case I added the "drop privileges" feature, so ympd acquires the port as root and does setuid(user) to drop priviliges. sudo ./ympd --user pi --webport 80 should work.
I tested it, but it doesn't work :-(

Funny, this works for me:

sudo ./ympd --webport 80 --user pi

@realG could you test this?

I will investigate this bug, the order of the options should not affect anything.

@realG
Copy link
Author

realG commented Apr 23, 2014

Yup, same for me, sudo ./ympd --webport 80 --user pi works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants