I'm trying to craft a new root handle in a Debian distro and need to know where the source code for the su binary is located in order to move forward. Can anyone point me in the right direction?
Debian – Super User Binary Source for Debian Distro
binary filesdebianrootsource codesu
Related Solutions
See: update-alternatives
Also: Debian generally discourages developers relying on ENV variables, you have discovered one reason why.
Its not that they are taboo its just that they should not be expected to always be available.
Note: Adding your java path at the end of the existing path means that any other java will be found, and used, first.
(i.e. the (symlink) under /usr/bin )
so:
ls -lah /usr/bin/java
says:
lrwxrwxrwx 1 root root 22 Apr 22 2011 /usr/bin/java -> /etc/alternatives/java
file $(which java)
/usr/bin/java: symbolic link to `/etc/alternatives/java'
file /etc/alternatives/java
/etc/alternatives/java: symbolic link to `/usr/lib/jvm/java-6-openjdk-i386/jre/bin/java'
**<side issue> and also serves to demonstrate why $(exec in subshell style) is preferable, to "backtick exec mode" , or " eval this ".
(( as `` '' and "" gets way too confusing, for me at least, and doesn't always work as expected in all shells all of the time. Investigate POSIX mode AKA /bin/sh ))
</side issue>**
man update-alternatives
explains why this alternative system exists ...
meantime
update-alternatives --config java
may help.
/usr/local/ is a good place to install source built packages...
There are also other ways to skin your cat.
Including:
- hand re-pointing the /usr/bin/java link :)
(though watch out for upgrades or dependency installs resetting it.. not a great choice but it works)
setting an alias for java per user [1]
prepending $PATH in the users .bashrc
(you can source .bashrc from .bash_profile if you like)
- calling the specific versions full path per instance
(safest bet but probably not practical)
[1] .alias or .bashrc
help alias
(its a bash builtin)
Finally an example for good or ill: taken from my Debian .bash_profile...
# include .bashrc if it exists
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
PATH=~/bin:"${PATH}"
fi
Hope this helps rather than hinders
Pete
Best Answer
You can get any sources with two commands :
The first commands indicates which package su belongs to, the second get the sources and extract its tar file. (I have know a
util-linux-2.33.1
directory).