1
0
mirror of https://github.com/samba-team/samba.git synced 2025-06-07 03:17:08 +03:00
Luke Leighton 0d21e1e609 - group database API. oops and oh dear, the threat has been carried out:
the pre-alpha "domain group" etc parameters have disappeared.

- interactive debug detection

- re-added mem_man (andrew's memory management, detects memory corruption)

- american spellings of "initialise" replaced with english spelling of
  "initialise".

- started on "lookup_name()" and "lookup_sid()" functions.  proper ones.

- moved lots of functions around.  created some modules of commonly used
  code.  e.g the password file locking code, which is used in groupfile.c
  and aliasfile.c and smbpass.c

- moved RID_TYPE_MASK up another bit.  this is really unfortunate, but
  there is no other "fast" way to identify users from groups from aliases.
  i do not believe that this code saves us anything (the multipliers)
  and puts us at a disadvantage (reduces the useable rid space).
  the designers of NT aren't silly: if they can get away with a user-
  interface-speed LsaLookupNames / LsaLookupSids, then so can we.  i
  spoke with isaac at the cifs conference, the only time for example that
  they do a security context check is on file create.  certainly not on
  individual file reads / writes, which would drastically hit their
  performance and ours, too.

- renamed myworkgroup to global_sam_name, amongst other things, when used
  in the rpc code.  there is also a global_member_name, as we are always
  responsible for a SAM database, the scope of which is limited by the role
  of the machine (e.g if a member of a workgroup, your SAM is for _local_
  logins only, and its name is the name of your server.  you even still
  have a SID.  see LsaQueryInfoPolicy, levels 3 and 5).

- updated functionality of groupname.c to be able to cope with names
  like DOMAIN\group and SERVER\alias.  used this code to be able to
  do aliases as well as groups.  this code may actually be better
  off being used in username mapping, too.

- created a connect to serverlist function in clientgen.c and used it
  in password.c

- initialisation in server.c depends on the role of the server.  well,
  it does now.

- rpctorture.  smbtorture.  EXERCISE EXTREME CAUTION.
-

93 lines
2.2 KiB
C

#if (defined(NOMEMMAN) && !defined(MEM_MAN_MAIN) && defined(HAVE_MALLOC_H))
#include <malloc.h>
#else
/* user settable parameters */
#define MEM_MANAGER
/*
this is the maximum number of blocks that can be allocated at one
time. Set this to more than the max number of mallocs you want possible
*/
#define MEM_MAX_MEM_OBJECTS 20000
/*
maximum length of a file name. This is for the source files only. This
would normally be around 30 - increase it only if necessary
*/
#define MEM_FILE_STR_LENGTH 30
/*
default mem multiplier. All memory requests will be multiplied by
this number, thus allowing fast resizing. High values chew lots of
memory but allow for easy resizing
*/
#define MEM_DEFAULT_MEM_MULTIPLIER 1
/*
the length of the corruption buffers before and after each memory block.
Using these can reduce memory overrun errors and catch bad code. The
amount actually allocated is this times 2 times sizeof(char)
*/
#define MEM_CORRUPT_BUFFER 16
/*
the 'seed' to use for the corruption buffer. zero is a very bad choice
*/
#define MEM_CORRUPT_SEED 0x10
/*
seed increment. This is another precaution. This will be added to the
'seed' for each adjacent element of the corruption buffer
*/
#define MEM_SEED_INCREMENT 0x1
/*
memory fill. This will be copied over all allocated memory - to aid in
debugging memory dumps. It is one byte long
*/
#define MEM_FILL_BYTE 42
/*
this determines whether free() on your system returns an integer or
nothing. If unsure then leave this un defined.
*/
/* #define MEM_FREE_RETURNS_INT */
/*
This determines whether a signal handler will be instelled to do
a mem_write_verbose on request
*/
#define MEM_SIGNAL_HANDLER
/*
This sets which vector to use if MEM_SIGNAL_HANDLER is defined
*/
#define MEM_SIGNAL_VECTOR SIGUSR1
#ifndef MEM_MAN_MAIN
#ifdef malloc
# undef malloc
#endif
#define malloc(x) smb_mem_malloc(x,__FILE__,__LINE__)
#define free(x) smb_mem_free(x,__FILE__,__LINE__)
#define realloc(ptr,newsize) smb_mem_resize(ptr,newsize)
#ifdef calloc
# undef calloc
#endif
#define calloc(nitems,size) malloc(((_mem_size)nitems)*((_mem_size)size))
#ifdef strdup
# undef strdup
#endif
#define strdup(s) smb_mem_strdup(s, __FILE__, __LINE__)
#endif
#endif