Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 231578 - app-eselect/eselect-esd - eselect modules do not check for valid targets before setting symlink
Summary: app-eselect/eselect-esd - eselect modules do not check for valid targets befo...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Sound Team
URL:
Whiteboard: Pending removal: 2015-12-09
Keywords: PMASKED
Depends on:
Blocks:
 
Reported: 2008-07-12 11:52 UTC by Jacob Godserv
Modified: 2015-12-31 12:14 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jacob Godserv 2008-07-12 11:52:48 UTC
If I run "eselect esd set pulseaudio" the symlink created is not pointing to the right location. If I run "eselect esd set 2" (with 2 being the number for PulseAudio) it will point to the right binary.

jacob@jacob-gdesktop ~ $ sudo eselect esd set pulseaudio
jacob@jacob-gdesktop ~ $ ls -l /usr/bin/esd 
lrwxrwxrwx 1 root root 19 Jul 12 07:45 /usr/bin/esd -> /usr/bin/pulseaudio
jacob@jacob-gdesktop ~ $ sudo eselect esd set 2         
jacob@jacob-gdesktop ~ $ ls -l /usr/bin/esd
lrwxrwxrwx 1 root root 18 Jul 12 07:45 /usr/bin/esd -> /usr/bin/esdcompat
jacob@jacob-gdesktop ~ $ eselect esd list 
Available ESounD implementations:
  [1]   ESounD original
  [2]   PulseAudio *

Reproducible: Always

Steps to Reproduce:
1. Run "eselect esd set pulseaudio".
Actual Results:  
Links "/usr/bin/esd" to "/usr/bin/pulseaudio", which is the wrong binary.

Expected Results:  
Link "/usr/bin/esd" to "/usr/bin/esdcompat".

The problem appears to be within /usr/share/eselect/modules/esd.eselect specifically. I can't seem to identify the solution or I'd have submitted a patch, but the problem seems to be in set_symlink(), lines 34 through 37:

        if [[ -f "${ROOT}/usr/bin/${target}" ]] ; then
                remove_symlink
                ln -s "${ROOT}/usr/bin/${target}" "${ROOT}/usr/bin/esd" || \
                        die "Couldn't set ${target} symlink"
Comment 1 Dan Wallis 2008-07-12 16:16:23 UTC
Actually, this seems to be a more serious problem:

tui ~ # eselect esd list 
Available ESounD implementations:
  [1]   ESounD original *
tui ~ # eselect esd set zip 
tui ~ # ls -l /usr/bin/esd 
lrwxrwxrwx 1 root root 12 Jul 12 17:11 /usr/bin/esd -> /usr/bin/zip
tui ~ # eselect esd set zgrep 
tui ~ # ls -l /usr/bin/esd 
lrwxrwxrwx 1 root root 14 Jul 12 17:13 /usr/bin/esd -> /usr/bin/zgrep
tui ~ # eselect esd set diff  
tui ~ # ls -l /usr/bin/esd 
lrwxrwxrwx 1 root root 13 Jul 12 17:13 /usr/bin/esd -> /usr/bin/diff
tui ~ # eselect esd set 1    
tui ~ # ls -l /usr/bin/esd 
lrwxrwxrwx 1 root root 19 Jul 12 17:13 /usr/bin/esd -> /usr/bin/esound-esd
tui ~ # eselect esd list 
Available ESounD implementations:
  [1]   ESounD original *
tui ~ # 


From what I can tell, if you specify a number, it's checked against the valid available targets and mapped to the correct name, however specifying a name is used directly. I'll do some investigation to see how the other eselect scripts overcome this, of if it's a more global problem.
Comment 2 Dan Wallis 2008-07-12 16:18:46 UTC
The vi module seems to have this problem too:

tui ~ # eselect vi list 
Available vi implementations:
  [1]   vim *
  [2]   gvim
tui ~ # eselect vi set zip 
tui ~ # ls -l /usr/bin/vi 
lrwxrwxrwx 1 root root 12 Jul 12 17:17 /usr/bin/vi -> /usr/bin/zip
tui ~ # eselect vi set diff 
tui ~ # ls -l /usr/bin/vi 
lrwxrwxrwx 1 root root 13 Jul 12 17:17 /usr/bin/vi -> /usr/bin/diff
tui ~ # eselect vi set 2    
tui ~ # ls -l /usr/bin/vi 
lrwxrwxrwx 1 root root 13 Jul 12 17:18 /usr/bin/vi -> /usr/bin/gvim
tui ~ # eselect vi set 1
tui ~ # ls -l /usr/bin/vi 
lrwxrwxrwx 1 root root 12 Jul 12 17:18 /usr/bin/vi -> /usr/bin/vim
tui ~ # eselect vi list 
Available vi implementations:
  [1]   vim *
  [2]   gvim
tui ~ # 
Comment 3 Dan Wallis 2008-07-12 16:25:27 UTC
I don't seem to be able to change the summary of this bug to:
"eselect modules do not check for valid targets before setting symlink"
Comment 4 Jacob Godserv 2010-04-13 16:50:49 UTC
Sorry for the very long delay. Description changed.
Comment 5 Jacob Godserv 2010-04-13 16:51:14 UTC
This should be reassigned to the eselect team, too, if there is one.
Comment 6 Pacho Ramos gentoo-dev 2015-06-02 11:03:49 UTC
this should be completely obsolete now
Comment 7 Dan Wallis 2015-11-11 08:22:26 UTC
Please don't close this bug when app-eselect/eselect-esd is removed from the tree, as this bug affects all eselect modules and isn't specific to just eselect-esd. See comment #1, for example.
Comment 8 Pacho Ramos gentoo-dev 2015-12-31 12:14:24 UTC
removed (open a clear new bug for the concrete failing modules please)