linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] create_floppy_devices modifying mode via umask
@ 2007-03-05 18:16 Matthias Schwarzott
  2007-03-07 16:26 ` Kay Sievers
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Matthias Schwarzott @ 2007-03-05 18:16 UTC (permalink / raw)
  To: linux-hotplug

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

Hi Kay, hi List!

This one line patch against udev-106 adds umask(0) call to 
create_floppy_devices to change inherited umask of 022 (from udevd) which was 
restricting group write permissions for the created device nodes for our 
rules (using -M 0660).

Matthias

-- 
Matthias Schwarzott (zzam)

[-- Attachment #2: udev-106-floppy-devices-no-umask.diff --]
[-- Type: text/x-diff, Size: 336 bytes --]

diff --git a/extras/floppy/create_floppy_devices.c b/extras/floppy/create_floppy_devices.c
index 7b61ef0..187324e 100644
--- a/extras/floppy/create_floppy_devices.c
+++ b/extras/floppy/create_floppy_devices.c
@@ -155,6 +155,8 @@ int main(int argc, char **argv)
 	if (type == 0)
 		return 0;
 
+	umask(0);
+
 	selinux_init();
 
 	i = 0;

[-- Attachment #3: Type: text/plain, Size: 345 bytes --]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- Attachment #4: Type: text/plain, Size: 226 bytes --]

_______________________________________________
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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] create_floppy_devices modifying mode via umask
  2007-03-05 18:16 [PATCH] create_floppy_devices modifying mode via umask Matthias Schwarzott
@ 2007-03-07 16:26 ` Kay Sievers
  2007-03-08  8:51 ` Matthias Schwarzott
  2007-03-08 11:28 ` Kay Sievers
  2 siblings, 0 replies; 4+ messages in thread
From: Kay Sievers @ 2007-03-07 16:26 UTC (permalink / raw)
  To: linux-hotplug

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

On 3/5/07, Matthias Schwarzott <zzam@gentoo.org> wrote:
> This one line patch against udev-106 adds umask(0) call to
> create_floppy_devices to change inherited umask of 022 (from udevd) which was
> restricting group write permissions for the created device nodes for our
> rules (using -M 0660).

How about explicit chmod(), like we do in udev, instead?
Does that work for you?

Thanks,
Kay

[-- Attachment #2: floppy.patch --]
[-- Type: text/x-patch, Size: 726 bytes --]

--- a/extras/floppy/create_floppy_devices.c
+++ b/extras/floppy/create_floppy_devices.c
@@ -74,7 +74,7 @@ int main(int argc, char **argv)
 	int major = 2, minor;
 	uid_t uid = 0;
 	gid_t gid = 0;
-	mode_t mode = 0;
+	mode_t mode = 0660;
 	int create_nodes = 0;
 	int print_nodes = 0;
 	int unlink_nodes = 0;
@@ -165,10 +165,11 @@ int main(int argc, char **argv)
 			printf("%s b %d %d %d\n", node, mode, major, minor);
 		if (create_nodes) {
 			unlink(node);
-			selinux_setfscreatecon(node, NULL, mode);
+			selinux_setfscreatecon(node, NULL, S_IFBLK | mode);
 			mknod(node, S_IFBLK | mode, makedev(major,minor));
 			selinux_resetfscreatecon();
 			chown(node, uid, gid);
+			chmod(node, S_IFBLK | mode);
 		}
 		i++;
 	}

[-- Attachment #3: Type: text/plain, Size: 345 bytes --]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- Attachment #4: Type: text/plain, Size: 226 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] create_floppy_devices modifying mode via umask
  2007-03-05 18:16 [PATCH] create_floppy_devices modifying mode via umask Matthias Schwarzott
  2007-03-07 16:26 ` Kay Sievers
@ 2007-03-08  8:51 ` Matthias Schwarzott
  2007-03-08 11:28 ` Kay Sievers
  2 siblings, 0 replies; 4+ messages in thread
From: Matthias Schwarzott @ 2007-03-08  8:51 UTC (permalink / raw)
  To: linux-hotplug

On Mittwoch, 7. März 2007, Kay Sievers wrote:
> On 3/5/07, Matthias Schwarzott <zzam@gentoo.org> wrote:
> > This one line patch against udev-106 adds umask(0) call to
> > create_floppy_devices to change inherited umask of 022 (from udevd) which
> > was restricting group write permissions for the created device nodes for
> > our rules (using -M 0660).
>
> How about explicit chmod(), like we do in udev, instead?
> Does that work for you?

That works for me.

Matthias

-- 
Matthias Schwarzott (zzam)

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] create_floppy_devices modifying mode via umask
  2007-03-05 18:16 [PATCH] create_floppy_devices modifying mode via umask Matthias Schwarzott
  2007-03-07 16:26 ` Kay Sievers
  2007-03-08  8:51 ` Matthias Schwarzott
@ 2007-03-08 11:28 ` Kay Sievers
  2 siblings, 0 replies; 4+ messages in thread
From: Kay Sievers @ 2007-03-08 11:28 UTC (permalink / raw)
  To: linux-hotplug

On 3/8/07, Matthias Schwarzott <zzam@gentoo.org> wrote:
> On Mittwoch, 7. März 2007, Kay Sievers wrote:
> > On 3/5/07, Matthias Schwarzott <zzam@gentoo.org> wrote:
> > > This one line patch against udev-106 adds umask(0) call to
> > > create_floppy_devices to change inherited umask of 022 (from udevd) which
> > > was restricting group write permissions for the created device nodes for
> > > our rules (using -M 0660).
> >
> > How about explicit chmod(), like we do in udev, instead?
> > Does that work for you?
>
> That works for me.

I've committed that now.

Thanks,
Kay
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-03-08 11:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-05 18:16 [PATCH] create_floppy_devices modifying mode via umask Matthias Schwarzott
2007-03-07 16:26 ` Kay Sievers
2007-03-08  8:51 ` Matthias Schwarzott
2007-03-08 11:28 ` Kay Sievers

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).