find client state. server name, user name, domain name and password must all
match.
****************************************************************************/
-static struct msrpc_use *msrpc_find(const char* pipe_name)
+static struct msrpc_use *msrpc_find(const char* pipe_name, const vuser_key *key)
{
int i;
{
char *msrpc_name = NULL;
struct msrpc_use *c = msrpcs[i];
+ vuser_key k;
if (c == NULL) continue;
msrpc_name = c->cli->pipe_name;
+ k = c->cli->nt.key;
- DEBUG(10,("msrpc_find[%d]: %s\n", i, msrpc_name));
+ DEBUG(10,("msrpc_find[%d]: %s [%d,%x]\n",
+ i, msrpc_name, k.pid, k.vuid));
- if (strequal(msrpc_name, pipe_name))
+ if (strequal(msrpc_name, pipe_name) &&
+ (key == NULL || (k.pid == key->pid && k.vuid == key->vuid)))
{
return c;
}
struct msrpc_use *cli;
DEBUG(10,("msrpc_use_add: %s redir: %s\n", pipe_name, BOOLSTR(redir)));
- cli = msrpc_find(pipe_name);
+ cli = msrpc_find(pipe_name, key);
if (cli != NULL)
{
struct passwd *hashed_getpwnam(const char *name)
{
+#if 0
struct passwd_hash_table_s *pht=&passwd_hash_table;
DEBUG(5,("getpwnam(%s)\n", name));
-#if 0
if (have_passwd_hash())
{
int name_i=name_hash_function(name);
char *uidtoname(uid_t uid)
{
static char name[40];
- struct passwd_hash_table_s *pht=&passwd_hash_table;
struct passwd *pass=NULL;
+#if 0
+ struct passwd_hash_table_s *pht=&passwd_hash_table;
DEBUG(5,("uidtoname(%d)\n",uid));
-#if 0
if (have_passwd_hash()) {
int hash_index=pht->uids[uid_hash_function(uid)];
while(hash_index!=-1) {
const vuser_key *key = get_policy_vuser_key(cache, hnd);
user_struct *vuser;
- if (key == NULL)
- {
- return False;
- }
- if (key->vuid == UID_FIELD_INVALID)
+ if (key == NULL || key->vuid == UID_FIELD_INVALID)
{
memset(usr_sess_key, 0, 16);
return True;
}
else
{
-#if 0
NET_USER_INFO_3 usr;
uid_t uid = getuid();
gid_t gid = getgid();
uid, gid,
name, name, False,
&usr);
-#endif
- con_key.pid = getpid();
- con_key.vuid = UID_FIELD_INVALID;
}
if (srv_name != NULL)
if (tdb_writelock(tdb) != 0)
{
+ DEBUG(5,("tdb_set_userinfo_pwds: write lock failed\n"));
return False;
}
SamOEMhash(id24->pass, user_sess_key, True);
if (!set_user_info_24(tdb_usr, rid, id24))
{
+ DEBUG(10,("_samr_set_userinfo 0x18 failed\n"));
return NT_STATUS_ACCESS_DENIED;
}
break;