Accessing devices as non-root user

From: Andreas Höschler (ahoesch@smartsoft.de)
Date: Thu May 31 2007 - 04:33:59 EDT


Dear managers,

> we have an application (running on Solaris 10) that accesses sound and
> serial devices. The application works when run as root, but is not able
> to access (/dev/audio, /dev/term/0,...) when run as a normal user.
>
> audioCtlDevice = open ("/dev/audioctl", O_RDWR);
> if (audioCtlDevice < 0) { NSLog(@"Error: open() returned %d;
> errno %d", audioCtlDevice, errno); return 0; }
>
> 2007-05-22 11:57:15.084 AudioPlayTest[21626] Error: open() returned -1;
> errno 2
>
> I suppose this is a general issue. What do we have to do to give
> non-root users access to devices?

It has been recommended (I unfortuantely lost the mail header and don't
know who wrot ethis mail; thanks anyway) to check
http://blogs.sun.com/jg and also have a look into update_drv. I
modified the entry in /etc/minor_perm from "audio:* 0600 root sys" to

        audio:* 0666 root sys

and ran "devfsadm -c audio". I also tried "update_drv" which just gave
me a list of options. "update_drv -v audio" gave me

-bash-3.00# update_drv -v audio
Failed to update audio.conf for driver.

and I can still not access /dev/audio when the app is run as a normal
user (it works when run as root).

        /Build/AudioPlayTest/obj/AudioPlayTest

2007-05-31 10:29:08.177 AudioPlayTest[26025] Error: open() returned -1;
errno 13

I am stuck! Any idea?

Thanks a lot!

Regards,

   Andraes
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:42:01 EDT