From owner-freebsd-questions@FreeBSD.ORG Tue Dec 6 16:12:27 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E16A106564A for ; Tue, 6 Dec 2011 16:12:27 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) by mx1.freebsd.org (Postfix) with ESMTP id CAE2D8FC12 for ; Tue, 6 Dec 2011 16:12:26 +0000 (UTC) Received: from pps.filterd (ltcfislmsgpa07 [127.0.0.1]) by ltcfislmsgpa07.fnfis.com (8.14.4/8.14.4) with SMTP id pB6FUJke021505; Tue, 6 Dec 2011 10:12:25 -0600 Received: from smtp.fisglobal.com ([10.132.206.17]) by ltcfislmsgpa07.fnfis.com with ESMTP id 11hnrar67k-53 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Tue, 06 Dec 2011 10:12:25 -0600 Received: from dtwin (10.14.152.48) by smtp.fisglobal.com (10.132.206.17) with Microsoft SMTP Server (TLS) id 14.1.323.3; Tue, 6 Dec 2011 10:11:55 -0600 From: Devin Teske To: "'Arthur Chance'" , "'Ronald F. Guilmette'" References: <66927.1323170567@tristatelogic.com> <4EDE00CD.6070507@qeng-ho.org> In-Reply-To: <4EDE00CD.6070507@qeng-ho.org> Date: Tue, 6 Dec 2011 08:12:00 -0800 Message-ID: <04d201ccb431$c9e46f10$5dad4d30$@fisglobal.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQJbTDqwVFQQe8XRh5ICyJSGYpzQ+ALMJDFDlJtmnPA= Content-Language: en-us X-Originating-IP: [10.14.152.48] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.5.7110, 1.0.211, 0.0.0000 definitions=2011-12-06_04:2011-12-06, 2011-12-06, 1970-01-01 signatures=0 Cc: freebsd-questions@freebsd.org, devin.teske@fisglobal.com Subject: RE: drivin' me nuts: permissions and cdda2wav X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2011 16:12:27 -0000 > -----Original Message----- > From: owner-freebsd-questions@freebsd.org [mailto:owner-freebsd- > questions@freebsd.org] On Behalf Of Arthur Chance > Sent: Tuesday, December 06, 2011 3:47 AM > To: Ronald F. Guilmette > Cc: freebsd-questions@freebsd.org > Subject: Re: drivin' me nuts: permissions and cdda2wav > > On 12/06/11 11:22, Ronald F. Guilmette wrote: > > With a pre-recorded CD in the drive, the following works fine for me > > when I'm root: > > > > cdda2wav -D 0,0,0 -B > > > > My question is: What do I need to do in order to make this work also > > when executed from a non-root account? > > > > Here's what I get when I try to do the above from a non-root account: > > > > cdda2wav: Permission denied. Cannot open or use SCSI driver. > > cdda2wav: For possible targets try 'cdda2wav -scanbus'. Make sure you are > root. > > Probably you did not define your SCSI device. > > Set the CDDA_DEVICE environment variable or use the -D option. > > You can also define the default device in the Makefile. > > For possible transport specifiers try 'cdda2wav dev=help'. > > > > Effing hell! I've tried just about everything I can think of off the > > top of my head to beat this and nothing works. I've tried chmod 0660 > > /dev/pass* (and yes, the account I'm trying these experiments from > > _is_ a member of the `operator' group), but that didn't help a bit. > > > > And before anybody asks, let me say that yes, I _do_ have: > > > > atapicam_load="YES" > > > > in my /boot/loader.conf file. > > > > So how exactly does one adjust the permissions on one of these > > atamicam pseudo-SCSI devices. Where are they underneath /dev ? > > Please excuse my ignorance, but I just don't know. > > > > <> > > I've just been through the same experience getting cdparanoia to work for a non- > root user under REL 8.2p4. Note that I have the ahci module loaded so my cd is > /dev/cd0. > > You need write access to /dev/cd0 plus the corresponding /dev/passN (use > camcontrol devlist to find out which) *and* /dev/xpt0. > > From my /etc/devfs.conf > > own cd0 root:operator > perm cd0 0660 > link cd0 cdrom > perm xpt0 0660 > perm pass5 0660 > An alternative approach would be to create files in /etc/devd For example, creating the configuration file "/etc/devd/mydevice.conf" with the following contents: notify 100 { match "system" "DEVFS"; match "subsystem" "CDEV"; match "cdev" "pass[0-9]"; match "type" "CREATE"; action "/bin/chmod 666 /dev/$cdev"; }; Will cause the system to execute the associated-action whenever /dev/pass[0-9] is created in realtime by devd. A really cute way to log devfs activity is to create /etc/devd/logger.conf with these contents: notify 100 { action "logger DEVD ACTIVITY LOGGER"; action "logger bus == $bus"; action "logger cdev == $cdev"; action "logger cisproduct == $cisproduct"; action "logger cisvendor == $cisvendor"; action "logger class == $class"; action "logger device == $device"; action "logger devclass == $devclass"; action "logger device-name == $device-name"; action "logger endpoints == $endpoints"; action "logger function == $function"; action "logger interface == $interface"; action "logger intclass == $intclass"; action "logger intprotocol == $intprotocol"; action "logger intsubclass == $intsubclass"; action "logger manufacturer == $manufacturer"; action "logger mode == $mode"; action "logger notify == $notify"; action "logger parent == $parent"; action "logger port == $port"; action "logger product == $product"; action "logger release == $release"; action "logger serial == $serial"; action "logger slot == $slot"; action "logger subvendor == $subvendor"; action "logger subdevice == $subdevice"; action "logger subsystem == $subsystem"; action "logger system == $system"; action "logger type == $type"; action "logger vendor == $vendor"; }; Once the above file is installed, just bounce the devd process and now whenever a device is created or destroyed (for example, when performing "camcontrol rescan all" or plugging/un-plugging USB devices), /var/log/messages will show you all the criteria that you can match-against for your given device. -- Devin > > This is the relevant part my machine's /dev. I'm in operator group. > > arthur@fileserver> ls -l /dev/{cd,pass,xpt}* > crw-rw---- 1 root operator 0, 97 Nov 23 16:24 /dev/cd0 > lrwxr-xr-x 1 root wheel 3 Dec 2 16:08 /dev/cdrom -> cd0 > crw------- 1 root operator 0, 91 Nov 23 16:24 /dev/pass0 > crw------- 1 root operator 0, 92 Nov 23 16:24 /dev/pass1 > crw------- 1 root operator 0, 93 Nov 23 16:24 /dev/pass2 > crw------- 1 root operator 0, 94 Nov 23 16:24 /dev/pass3 > crw------- 1 root operator 0, 95 Nov 23 16:24 /dev/pass4 > crw-rw---- 1 root operator 0, 96 Nov 23 16:24 /dev/pass5 > crw------- 1 root operator 0, 113 Nov 23 16:24 /dev/pass6 > crw------- 1 root operator 0, 115 Nov 23 16:24 /dev/pass7 > crw------- 1 root operator 0, 116 Nov 23 16:24 /dev/pass8 > crw------- 1 root operator 0, 118 Nov 23 16:24 /dev/pass9 > crw-rw---- 1 root operator 0, 61 Nov 23 16:24 /dev/xpt0 > > > And how to find which /dev/passN corresponds to the cd drive: > > arthur@fileserver> camcontrol devlist | grep cd > at scbus7 target 0 lun 0 (cd0,pass5) > > > > > All I really wanted to do is to rip an "E"CD (enhanced CD) that I own, > > using abcde. I found out that cdparanoia chokes on the ECD, so I'm > > trying to figure out how to make abcde work with cdda2wav, but it > > apparently isn't at all easy. (Any hints or advice welcomed.) > > > > Oh! And by the way, this causes a segfault and a core dump: > > > > cdda2wav -D /dev/acd0 -B > > > > I'll have to send in a PR on that, I guess, but it is rather stunning > > to me that nobody even tested for that. > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" _____________ The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.