Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 56014 - /etc/asound.state overwritten even if chmod -w'd
Summary: /etc/asound.state overwritten even if chmod -w'd
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Sound Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-03 19:50 UTC by derf
Modified: 2004-07-06 16:08 UTC (History)
0 users

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 derf 2004-07-03 19:50:27 UTC
In /etc/init.d/alsasound, the lines

                if [ -w $asoundcfg -o ! -e $asoundcfg ] ; then
                        $alsactl -f $asoundcfg store

appear to provide the option of only storing the current mixer settings if the $asoundcfg file is writable (or has not yet been created). However, since the script is run as root, the -w check succeeds even if $asoundcfg (/etc/asound.state) is set chmod 444.

As a work-around I've changed the check to -x and simply not made the file executable, but this is an obvious abuse of the executable bit.

Reproducible: Always
Steps to Reproduce:
1. chmod 444 /etc/asound.state
2. /etc/init.d/alsasound stop

Actual Results:  
The mixer levels were actually stored, overwriting the read-only
/etc/asound.state file.

Expected Results:  
The message "Storing ALSA Mixer Levels... Skipping" should have been displayed,
and the /etc/asound.state file should have been left untouched.
Comment 1 Jeremy Huddleston (RETIRED) gentoo-dev 2004-07-06 16:08:01 UTC
this is not a bug.