[KLUG Members] Linux compiling question

Adam Williams members@kalamazoolinux.org
29 Jan 2003 20:24:28 -0500


>When looking to compile Xine, in the FAQ's they offer this little item:
> ------------------------------------------------------------
> mkdir ~/usr
> mkdir ~/usr/src
> edit ~/.bashrc
> export path="$HOME/usr/bin:$path"
> export LD_LIBRARY_PATH="$HOME/usr/lib:$LD_LIBRARY_PATH"
> export CFLAGS="-I$HOME/usr/include -L$HOME/usr/lib -O3"
> export ACLOCAL_FLAGS="-I $HOME/usr/share/alocal"
> mkdir ~/usr/src
> cofigure --prefix=$HOME/usr
> make install
> --------------------------------------------------------------
> I understand that this setups a /usr type dir structure in someone's 

Yep.

> home directory and compiles the software.  

Looks to me like it sets it up to INSTALL and RUN it there.  Nothing
will stop you from building it there.

>What I don't understand is the danger in doing this and 

On a personal workstation there really is no "danger".  Its just kinda
like: "why?"  Just install into /usr/local, which is meant for local
packages (hence the name),  and thus anyone logging on to the
workstation can use the app; not just the dude/dudet that happened to
have it installed in the home directory.  Not to mention space if 4
people decide to install xine in their home directories.

The software could be potentially damaged/trojaned/wormed since it is
probably writable by all the daily apps you run - including Open Office,
Evolution, GNOME Meeting, etc...  Apps installed on 'the system' are
read/execute only - the binaries are safe (moderately) from user apps
wanting to twiddle with them.

If your not on a personal workstation with a local home directory you'll
most likely discover the administrator has done something like noexec or
some such trick to prevent you from running stuff from your home
directory.

>is theis the prefered method over becoming  superuser to do the same

You don't need to be superuser to build the package, just for the final
"make install" phase, then drop out of superuser.  Or grant a group like
"cis" the rights to poop in /usr/local and friends, then you can install
software without ever being root,  it can be a simple "newgrp cis;make
install;newgrp"

>process.  I guess really the questions I'm 
>really interested in are why, what benefit and pitfalls. 

The benefits seem NULL to me.  The pitfalls are potentially nasty. 
Except shell scripts during testing, you should never have write
permissions to an executable object - gee, some other platform does that
allot and....

>The wisdom of the KLUG would be highly valued.

Turning around and going back up my mountain now...

>Thanks and sorry if this is truely a stupid question to ask.

Not stupid at all.