2.0.7: inherit permissions = yes breaks setting read-only on files

Cole, Timothy D. timothy_d_cole at md.northgrum.com
Thu Aug 24 18:51:13 GMT 2000


> -----Original Message-----
> From:	Robert Dahlem [SMTP:Robert.Dahlem at ffm2.siemens.de]
> Sent:	Thursday, August 24, 2000 13:19
> To:	Cole, Timothy D.; Michael Ju. Tokarev; Robert Dahlem;
> samba-technical at samba.org
> Subject:	RE: 2.0.7: inherit permissions = yes breaks setting
> read-only on files
> 
> David,
> 
> [sorry for the doublette]
> 
> On Thu, 24 Aug 2000 13:15:51 -0400, Cole, Timothy D. wrote:
> 
> >> As I already wrote: I have more questions than opinions on this.
> >> 
> >> Should the functions inside a wrapper "library" use the wrapped or 
> >> the system functions (letting aside the individual function: 
> >> wrap_xxx() clearly MUST use sys_xxx() inside) ?
> >> 
> >	Could you rephrase the question?
> 
> 
> Its nearly the same as yours:
> 
> wrap_xxx() 
> {
> 	sys_xxx(); /* That's clear */
> 
>    /* But: */
>    sys_yyy();
>    /* or */
>    wrap_yyy();
>    /* ? */
> }
> 
	It depends on what extra semantics wrap_yyy() adds.

	Generally, though, I prefer to not call the public interface of a
module from itself, since it might be painful if I had to change the public
interface or (less so) private implementation later.

	When I do need the extra functionality offered by the wrap_yyy() in
multiple wrap_*() functions, I've found it's generally best to break out a
separate static _do_yyy(), and then call that from both wrap_yyy() and
wrap_xxx().

	Here's kind of what I mean:

		static void _do_yyy(foo *bar) {
	   	/* do some stuff */
			sys_yyy(bar);
		}

		void wrap_xxx(foo *bar) {
		   wrap_to_sys(bar);
			sys_xxx(bar);
		   _do_yyy(bar);
		}

		void wrap_yyy(foo *bar) {
			wrap_to_sys(bar);
		   _do_yyy(bar);
		}

	(if _do_yyy() wouldn't do anything beyond calling sys_yyy(), then
obviously you may as well dispense with it and call sys_yyy() in both
places)

	---

	However, in this case, part of what we're doing is also "fixing" the
semantics of sys_mkdir() to get around some systems which have
differently-behaving mkdir implementations.

	_That_ part of it should definitely be done at the sys_* layer, not
the dos_* layer, since the sys_* layer exists precisely so that specific
system behaviors can be worked around, so the sys_* functions expose a
consistent set of semantics regardless of platform.




More information about the samba-technical mailing list