diff options
author | Andrew Bartlett <abartlet@samba.org> | 2002-06-14 02:58:03 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2002-06-14 02:58:03 +0000 |
commit | 0d7ac4bc2ca8eea117a0f594880b5aac02f1056d (patch) | |
tree | b1fa7e2a227bae1fce246f0d4869a0e4e168d36f /source3/passdb/pdb_get_set.c | |
parent | 0886638844b6ea5253cae217682c680cc7b6cec8 (diff) | |
download | samba-0d7ac4bc2ca8eea117a0f594880b5aac02f1056d.tar.gz samba-0d7ac4bc2ca8eea117a0f594880b5aac02f1056d.tar.bz2 samba-0d7ac4bc2ca8eea117a0f594880b5aac02f1056d.zip |
Patch from ctrlsoft to make the pluggable passdb subsystem use an lp_list
rather than a string when configuring mulitple backends.
Also adjust some of the users of get_global_sam_sid() to cope with the fact
that it just might not exist (uninitialised, can't access secrets.tdb).
More places need conversion.
Add some const and remove silly casts.
Andrew Bartlett
(This used to be commit c264bf2ec93037d2a9927c00295fa60c88b7219d)
Diffstat (limited to 'source3/passdb/pdb_get_set.c')
-rw-r--r-- | source3/passdb/pdb_get_set.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c index 0b5a1053ae..980850b89c 100644 --- a/source3/passdb/pdb_get_set.c +++ b/source3/passdb/pdb_get_set.c @@ -177,7 +177,7 @@ uint32 pdb_get_user_rid (const SAM_ACCOUNT *sampass) uint32 u_rid; if (sampass) - if (sid_peek_check_rid(get_global_sam_sid(), (DOM_SID *) pdb_get_user_sid(sampass),&u_rid)) + if (sid_peek_check_rid(get_global_sam_sid(), pdb_get_user_sid(sampass),&u_rid)) return u_rid; return (-1); @@ -188,7 +188,7 @@ uint32 pdb_get_group_rid (const SAM_ACCOUNT *sampass) uint32 g_rid; if (sampass) - if (sid_peek_check_rid(get_global_sam_sid(), (DOM_SID *) pdb_get_group_sid(sampass),&g_rid)) + if (sid_peek_check_rid(get_global_sam_sid(), pdb_get_group_sid(sampass),&g_rid)) return g_rid; return (-1); } @@ -537,11 +537,17 @@ BOOL pdb_set_group_sid(SAM_ACCOUNT *sampass, DOM_SID *g_sid) BOOL pdb_set_user_sid_from_rid (SAM_ACCOUNT *sampass, uint32 rid) { DOM_SID u_sid; - + const DOM_SID *global_sam_sid; + if (!sampass) return False; - sid_copy(&u_sid, get_global_sam_sid()); + if (!(global_sam_sid = get_global_sam_sid())) { + DEBUG(1, ("pdb_set_user_sid_from_rid: Could not read global sam sid!\n")); + return False; + } + + sid_copy(&u_sid, global_sam_sid); if (!sid_append_rid(&u_sid, rid)) return False; @@ -558,11 +564,17 @@ BOOL pdb_set_user_sid_from_rid (SAM_ACCOUNT *sampass, uint32 rid) BOOL pdb_set_group_sid_from_rid (SAM_ACCOUNT *sampass, uint32 grid) { DOM_SID g_sid; + const DOM_SID *global_sam_sid; if (!sampass) return False; - sid_copy(&g_sid, get_global_sam_sid()); + if (!(global_sam_sid = get_global_sam_sid())) { + DEBUG(1, ("pdb_set_user_sid_from_rid: Could not read global sam sid!\n")); + return False; + } + + sid_copy(&g_sid, global_sam_sid); if (!sid_append_rid(&g_sid, grid)) return False; |