From mboxrd@z Thu Jan 1 00:00:00 1970 From: martin f krafft Date: Tue, 21 Dec 2004 15:38:44 +0000 Subject: Re: feature request (if possible): symlink name in environment Message-Id: <20041221153844.GA16095@cirrus.madduck.net> MIME-Version: 1 Content-Type: multipart/mixed; boundary="rS8CxjVDS/+yyDmU" List-Id: References: <20041221150258.GB14897@cirrus.madduck.net> In-Reply-To: <20041221150258.GB14897@cirrus.madduck.net> To: linux-hotplug@vger.kernel.org --rS8CxjVDS/+yyDmU Content-Type: multipart/mixed; boundary="1yeeQ81UyVL57Vl7" Content-Disposition: inline --1yeeQ81UyVL57Vl7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable also sprach Kay Sievers [2004.12.21.1611 +0100]: > Use udevinfo in the dev.d/ script and ask with the DEVPATH for the > symlinks: >=20 > [kay@pim ~]$ udevinfo -r -q symlink -p /class/video4linux/video0 > /dev/camera0 /dev/kamera0 /dev/videocam0 /dev/webcam0=20 Awesome. I hacked together the attached file. However, it does not seem to be working. The logs indicate that everything goes by plan, but the permissions are not changed. Am I thus to assume that the hooks run before the rules.d permissions are applied? --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 invalid/expired pgp subkeys? use subkeys.pgp.net as keyserver! spamtraps: madduck.bogus@madduck.net =20 "die philosophie ist eine art rache an der wirklichkeit." - friedrich nietzsche --1yeeQ81UyVL57Vl7 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="permissions.dev" #!/bin/bash -e [[ $ACTION = add ]] || exit 0 UDEV_CONF=/etc/udev/udev.conf [[ -f $UDEV_CONF ]] && . $UDEV_CONF [[ -z $udev_permissions ]] && udev_permissions=/etc/udev/permissions.d REFS="$DEVNAME $(udevinfo -r -q symlink -p $DEVPATH)" logger -t $0 -p daemon.debug -- "checking references for $DEVNAME for permission s: $REFS" for node in $REFS; do [[ ! -b $node ]] && [[ ! -c $node ]] && [[ ! -L $node ]] && continue name=${node#/dev/} perms=$(grep -h "^$name" $udev_permissions/*.permissions | tail -1) set -- $(echo ${perms//:/ }) [[ -z $2 ]] && continue logger -t $0 -p daemon.debug -- "applying permissions $2:$3:$4 to $DEVNAME (due to reference '$1')..." chgrp $2:$3 $DEVNAME chmod $4 $DEVNAME done --1yeeQ81UyVL57Vl7-- --rS8CxjVDS/+yyDmU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFByEOEIgvIgzMMSnURApIeAKCpCmTlj/fo6n7ACdp7qf+wB+MFRACglAc+ C9ogN+JQfGr3JhDTT2Bix9U= =/OCQ -----END PGP SIGNATURE----- --rS8CxjVDS/+yyDmU-- ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel