Print this page
1575 untangle libmlrpc ... pre2:
Get rid of ndr_rpc_server_{info,os}
@@ -381,11 +381,10 @@
lsar_lookup_names3,
lsar_lookup_names2,
lsar_lookup_names1
};
- const srvsvc_server_info_t *svinfo;
lsa_names_t names;
char *p;
uint32_t length;
uint32_t status = NT_STATUS_INVALID_PARAMETER;
int n_op = (sizeof (ops) / sizeof (ops[0]));
@@ -394,44 +393,34 @@
if (lsa_handle == NULL || name == NULL || info == NULL)
return (NT_STATUS_INVALID_PARAMETER);
bzero(info, sizeof (smb_account_t));
- svinfo = ndr_rpc_server_info(lsa_handle);
- if (svinfo->sv_os == NATIVE_OS_WIN2000 &&
- svinfo->sv_version_major == 5 && svinfo->sv_version_minor == 0) {
/*
- * Windows 2000 doesn't like an LSA lookup for
+ * Windows 2000 (or later) doesn't like an LSA lookup for
* DOMAIN\Administrator.
*/
if ((p = strchr(name, '\\')) != 0) {
++p;
if (strcasecmp(p, "administrator") == 0)
name = p;
}
- }
-
length = smb_wcequiv_strlen(name);
names.name[0].length = length;
names.name[0].allosize = length;
names.name[0].str = (unsigned char *)name;
names.n_entry = 1;
- if (ndr_rpc_server_os(lsa_handle) == NATIVE_OS_WIN2000) {
for (i = 0; i < n_op; ++i) {
ndr_rpc_set_nonull(lsa_handle);
status = (*ops[i])(lsa_handle, &names, info);
if (status != NT_STATUS_INVALID_PARAMETER)
break;
}
- } else {
- ndr_rpc_set_nonull(lsa_handle);
- status = lsar_lookup_names1(lsa_handle, &names, info);
- }
if (status == NT_STATUS_SUCCESS) {
info->a_name = lsar_get_username(name);
if (!smb_account_validate(info)) {
@@ -724,14 +713,12 @@
bzero(account, sizeof (smb_account_t));
bzero(sidbuf, SMB_SID_STRSZ);
smb_sid_tostr(sid, sidbuf);
smb_tracef("%s", sidbuf);
- if (ndr_rpc_server_os(lsa_handle) == NATIVE_OS_WIN2000)
- status = lsar_lookup_sids2(lsa_handle, (lsa_sid_t *)sid,
- account);
- else
+ status = lsar_lookup_sids2(lsa_handle, (lsa_sid_t *)sid, account);
+ if (status == RPC_NT_PROCNUM_OUT_OF_RANGE)
status = lsar_lookup_sids1(lsa_handle, (lsa_sid_t *)sid,
account);
if (status == NT_STATUS_SUCCESS) {
if (!smb_account_validate(account)) {
@@ -1165,11 +1152,10 @@
bzero(&arg, sizeof (struct mslsa_LookupPrivValue));
(void) memcpy(&arg.handle, lsa_handle, sizeof (mslsa_handle_t));
length = smb_wcequiv_strlen(name);
- if (ndr_rpc_server_os(lsa_handle) == NATIVE_OS_WIN2000)
length += sizeof (smb_wchar_t);
arg.name.length = length;
arg.name.allosize = length;
arg.name.str = (unsigned char *)name;