From mboxrd@z Thu Jan 1 00:00:00 1970 From: Harald Hoyer Date: Thu, 03 Jun 2004 08:16:49 +0000 Subject: Re: udev - flag for preserving the ownership Message-Id: <40BEDE71.7080105@redhat.com> MIME-Version: 1 Content-Type: multipart/mixed; boundary="------------enig93662E4CB444CA381FF2523C" 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) --------------enig93662E4CB444CA381FF2523C Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Olaf Hering wrote: > I havent looked at the larger context, but I believe this changes > behaviour of udev. Currently udevstart can fix up your system for sure, > but with this change, a bogus file will not be removed if it happens to > have the same permissions. > Or will stats.st_rdev == makedev(major, minor) take care of that? yep, it will not change file permissions and ownership, if it already exists and is the correct node... we can also create a config flag, which changes the goto. You may look at the whole code. What I also wish is a flag for the DB, which indicates that the file already existed and should not be removed with the "remove" ACTION. > > >>--- 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) > > > > > --------------enig93662E4CB444CA381FF2523C 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 iD8DBQFAvt50t7dFwsVXVUIRAi0QAJwIn49udszAvSVmyJu7TPcE/2tLhwCfVTfJ RzYIZsWdTVhTsZoCo5RwvJ0= =XitN -----END PGP SIGNATURE----- --------------enig93662E4CB444CA381FF2523C-- ------------------------------------------------------- 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