From 90881da68509ad673c1e921831ef4f36cabb9ea8 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 3 Jul 2012 15:32:10 -0700 Subject: Move copy_unix_token() from locking/locking.c to lib/util.c. Make public. --- source3/locking/locking.c | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'source3/locking/locking.c') diff --git a/source3/locking/locking.c b/source3/locking/locking.c index 95e9b775533..d3ab7f31408 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -882,35 +882,6 @@ bool downgrade_share_oplock(struct share_mode_lock *lck, files_struct *fsp) return True; } -/************************************************************************* - Return a talloced copy of a struct security_unix_token. NULL on fail. - (Should this be in locking.c.... ?). -*************************************************************************/ - -static struct security_unix_token *copy_unix_token(TALLOC_CTX *ctx, const struct security_unix_token *tok) -{ - struct security_unix_token *cpy; - - cpy = talloc(ctx, struct security_unix_token); - if (!cpy) { - return NULL; - } - - cpy->uid = tok->uid; - cpy->gid = tok->gid; - cpy->ngroups = tok->ngroups; - if (tok->ngroups) { - /* Make this a talloc child of cpy. */ - cpy->groups = (gid_t *)talloc_memdup( - cpy, tok->groups, tok->ngroups * sizeof(gid_t)); - if (!cpy->groups) { - TALLOC_FREE(cpy); - return NULL; - } - } - return cpy; -} - /**************************************************************************** Adds a delete on close token. ****************************************************************************/ -- cgit