1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

s3:lib: add root_unix_token()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Ralph Boehme 2018-03-16 19:01:20 +01:00 committed by Stefan Metzmacher
parent 8af4ec752a
commit ad04a6ce49
2 changed files with 27 additions and 0 deletions

View File

@ -415,6 +415,7 @@ bool map_open_params_to_ntcreate(const char *smb_base_fname,
uint32_t *pcreate_options,
uint32_t *pprivate_flags);
struct security_unix_token *copy_unix_token(TALLOC_CTX *ctx, const struct security_unix_token *tok);
struct security_unix_token *root_unix_token(TALLOC_CTX *mem_ctx);
bool dir_check_ftype(uint32_t mode, uint32_t dirtype);
/* The following definitions come from lib/util_builtin.c */

View File

@ -2143,6 +2143,32 @@ struct security_unix_token *copy_unix_token(TALLOC_CTX *ctx, const struct securi
return cpy;
}
/****************************************************************************
Return a root token
****************************************************************************/
struct security_unix_token *root_unix_token(TALLOC_CTX *mem_ctx)
{
struct security_unix_token *t = NULL;
t = talloc_zero(mem_ctx, struct security_unix_token);
if (t == NULL) {
return NULL;
}
/*
* This is not needed, but lets make it explicit, not implicit.
*/
*t = (struct security_unix_token) {
.uid = 0,
.gid = 0,
.ngroups = 0,
.groups = NULL
};
return t;
}
/****************************************************************************
Check that a file matches a particular file type.
****************************************************************************/