From owner-freebsd-questions@FreeBSD.ORG Thu Nov 1 18:49:47 2007 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 DD7D616A419 for ; Thu, 1 Nov 2007 18:49:47 +0000 (UTC) (envelope-from phatbuckett@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.182]) by mx1.freebsd.org (Postfix) with ESMTP id 929B013C49D for ; Thu, 1 Nov 2007 18:49:47 +0000 (UTC) (envelope-from phatbuckett@gmail.com) Received: by wa-out-1112.google.com with SMTP id k17so733210waf for ; Thu, 01 Nov 2007 11:49:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=t73Somah2G/Ncymg5e06gHYLEn96vh7W+TNZuLqojaY=; b=Rr/+LoSxJCV3qS00aUtWwYe5sH2XYEzlcedpU3TEN6QKxF5qmJz5dA5qLywfCmWYNY/phvlqzllMREwzMwM7YqunyTTMWDf7mtbDBv+oTPAraOXKdHmAjF1U2dq5bdb3fGcBuP08Nlt3qWX59PkX/VR51kugoYXoMWRAMjmBNzI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=YyTSNtjhDTaJ4IA1cIR+x9xuEXK18NbHuNUPGQ6HuR+L7cSxPTjWj1vehB99ezkWGs71RbnAKz7EFpt2nvgR95i4a8F55FYMlu7i3m4GHQH2gY1hBtnrFAj9x7b1FVHcToF84G4TawjdgvPZa6GWrRPdUc3uc8DXHzy0mhRFvIg= Received: by 10.115.88.1 with SMTP id q1mr884749wal.1193939580368; Thu, 01 Nov 2007 10:53:00 -0700 (PDT) Received: by 10.114.153.20 with HTTP; Thu, 1 Nov 2007 10:53:00 -0700 (PDT) Message-ID: <839aec700711011053i3b4d7c7dmbbd5afde03ba513a@mail.gmail.com> Date: Thu, 1 Nov 2007 10:53:00 -0700 From: "Darren Spruell" To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Set perms on attach of USB umass disk 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: Thu, 01 Nov 2007 18:49:47 -0000 I've been trying (and failing) to figure out how to adjust ownership or permissions of a USB memory stick on device attach. umass0: SanDisk Corporation Cruzer Mini, rev 2.00/0.20, addr 5 da0 at umass-sim0 bus 0 target 0 lun 0 da0: Removable Direct Access SCSI-2 device da0: 1.000MB/s transfers da0: 977MB (2001888 512 byte sectors: 64H 32S/T 977C) $ usbdevs -v Controller /dev/usb0: addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel(0x0000), rev 1.00 port 1 addr 2: full speed, power 100 mA, config 1, Dell USB Keyboard Hub(0x1004), Dell(0x413c), rev 48.01 port 1 addr 3: low speed, power 90 mA, config 1, Dell USB Keyboard Hub(0x2006), Dell(0x413c), rev 48.00 port 2 addr 5: full speed, power 100 mA, config 1, Cruzer Mini(0x5150), SanDisk Corporation(0x0781), rev 0.20 I've tried altering devfs.conf but this appears to only work for devices that are attached at startup of devfs. I've tried configuring devd(8): attach 100 { device-name "da[0-9]+s1"; action "/bin/chmod 0660 $device-name"; }; attach 100 { device-name "da[0-9]+"; action "/bin/chmod 0660 $device-name"; }; Neither of these seem to result in the permission change I'm after (making device writable by my user which is in the operator group): $ ls -l /dev/da0* crw-r----- 1 root operator 0, 165 Oct 21 13:08 /dev/da0 crw-r----- 1 root operator 0, 166 Oct 21 13:08 /dev/da0s1 What's the right way to handle this? -- Darren Spruell phatbuckett@gmail.com