rake-compiler / rake-compiler-dock

Easy to use and reliable cross compiler environment for building Windows, Linux, Mac and JRuby binary gems.
MIT License
78 stars 30 forks source link

rake-compiler-dock doesn't work as root #10

Closed nicolasnoble closed 7 years ago

nicolasnoble commented 8 years ago
pixel@grumpy:~$ rake-compiler-dock
pixel@02b64d8988dd:/home/pixel$ exit
pixel@grumpy:~$ sudo rake-compiler-dock
[sudo] password for pixel:
groupadd: GID '0' already exists
useradd: UID 0 is not unique
ln: failed to create symbolic link '~pixel/.rake-compiler': No such file or directory
sudo: unknown user: pixel
sudo: unable to initialize policy plugin

The runas script fails to check if we aren't running it as root already.

larskanis commented 8 years ago

I never had a reason to use rake-compiler-dock as root. But I'll check this.

nicolasnoble commented 8 years ago

I agree it's kind of rare - I figured I'd report this as I noticed the problem :)

nicolasnoble commented 8 years ago

Which also means we can't use any of the system users that already exist in the docker image:

pixel@grumpy:~$ sudo -s -H -u www-data
www-data@grumpy:/home/pixel$ rake-compiler-dock
groupadd: GID '33' already exists
useradd: UID 33 is not unique
ln: failed to create symbolic link '~pixel/.rake-compiler': No such file or directory
sudo: unknown user: pixel
sudo: unable to initialize policy plugin
www-data@grumpy:/home/pixel$

(not that it'd be a good idea to do that from www-data, I agree... but... ;-) )