From mboxrd@z Thu Jan 1 00:00:00 1970 From: Harald Hoyer Date: Wed, 02 Jun 2004 10:26:07 +0000 Subject: Re: udev - flag for preserving the ownership Message-Id: <40BDAB3F.9090803@redhat.com> MIME-Version: 1 Content-Type: multipart/mixed; boundary="------------enig735063C3944BBC85FE182C4C" List-Id: References: <40BCA49D.2000007@redhat.com> In-Reply-To: <40BCA49D.2000007@redhat.com> To: linux-hotplug@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig735063C3944BBC85FE182C4C Content-Type: multipart/mixed; boundary="------------030602010701020104090805" This is a multi-part message in MIME format. --------------030602010701020104090805 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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)? --------------030602010701020104090805 Content-Type: text/x-patch; name="udev-025-keepowner.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="udev-025-keepowner.patch" --- 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) --------------030602010701020104090805-- --------------enig735063C3944BBC85FE182C4C Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFAvatBt7dFwsVXVUIRAu2rAJ9PMh12wR5jBeeDzySvg2pPOj7W/gCgo0i7 YjBk37Hf+mRKiMjzDyvy1Is= =oARU -----END PGP SIGNATURE----- --------------enig735063C3944BBC85FE182C4C-- ------------------------------------------------------- This SF.Net email is sponsored by the new InstallShield X. >From Windows to Linux, servers to mobile, InstallShield X is the one installation-authoring solution that does it all. Learn more and evaluate today! http://www.installshield.com/Dev2Dev/0504 _______________________________________________ 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