diff options
| author | Tim Bishop <tdb@FreeBSD.org> | 2007-06-05 10:55:06 +0000 | 
|---|---|---|
| committer | Tim Bishop <tdb@FreeBSD.org> | 2007-06-05 10:55:06 +0000 | 
| commit | c89e412277cdc50c394570dcc004ee3de96c8de5 (patch) | |
| tree | 0257f96fa5822a7ea0de0e1e267ed038d02e03f0 /net/samba3/files/patch-smbd_sec_ctx.c | |
| parent | - Fix typos in pkg-descr (diff) | |
- Update to 3.0.25a.
Major bug fixes included in Samba 3.0.25a are:
  o Missing supplementary Unix group membership when using "force
    group".
  o Premature expiration of domain user passwords when using a
    Samba domain controller.
  o Failure to open the Windows object picker against a server
    configured to use "security = domain".
  * Authentication failures when using security = server.
Plus additional local fixes.
PR:		ports/113358
Submitted by:	maintainer
Diffstat (limited to 'net/samba3/files/patch-smbd_sec_ctx.c')
| -rw-r--r-- | net/samba3/files/patch-smbd_sec_ctx.c | 63 | 
1 files changed, 63 insertions, 0 deletions
| diff --git a/net/samba3/files/patch-smbd_sec_ctx.c b/net/samba3/files/patch-smbd_sec_ctx.c new file mode 100644 index 000000000000..46c6d55c4c2c --- /dev/null +++ b/net/samba3/files/patch-smbd_sec_ctx.c @@ -0,0 +1,63 @@ +--- smbd/sec_ctx.c.orig	Thu Mar  1 05:54:08 2007 ++++ smbd/sec_ctx.c	Tue Jun  5 01:16:32 2007 +@@ -192,7 +192,7 @@ +  + 	if (sec_ctx_stack_ndx == MAX_SEC_CTX_DEPTH) { + 		DEBUG(0, ("Security context stack overflow!\n")); +-		smb_panic("Security context stack overflow!\n"); ++		smb_panic("Security context stack overflow!"); + 	} +  + 	/* Store previous user context */ +@@ -234,7 +234,9 @@ + void set_sec_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *groups, NT_USER_TOKEN *token) + { + 	struct sec_ctx *ctx_p = &sec_ctx_stack[sec_ctx_stack_ndx]; +-	 ++#ifdef HAVE_SETGROUPS ++	gid_t *new_groups = NULL; ++#endif + 	/* Set the security context */ +  + 	DEBUG(3, ("setting sec ctx (%u, %u) - sec_ctx_stack_ndx = %d\n",  +@@ -246,12 +248,20 @@ + 	gain_root(); +  + #ifdef HAVE_SETGROUPS +-	sys_setgroups(ngroups, groups); ++	if (!(new_groups = SMB_MALLOC_ARRAY(gid_t, ngroups+1))) { ++	    smb_panic("malloc for groups failed"); ++	} ++	new_groups[0] = gid; ++	if(ngroups) { ++		memcpy(&new_groups[1], groups, sizeof(gid_t) * ngroups); ++	} ++	sys_setgroups(ngroups+1, new_groups); ++	SAFE_FREE(new_groups); + #endif +  + 	ctx_p->ut.ngroups = ngroups; +- + 	SAFE_FREE(ctx_p->ut.groups); ++ + 	if (token && (token == ctx_p->token)) { + 		smb_panic("DUPLICATE_TOKEN"); + 	} +@@ -262,7 +272,7 @@ + 		ctx_p->ut.groups = (gid_t *)memdup(groups, + 						   sizeof(gid_t) * ngroups); + 		if (!ctx_p->ut.groups) { +-			smb_panic("memdup failed"); ++			smb_panic("memdup for groups failed"); + 		} + 	} else { + 		ctx_p->ut.groups = NULL; +@@ -315,7 +325,7 @@ +  + 	if (sec_ctx_stack_ndx == 0) { + 		DEBUG(0, ("Security context stack underflow!\n")); +-		smb_panic("Security context stack underflow!\n"); ++		smb_panic("Security context stack underflow!"); + 	} +  + 	ctx_p = &sec_ctx_stack[sec_ctx_stack_ndx]; | 
