NFS client and UIDs and GIDs

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Aug 1 07:48:47 UTC 2011


Hello,

in the mknod() handler of the NFS client there is currently a TODO:

	/* TODO: either use our uid or use the Nfs credentials */
	SERP_ARGS(node).createarg.attributes.uid	= 0;
	SERP_ARGS(node).createarg.attributes.gid	= 0;

I have to implement this, because the 0 identifiers are not suitable for us.

The first variant is:

	SERP_ARGS(node).createarg.attributes.uid	= geteuid();
	SERP_ARGS(node).createarg.attributes.gid	= getegid();

The second variant is:

	SERP_ARGS(node).createarg.attributes.uid	= /* some value specified at mount 
time */;
	SERP_ARGS(node).createarg.attributes.gid	= /* some value specified at mount 
time */;

The first variant has the benefit that you can change the value later and the 
value may be different for different threads.  On the other hand local and 
remote UIDs and GIDs may be unrelated.  For simplicity I would choose the first 
variant.

What do you think?

Best regards,
	Sebastian

-- 
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the users mailing list