linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Scott James Remnant <scott@ubuntu.com>
To: linux-hotplug@vger.kernel.org
Subject: [PATCH] Expose delayed name resolution
Date: Tue, 20 Jan 2009 21:41:47 +0000	[thread overview]
Message-ID: <1232487707.23851.55.camel@quest> (raw)

[-- Attachment #1: Type: text/plain, Size: 2977 bytes --]

udevd had the ability to delay name resolution until the event, but this
was never exposed.  Add a --resolve-names=late 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, nodes and symlinks
 are always updated with a test run now.
 
 The udevd daemon can be started with --resolve-names=never 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=late to
+lookup user and groups every time events are handled.
 
 udev 136
 ========
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") == 0) {
 				resolve_names = 1;
+			} else if (strcmp (optarg, "late") == 0) {
+				resolve_names = 0;
 			} else if (strcmp (optarg, "never") == 0) {
 				resolve_names = -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] [--resolve-names=early|never] [--version]\n");
+			printf("Usage: udevd [--help] [--daemon] [--debug-trace] [--debug] [--resolve-names=early|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 @@
           <arg><option>--debug-trace</option></arg>
           <arg><option>--debug</option></arg>
           <arg><option>--version</option></arg>
-          <arg><option>--resolve-names=early|never</option></arg>
+          <arg><option>--resolve-names=early|late|never</option></arg>
           <arg><option>--help</option></arg>
         </cmdsynopsis>
       </refsynopsisdiv>
@@ -70,7 +70,8 @@
             <listitem>
               <para>Specify when udevd should resolve names of users and groups.
               When set to <option>early</option> (the default) names will be
-              resolved when the rules are parsed.
+              resolved when the rules are parsed.  When set to
+              <option>late</option> names will be resolved for every event.
               When set to <option>never</option> names will never be resolved
               and all devices will be owned by root.</para>
             </listitem>
-- 
1.6.0.5


-- 
Scott James Remnant
scott@ubuntu.com

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

                 reply	other threads:[~2009-01-20 21:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1232487707.23851.55.camel@quest \
    --to=scott@ubuntu.com \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).