linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Harald Hoyer <harald@redhat.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: udev - flag for preserving the ownership
Date: Wed, 02 Jun 2004 10:26:07 +0000	[thread overview]
Message-ID: <40BDAB3F.9090803@redhat.com> (raw)
In-Reply-To: <40BCA49D.2000007@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 575 bytes --]

Harald Hoyer wrote:
> How about a config flag, which means that udev preserves the ownership 
> of an already existing device node (with the correct major, minor numbers)?
> 
> Btw, we only check if the file we want to create is block or char, not 
> e.g. that we want block and it is char.
> 
> if (((stats.st_mode & S_IFMT) == S_IFBLK || (stats.st_mode & S_IFMT) == 
> S_IFCHR) && (stats.st_rdev == makedev(major, minor)))
> 
> should look like:
> 
> if (((stats.st_mode & S_IFMT) == mode) && (stats.st_rdev == 
> makedev(major, minor)))

how about this (see attachement)?

[-- Attachment #1.2: udev-025-keepowner.patch --]
[-- Type: text/x-patch, Size: 563 bytes --]

--- udev-025/udev-add.c.keep	2004-04-21 23:39:10.000000000 +0200
+++ udev-025/udev-add.c	2004-06-02 12:08:16.728855024 +0200
@@ -114,10 +114,10 @@
 		goto create;
 
 	/* preserve node with already correct numbers, to not change the inode number */
-	if (((stats.st_mode & S_IFMT) == S_IFBLK || (stats.st_mode & S_IFMT) == S_IFCHR) &&
+	if (((stats.st_mode & S_IFMT) == (mode & S_IFMT)) &&
 	    (stats.st_rdev == makedev(major, minor))) {
 		dbg("preserve file '%s', cause it has correct dev_t", file);
-		goto perms;
+		goto exit;
 	}
 
 	if (unlink(file) != 0)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

  reply	other threads:[~2004-06-02 10:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-01 15:45 udev - flag for preserving the ownership Harald Hoyer
2004-06-02 10:26 ` Harald Hoyer [this message]
2004-06-02 18:21 ` Olaf Hering
2004-06-03  8:16 ` Harald Hoyer
2004-06-03 10:59 ` Olaf Hering
2004-06-03 11:03 ` Harald Hoyer
2004-06-03 11:14 ` Olaf Hering

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=40BDAB3F.9090803@redhat.com \
    --to=harald@redhat.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).