LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   changing file ownership /dev/dsp (doesnt work..) (https://www.linuxquestions.org/questions/linux-general-1/changing-file-ownership-dev-dsp-doesnt-work-154829/)

icehenge 03-07-2004 11:01 PM

changing file ownership /dev/dsp (doesnt work..)
 
HI,
I've got my sound working but it only works when I'm logged in as root and start xwindows(KDE3)

There was a recommendation to change the dsp sound device to a 'audio' group
and then let users be members of that group to simplify administration and security.

So i created the group audio
added my user to that group
Then...
I changed the /dev/dsp to belong to the audio group

'bash-2.05a$ ls -l dsp
crwxrwx--- 1 1002 audio 14, 3 Jul 18 1994 dsp'

But when i login as my user that is under the audio group i still
get the same dern error message!

"device /dev/dsp can't be opened permission denied.

If i'm logged in as root I don't get this and the sound very well :)
What i'm i missing?

Alex

Oliv' 03-08-2004 08:17 AM

When you are logged as user and type "groups", does the output shows you audio group???

icehenge 03-08-2004 01:59 PM

Hmmm. Interesting command, thanks. Good thinking it doesn't show audio as one of my
groups, which is strange.

'bash-2.05a$ groups
users
bash-2.05a$'

I used the utlitiy called 'KDE User management' in KDE3 to create the audio group
and to add my user to that group. I went and checked again and my users is
in the audio group but it says "primary group = users " I wonder if that is causing
a problem, or maybe it is because I used the KDE user management and it didnt
work right. Here is the groups file from the system, (edited)

root::0:root
sys::3:root,bin,adm
adm::4:root,adm,daemon
tty::5:
disk::6:root,adm
lwheel::10:root
gdm::42:
nobody::98:nobody
nogroup::99:
users::100:icy
console:x:101:
audio:*:1001:icy

ProtoformX 03-08-2004 03:53 PM

Why not just do this as root

chmod a+rw /dev/dsp /dev/mixer /dev/midi /dev/sequencer

now all sound works no matter what user you are.

icehenge 03-08-2004 11:07 PM

chmod a+rw /dev/dsp
Works but i'd still like to figure out why its not working unless my user icy has
permissions outside of him being in group audio which has permission also.

Also i've remove the read write permission for ALL to dsp making
crwxrwx--- 1 1002 users 14, 3 Jul 18 1994 dsp
And then I changed did chgrp on dsp
'chgrp users dsp'
And then my user could access /dev/dsp because he is a member of the
users group.

Anyone have an idea why my 'audio' group which owned /dev/dsp
at one time doesn't work. The user icy was a member of the audio group.

Alex

Oliv' 03-10-2004 08:59 AM

Hi icehenge,

It's normal if you can't access /dev/dsp... Nonetheless everything is well configured ;). In fact when you try to access /dev/dsp it's with GID 100 (users one) if you don't believe me type:
Code:

[olivier@Olinux-lfs ~]$ id
uid=1000(olivier) gid=100(users) groups=100(users),11(audio)

you'll see that you belong to users and audio group but that's users id which is in use. And you can't belong to two groups at the same time because you can't have 2 different GID at the same time. So to change group type:
Code:

[olivier@Olinux-lfs ~]$ newgrp audio
[olivier@Olinux-lfs ~]$ id
uid=1000(olivier) gid=11(audio) groups=100(users),11(audio)

And you now belong to audio group so you can access /dev/dsp :) The annoying thing with this method is for users who hate text mode and only use graphical mode to run applications. As a matter of fact, when you start your application from your menu, default GID will be used. So you'll have to modify the way to start audio applications...
Of course there's another solution :p a bit less secure, but it's a good alternative. Edit /etc/login.defs file and enable this option:
Code:

# Use with caution - it is possible for users to gain permanent
# access to these groups, even when not logged in on the console.
# How to do it is left as an exercise for the reader...
#
CONSOLE_GROUPS        audio

I've never tested it but I think this'll work ;)
A last advice, have a look at gpasswd command (and his man page)... It may be very helpful, to set or not passord for groups...

Oliv'

icehenge 03-11-2004 01:29 AM

Oliv'
Thank you! That was exactly the type of explanation I was looking for on why my group audio
was not working.

I haven't tried the 'newgrp audio' command but it sounds like a more secure but
tiresome route to follow.

My slackware system is only used for home use. The only service I plan
to run is SSH and this system is located behind a hardware firewall so I
'suppose' its less likely to be targeted and attacked but I love security so
thats why i'm going through all this trouble :)

How do you have the audio setup on your system?
Alex

Oliv' 03-11-2004 05:43 AM

I forgot to tell you one command, that's:
Code:

sg audio -c command
On my system, it's a very simple config as I use XFCE4, I just have to go on my xmms icon for example, right-click, then properties and instead of running xmms, I run gs audio -c xmmms ;) I have also disabled password, bec' I don't want to run my command in terminal to enter password :p
Another reason is that the more secure a system is, the less friendly user it is ;) For example, have a look at IPCOP distro, that's very secure(even if they can do better), but you don't have compiler or other usefull things;)
Hope this help you

Oliv'

icehenge 03-12-2004 08:48 PM

Oliv'
Thanks for the help, I'm just starting using linux and your assistance along with everyone
else on this board is greatly appreciated. Without this type of assistance some troubles
might have gotten the better of me. Be well.
Alex


All times are GMT -5. The time now is 09:11 AM.