ldap code

Luke Kenneth Casson Leighton lkcl at switchboard.net
Mon Dec 7 21:34:20 GMT 1998


mark,

looks good.  i'm extracting the fnum code from the patch: just to advise
all people sending contributions with two or more sets of functionality,
please keep them in _separate_ patches not one.  an entire contribution
will be given less priority if it contains modifications that are either
not needed or, say, for security reasons, cannot be added.

comments:

- the #ifdef WITH_LDAP should read #ifdef USE_LDAPUNIX_DB in groupdb/*.c
and should be switched _off_ by default.  the default should be to use
USE_SMBUNIX_DB unless, and probably even if they are not, users are using
ldap rfc2037 for users/groups.



- be careful about only having one static domgrp entry: sometimes the
lookups get recursive, particularly on groups and then members of groups,
you may get data overwritten like i did with the unix lookup code.


- over the weekend i added a couple more functions, sorry.  the public
interface to "add_aliasmem(rid, SID)" and "add_groupmem(rid, rid)" may
remain the same: the private one may change to "add_aliasmem(rid,
LOCAL_GRP_MEMBER*)" and "add_groupmem(rid, DOMAIN_GRP_MEMBER*)" we'll see.

- please can you put this:

	if (BOOL) instead of if(BOOL)
	if (BOOL)
	{
		single statement;
	}
	instead of 
	if (BOOL)
		single statement;

	and instead of 
	if (BOOL) single_statement;



	if (BOOL)
	{
		statements or statement;
	}
	instead of
	if (BOOL) {
		statements;
	}

also for prefernce but not a priority, from my former company's coding
standards, try not to use if() statements tha have side-effects, e.g if
((memb_list[i].sid_use = atoi(value)) >= SID_NAME_UNKNOWN), split this
into two lines, it's not obvious what's going on.  about the only ones i
still use are the ones where an assignment is done and then a check for a
NULL pointer, inside a while() loop and sometimes an if().


what i will do, matthew, is let yoube responsible for this code, it's your
style.  however, in a couple of months (whatever) if for whatever reason i
have to make any mods to it and my r.s.i isn't too bad, you might notice
that the code style changes... :-)



More information about the samba-technical mailing list