CVS update: samba/source/smbd

Tim Potter tpot at samba.org
Fri Jun 23 15:49:11 EST 2000


Date:	Friday June 23, 2000 @ 15:49
Author:	tpot

Update of /data/cvs/samba/source/smbd
In directory samba:/tmp/cvs-serv14606/smbd

Added Files:
	sec_ctx.c 
Log Message:
I've been working on refactoring some of the mess that is the become_user()
code.  This code is now implemented as a stack of security contexts, where
a security context is defined as a set of effective user, group and 
supplementary group ids.  

The following functions are implemented:

BOOL push_sec_ctx(void);

     Create a new security context on the stack which is the same as the
     current security context.

void set_sec_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *groups);

     Set the current security context to a given set of user and group
     ids.

void set_root_sec_ctx(void);

     Set to uid = gid = 0.  No supplementary groups are set.

BOOL pop_sec_ctx(void);

     Pop a security context from the stack and restore the user and group
     permissions of the previous context.

void init_sec_ctx(void);

     Initialise the security context stack.  This must be called before any
     of the other operations are used or weird things may happen.

The idea is that there is a base security context which is either root or
some authenticated unix user.  Other security contexts can be pushed and
popped as needed for things like changing passwords, or rpc pipe operations
where the rpc pipe user is different from the smb user.



More information about the samba-cvs mailing list