1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

Changes from APPLIANCE_HEAD:

source/rpc_parse/parse_lsa.c
        - off by one unistr length bug in init_lsa_trans_name()

    source/lib/util_sid.c
        - resolve more BUILTIN sid values to names.

    source/nsswitch/wb_client.c
        - fix typo in debug message
        - set errno on error so we don't get bogus value from last failure.

    source/rpc_server/srv_spoolss_nt.c
        - add debug to track number of open printer handles for ease of
          tracking handle leaks in the future.

    source/rpc_server/srv_lsa.c
        - fix off-by-one string bug.  This was preventing NT from
          displaying names for well-know SIDs in printer permissions
          dialog.
(This used to be commit 59229b9025)
This commit is contained in:
David O'Neill 2001-01-15 18:36:50 +00:00
parent 99f3694436
commit 27922c0430
5 changed files with 24 additions and 10 deletions

View File

@ -76,8 +76,14 @@ static known_sid_users nt_authority_users[] = {
{ 18, SID_NAME_ALIAS, "SYSTEM"},
{ 0, (enum SID_NAME_USE)0, NULL}};
static known_sid_users builtin_users[] = {
{ DOMAIN_USER_RID_ADMIN, SID_NAME_USER, "Administrator" },
static known_sid_users builtin_groups[] = {
{ BUILTIN_ALIAS_RID_ADMINS, SID_NAME_ALIAS, "Administrators" },
{ BUILTIN_ALIAS_RID_USERS, SID_NAME_ALIAS, "Users" },
{ BUILTIN_ALIAS_RID_GUESTS, SID_NAME_ALIAS, "Guests" },
{ BUILTIN_ALIAS_RID_ACCOUNT_OPS, SID_NAME_ALIAS, "Account Operators" },
{ BUILTIN_ALIAS_RID_SYSTEM_OPS, SID_NAME_ALIAS, "Server Operators" },
{ BUILTIN_ALIAS_RID_PRINT_OPS, SID_NAME_ALIAS, "Print Operators" },
{ BUILTIN_ALIAS_RID_BACKUP_OPS, SID_NAME_ALIAS, "Backup Operators" },
{ 0, (enum SID_NAME_USE)0, NULL}};
static struct sid_name_map_info
@ -90,8 +96,7 @@ sid_name_map[] =
{
{ &global_sam_sid, global_myname, NULL},
{ &global_sam_sid, global_myworkgroup, NULL},
{ &global_sid_Builtin, "BUILTIN", NULL},
{ &global_sid_Builtin, "", &builtin_users[0]},
{ &global_sid_Builtin, "BUILTIN", &builtin_groups[0]},
{ &global_sid_World_Domain, "", &everyone_users[0] },
{ &global_sid_Creator_Owner_Domain, "", &creator_owner_users[0] },
{ &global_sid_NT_Authority, "NT Authority", &nt_authority_users[0] },

View File

@ -266,8 +266,8 @@ int winbind_initgroups(char *user, gid_t gid)
result = wb_getgroups(user, &groups);
DEBUG(10,("wb_getgroups: %s: result = %s\n", user, result == -1 ?
"FAIL" : "SUCCESS"));
DEBUG(10,("winbind_getgroups: %s: result = %s\n", user,
result == -1 ? "FAIL" : "SUCCESS"));
if (result != -1) {
int ngroups = result, i;
@ -303,6 +303,13 @@ int winbind_initgroups(char *user, gid_t gid)
result = -1;
goto done;
}
} else {
/* The call failed. Set errno to something so we don't get
a bogus value from the last failed system call. */
errno = EIO;
}
/* Free response data if necessary */

View File

@ -34,7 +34,7 @@ static BOOL lsa_io_trans_names(char *desc, LSA_TRANS_NAME_ENUM *trn, prs_struct
void init_lsa_trans_name(LSA_TRANS_NAME *trn, UNISTR2 *uni_name,
uint16 sid_name_use, char *name, uint32 idx)
{
int len_name = strlen(name)+1;
int len_name = strlen(name);
if(len_name == 0)
len_name = 1;

View File

@ -88,13 +88,13 @@ Init dom_query
static void init_dom_query(DOM_QUERY *d_q, char *dom_name, DOM_SID *dom_sid)
{
int domlen = (dom_name != NULL) ? strlen(dom_name)+1 : 0;
int domlen = (dom_name != NULL) ? strlen(dom_name) : 0;
d_q->uni_dom_max_len = domlen * 2;
d_q->uni_dom_str_len = domlen * 2;
d_q->buffer_dom_name = (dom_name != 0) ? 1 : 0;
d_q->buffer_dom_sid = (dom_sid != NULL) ? 1 : 0;
d_q->buffer_dom_name = dom_name ? 1 : 0;
d_q->buffer_dom_sid = dom_sid ? 1 : 0;
/* this string is supposed to be character short */
init_unistr2(&d_q->uni_domain_name, dom_name, domlen);

View File

@ -526,6 +526,8 @@ static BOOL open_printer_hnd(POLICY_HND *hnd, char *name)
return False;
}
DEBUG(5, ("%d printer handles active\n", ubi_dlCount(&Printer_list)));
return True;
}