From owner-freebsd-usb@FreeBSD.ORG Tue Feb 24 21:47:23 2015 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67D299D0 for ; Tue, 24 Feb 2015 21:47:23 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48FECD0D for ; Tue, 24 Feb 2015 21:47:23 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t1OLlNpt042198 for ; Tue, 24 Feb 2015 21:47:23 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-usb@FreeBSD.org Subject: [Bug 198015] devd(8) overwrites "bus" on ugen event Date: Tue, 24 Feb 2015 21:47:23 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: 10.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: johan@stromnet.se X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-usb@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2015 21:47:23 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198015 Bug ID: 198015 Summary: devd(8) overwrites "bus" on ugen event Product: Base System Version: 10.1-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: usb Assignee: freebsd-usb@FreeBSD.org Reporter: johan@stromnet.se Problem: When trying to match a uftdi device arrival, "bus" variable is overwritten. This means I cannot know which /dev/ugenN.N node to work with (which in my case is chown to a specific user). Example: (FreeBSD 10.1, devd in console mode): Sample devd script: attach 10 { device-name "uftdi[0-9]+"; action "chgrp dialer /dev/ugen$bus.$devaddr; chmod 660 /dev/ugen$bus.$devaddr" }; Processing event '+uftdi0 at bus=0 hubaddr=1 port=3 devaddr=2 interface=0 vendor=0x1781 product=0x0c30 devclass=0x00 devsubclass=0x00 sernum="XXXXXX" release=0x0600 mode=host intclass=0xff intsubclass=0xff intprotocol=0xff ttyname=U0 ttyports=1 on uhub1' Pushing table setting device-name=uftdi0 setting bus=0 setting hubaddr=1 setting port=3 setting devaddr=2 setting interface=0 setting vendor=0x1781 setting product=0x0c30 setting devclass=0x00 setting devsubclass=0x00 setting sernum=A6008W8a setting release=0x0600 setting mode=host setting intclass=0xff setting intsubclass=0xff setting intprotocol=0xff setting ttyname=U0 setting ttyports=1 setting bus=uhub1 Processing attach event Testing device-name=uftdi0 against ^ed50$, invert=0 Testing device-name=uftdi0 against ^ubt[0-9]+$, invert=0 Testing device-name=uftdi0 against ^ukbd0$, invert=0 Testing vendor=0x1781 against ^0x0854$, invert=0 Testing vendor=0x1781 against ^0x1645$, invert=0 Testing device-name=uftdi0 against ^uftdi[0-9]+$, invert=0 Testing vendor=0x1781 against ^0x0403$, invert=0 Testing device-name=uftdi0 against ^uftdi[0-9]+$, invert=0 Testing vendor=0x1781 against ^0x1781$, invert=0 Testing product=0x0c30 against ^0x0c30$, invert=0 Executing 'chgrp dialer /dev/ugenuhub1.2; chmod 660 /dev/ugenuhub1.2' chgrp: /dev/ugenuhub1.2: No such file or directory chmod: /dev/ugenuhub1.2: No such file or directory Popping table My suspect: https://github.com/freebsd/freebsd/blob/master/sbin/devd/devd.cc#L821 Is there any other way to reliably get the corresponding ugen device? -- You are receiving this mail because: You are the assignee for the bug.