From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott James Remnant Date: Tue, 20 Jan 2009 21:41:47 +0000 Subject: [PATCH] Expose delayed name resolution Message-Id: <1232487707.23851.55.camel@quest> MIME-Version: 1 Content-Type: multipart/mixed; boundary="=-EDBRwSvSYKgqck3JooLb" List-Id: To: linux-hotplug@vger.kernel.org --=-EDBRwSvSYKgqck3JooLb Content-Type: text/plain Content-Transfer-Encoding: quoted-printable udevd had the ability to delay name resolution until the event, but this was never exposed. Add a --resolve-names=3Dlate option to do so. --- NEWS | 3 ++- udev/udevd.c | 8 +++++--- udev/udevd.xml | 5 +++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index 52bfa6a..972b9b0 100644 --- a/NEWS +++ b/NEWS @@ -6,7 +6,8 @@ The udevadm test command has no longer a --force option, no= des and symlinks are always updated with a test run now. =20 The udevd daemon can be started with --resolve-names=3Dnever to avoid all = user -and group lookups (e.g. in cut-down systems). +and group lookups (e.g. in cut-down systems) or --resolve-names=3Dlate to +lookup user and groups every time events are handled. =20 udev 136 =3D=3D=3D=3D=3D=3D=3D=3D diff --git a/udev/udevd.c b/udev/udevd.c index 9a8d791..4d6f465 100644 --- a/udev/udevd.c +++ b/udev/udevd.c @@ -683,16 +683,18 @@ int main(int argc, char *argv[]) case 'N': if (strcmp (optarg, "early") =3D=3D 0) { resolve_names =3D 1; + } else if (strcmp (optarg, "late") =3D=3D 0) { + resolve_names =3D 0; } else if (strcmp (optarg, "never") =3D=3D 0) { resolve_names =3D -1; } else { - fprintf(stderr, "resolve-names must be early or never\n"); - err(udev, "resolve-names must be early or never\n"); + fprintf(stderr, "resolve-names must be early, late or never\n"); + err(udev, "resolve-names must be early, late or never\n"); goto exit; } break; case 'h': - printf("Usage: udevd [--help] [--daemon] [--debug-trace] [--debug] [--r= esolve-names=3Dearly|never] [--version]\n"); + printf("Usage: udevd [--help] [--daemon] [--debug-trace] [--debug] [--r= esolve-names=3Dearly|late|never] [--version]\n"); goto exit; case 'V': printf("%s\n", VERSION); diff --git a/udev/udevd.xml b/udev/udevd.xml index 010411c..0df6f4b 100644 --- a/udev/udevd.xml +++ b/udev/udevd.xml @@ -29,7 +29,7 @@ - + @@ -70,7 +70,8 @@ Specify when udevd should resolve names of users and g= roups. When set to (the default) names will = be - resolved when the rules are parsed. + resolved when the rules are parsed. When set to + names will be resolved for every event= . When set to names will never be resol= ved and all devices will be owned by root. --=20 1.6.0.5 --=20 Scott James Remnant scott@ubuntu.com --=-EDBRwSvSYKgqck3JooLb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEABECAAYFAkl2RRsACgkQSnQiFMl4yK4h1QCfcdG7puSg9lHy0I7p8je/2Qkt cV8AnRJweKaco7JMgZcba83BgrKqVs9v =rR05 -----END PGP SIGNATURE----- --=-EDBRwSvSYKgqck3JooLb--