summaryrefslogtreecommitdiff
path: root/source3/auth
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-05-21 11:25:01 +1000
committerGünther Deschner <gd@samba.org>2010-05-21 10:39:59 +0200
commitcba7f8b8273e661d3c43652900d93e5a8eab4e5f (patch)
tree714e00240ddc0c7e689240d2c8fb7d9196b1fff2 /source3/auth
parenta92b653af964364ee438c6ee69a87eb7603ceab0 (diff)
downloadsamba-cba7f8b8273e661d3c43652900d93e5a8eab4e5f.tar.gz
samba-cba7f8b8273e661d3c43652900d93e5a8eab4e5f.tar.bz2
samba-cba7f8b8273e661d3c43652900d93e5a8eab4e5f.zip
s3:dom_sid Global replace of DOM_SID with struct dom_sid
This matches the structure that new code is being written to, and removes one more of the old-style named structures, and the need to know that is is just an alias for struct dom_sid. Andrew Bartlett Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3/auth')
-rw-r--r--source3/auth/auth_util.c20
-rw-r--r--source3/auth/server_info.c10
-rw-r--r--source3/auth/token_util.c48
3 files changed, 39 insertions, 39 deletions
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index 34c8190ee8..ad454b6df1 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -35,7 +35,7 @@
****************************************************************************/
static void sort_sid_array_for_smbd(struct auth_serversupplied_info *result,
- const DOM_SID *pgroup_sid)
+ const struct dom_sid *pgroup_sid)
{
unsigned int i;
@@ -504,7 +504,7 @@ NTSTATUS create_local_token(struct auth_serversupplied_info *server_info)
for (i=1; i<server_info->ptok->num_sids; i++) {
gid_t gid;
- DOM_SID *sid = &server_info->ptok->user_sids[i];
+ struct dom_sid *sid = &server_info->ptok->user_sids[i];
if (!sid_to_gid(sid, &gid)) {
DEBUG(10, ("Could not convert SID %s to gid, "
@@ -573,7 +573,7 @@ NTSTATUS make_server_info_pw(struct auth_serversupplied_info **server_info,
gid_t *gids;
char *qualified_name = NULL;
TALLOC_CTX *mem_ctx = NULL;
- DOM_SID u_sid;
+ struct dom_sid u_sid;
enum lsa_SidType type;
struct auth_serversupplied_info *result;
@@ -689,7 +689,7 @@ static NTSTATUS make_new_server_info_guest(struct auth_serversupplied_info **ser
{
NTSTATUS status;
struct samu *sampass = NULL;
- DOM_SID guest_sid;
+ struct dom_sid guest_sid;
bool ret;
static const char zeros[16] = {0, };
fstring tmp;
@@ -1052,8 +1052,8 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
const char *nt_domain;
const char *nt_username;
struct samu *sam_account = NULL;
- DOM_SID user_sid;
- DOM_SID group_sid;
+ struct dom_sid user_sid;
+ struct dom_sid group_sid;
bool username_was_mapped;
uid_t uid = (uid_t)-1;
@@ -1301,8 +1301,8 @@ NTSTATUS make_server_info_wbcAuthUserInfo(TALLOC_CTX *mem_ctx,
const char *nt_domain;
const char *nt_username;
struct samu *sam_account = NULL;
- DOM_SID user_sid;
- DOM_SID group_sid;
+ struct dom_sid user_sid;
+ struct dom_sid group_sid;
bool username_was_mapped;
uint32_t i;
@@ -1489,7 +1489,7 @@ NTSTATUS make_server_info_wbcAuthUserInfo(TALLOC_CTX *mem_ctx,
/* Create a 'combined' list of all SIDs we might want in the SD */
result->num_sids = info->num_sids - 2;
- result->sids = talloc_array(result, DOM_SID, result->num_sids);
+ result->sids = talloc_array(result, struct dom_sid, result->num_sids);
if (result->sids == NULL) {
TALLOC_FREE(result);
return NT_STATUS_NO_MEMORY;
@@ -1537,7 +1537,7 @@ NTSTATUS make_server_info_wbcAuthUserInfo(TALLOC_CTX *mem_ctx,
bool is_trusted_domain(const char* dom_name)
{
- DOM_SID trustdom_sid;
+ struct dom_sid trustdom_sid;
bool ret;
/* no trusted domains for a standalone server */
diff --git a/source3/auth/server_info.c b/source3/auth/server_info.c
index 767ae5e7b6..9d593fa8c8 100644
--- a/source3/auth/server_info.c
+++ b/source3/auth/server_info.c
@@ -60,9 +60,9 @@ struct auth_serversupplied_info *make_server_info(TALLOC_CTX *mem_ctx)
********************************************************************/
static NTSTATUS nt_token_to_group_list(TALLOC_CTX *mem_ctx,
- const DOM_SID *domain_sid,
+ const struct dom_sid *domain_sid,
size_t num_sids,
- const DOM_SID *sids,
+ const struct dom_sid *sids,
int *numgroups,
struct samr_RidWithAttribute **pgids)
{
@@ -99,9 +99,9 @@ static NTSTATUS serverinfo_to_SamInfo_base(TALLOC_CTX *mem_ctx,
{
struct samu *sampw;
struct samr_RidWithAttribute *gids = NULL;
- const DOM_SID *user_sid = NULL;
- const DOM_SID *group_sid = NULL;
- DOM_SID domain_sid;
+ const struct dom_sid *user_sid = NULL;
+ const struct dom_sid *group_sid = NULL;
+ struct dom_sid domain_sid;
uint32 user_rid, group_rid;
NTSTATUS status;
diff --git a/source3/auth/token_util.c b/source3/auth/token_util.c
index 8e710fdd62..d2a03b4031 100644
--- a/source3/auth/token_util.c
+++ b/source3/auth/token_util.c
@@ -30,7 +30,7 @@
Check for a SID in an NT_USER_TOKEN
****************************************************************************/
-bool nt_token_check_sid ( const DOM_SID *sid, const NT_USER_TOKEN *token )
+bool nt_token_check_sid ( const struct dom_sid *sid, const NT_USER_TOKEN *token )
{
int i;
@@ -47,7 +47,7 @@ bool nt_token_check_sid ( const DOM_SID *sid, const NT_USER_TOKEN *token )
bool nt_token_check_domain_rid( NT_USER_TOKEN *token, uint32 rid )
{
- DOM_SID domain_sid;
+ struct dom_sid domain_sid;
/* if we are a domain member, the get the domain SID, else for
a DC or standalone server, use our own SID */
@@ -78,7 +78,7 @@ bool nt_token_check_domain_rid( NT_USER_TOKEN *token, uint32 rid )
NT_USER_TOKEN *get_root_nt_token( void )
{
struct nt_user_token *token, *for_cache;
- DOM_SID u_sid, g_sid;
+ struct dom_sid u_sid, g_sid;
struct passwd *pw;
void *cache_data;
@@ -124,7 +124,7 @@ NT_USER_TOKEN *get_root_nt_token( void )
* Add alias SIDs from memberships within the partially created token SID list
*/
-NTSTATUS add_aliases(const DOM_SID *domain_sid,
+NTSTATUS add_aliases(const struct dom_sid *domain_sid,
struct nt_user_token *token)
{
uint32 *aliases;
@@ -151,7 +151,7 @@ NTSTATUS add_aliases(const DOM_SID *domain_sid,
}
for (i=0; i<num_aliases; i++) {
- DOM_SID alias_sid;
+ struct dom_sid alias_sid;
sid_compose(&alias_sid, domain_sid, aliases[i]);
status = add_sid_to_array_unique(token, &alias_sid,
&token->user_sids,
@@ -171,9 +171,9 @@ done:
*******************************************************************/
static NTSTATUS add_builtin_administrators(struct nt_user_token *token,
- const DOM_SID *dom_sid)
+ const struct dom_sid *dom_sid)
{
- DOM_SID domadm;
+ struct dom_sid domadm;
NTSTATUS status;
/* nothing to do if we aren't in a domain */
@@ -215,7 +215,7 @@ static NTSTATUS add_builtin_administrators(struct nt_user_token *token,
static NTSTATUS create_builtin(uint32 rid)
{
NTSTATUS status = NT_STATUS_OK;
- DOM_SID sid;
+ struct dom_sid sid;
gid_t gid;
if (!sid_compose(&sid, &global_sid_Builtin, rid)) {
@@ -238,8 +238,8 @@ static NTSTATUS create_builtin(uint32 rid)
* @param[in] dom_sid sid to add as a member of builtin_sid.
* @return Normal NTSTATUS return
*/
-static NTSTATUS add_sid_to_builtin(const DOM_SID *builtin_sid,
- const DOM_SID *dom_sid)
+static NTSTATUS add_sid_to_builtin(const struct dom_sid *builtin_sid,
+ const struct dom_sid *dom_sid)
{
NTSTATUS status = NT_STATUS_OK;
@@ -267,10 +267,10 @@ static NTSTATUS add_sid_to_builtin(const DOM_SID *builtin_sid,
/*******************************************************************
*******************************************************************/
-NTSTATUS create_builtin_users(const DOM_SID *dom_sid)
+NTSTATUS create_builtin_users(const struct dom_sid *dom_sid)
{
NTSTATUS status;
- DOM_SID dom_users;
+ struct dom_sid dom_users;
status = create_builtin(BUILTIN_RID_USERS);
if ( !NT_STATUS_IS_OK(status) ) {
@@ -292,10 +292,10 @@ NTSTATUS create_builtin_users(const DOM_SID *dom_sid)
/*******************************************************************
*******************************************************************/
-NTSTATUS create_builtin_administrators(const DOM_SID *dom_sid)
+NTSTATUS create_builtin_administrators(const struct dom_sid *dom_sid)
{
NTSTATUS status;
- DOM_SID dom_admins, root_sid;
+ struct dom_sid dom_admins, root_sid;
fstring root_name;
enum lsa_SidType type;
TALLOC_CTX *ctx;
@@ -341,16 +341,16 @@ NTSTATUS create_builtin_administrators(const DOM_SID *dom_sid)
*******************************************************************/
struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx,
- const DOM_SID *user_sid,
+ const struct dom_sid *user_sid,
bool is_guest,
int num_groupsids,
- const DOM_SID *groupsids)
+ const struct dom_sid *groupsids)
{
struct nt_user_token *result = NULL;
int i;
NTSTATUS status;
gid_t gid;
- DOM_SID dom_sid;
+ struct dom_sid dom_sid;
DEBUG(10, ("Create local NT token for %s\n",
sid_string_dbg(user_sid)));
@@ -585,11 +585,11 @@ NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username,
{
NTSTATUS result = NT_STATUS_NO_SUCH_USER;
TALLOC_CTX *tmp_ctx = talloc_stackframe();
- DOM_SID user_sid;
+ struct dom_sid user_sid;
enum lsa_SidType type;
gid_t *gids;
- DOM_SID *group_sids;
- DOM_SID unix_group_sid;
+ struct dom_sid *group_sids;
+ struct dom_sid unix_group_sid;
size_t num_group_sids;
size_t num_gids;
size_t i;
@@ -715,7 +715,7 @@ NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username,
}
if (num_group_sids) {
- group_sids = TALLOC_ARRAY(tmp_ctx, DOM_SID, num_group_sids);
+ group_sids = TALLOC_ARRAY(tmp_ctx, struct dom_sid, num_group_sids);
if (group_sids == NULL) {
DEBUG(1, ("TALLOC_ARRAY failed\n"));
result = NT_STATUS_NO_MEMORY;
@@ -756,7 +756,7 @@ NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username,
}
num_group_sids = 1;
- group_sids = TALLOC_ARRAY(tmp_ctx, DOM_SID, num_group_sids);
+ group_sids = TALLOC_ARRAY(tmp_ctx, struct dom_sid, num_group_sids);
if (group_sids == NULL) {
DEBUG(1, ("TALLOC_ARRAY failed\n"));
result = NT_STATUS_NO_MEMORY;
@@ -829,7 +829,7 @@ NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username,
member of a particular group.
***************************************************************************/
-bool user_in_group_sid(const char *username, const DOM_SID *group_sid)
+bool user_in_group_sid(const char *username, const struct dom_sid *group_sid)
{
NTSTATUS status;
uid_t uid;
@@ -858,7 +858,7 @@ bool user_in_group_sid(const char *username, const DOM_SID *group_sid)
bool user_in_group(const char *username, const char *groupname)
{
TALLOC_CTX *mem_ctx = talloc_stackframe();
- DOM_SID group_sid;
+ struct dom_sid group_sid;
bool ret;
ret = lookup_name(mem_ctx, groupname, LOOKUP_NAME_ALL,