interesting. this is quite a problem, i don't know the solution, yet.
authorLuke Leighton <lkcl@samba.org>
Thu, 10 Feb 2000 14:13:35 +0000 (14:13 +0000)
committerLuke Leighton <lkcl@samba.org>
Thu, 10 Feb 2000 14:13:35 +0000 (14:13 +0000)
client-side security contexts from msrpc functions *called* in smbd
are being confused with server-side security contexts in pass-through
(loop-back) msrpc functions!

source/lib/util_hnd.c
source/msrpc/msrpcd_process.c
source/rpc_client/cli_connect.c
source/samrd/srv_samr_usr_tdb.c

index 267b92eb3b372ca522577d35dab517c7a55fde6d..408f1140dc72cf0dd1188c07399910c799c6ddce 100644 (file)
@@ -360,6 +360,11 @@ BOOL pol_get_usr_sesskey(struct policy_cache *cache, const POLICY_HND *hnd,
        {
                return False;
        }
+       if (key->vuid == UID_FIELD_INVALID)
+       {
+               memset(usr_sess_key, 0, 16);
+               return True;
+       }
        vuser = get_valid_user_struct(key);
        if (vuser == NULL)
        {
index 95b50039d9d71f5d887d9b174c4f93fdb980395c..d7f5c48f498ac7adb0e9fbef39e15ca2214af0e2 100644 (file)
@@ -337,7 +337,7 @@ void add_srv_auth_fn(rpcsrv_struct *l, srv_auth_fns *fn)
 BOOL msrpcd_init(int c, rpcsrv_struct **l)
 {
        vuser_key uk;
-       user_struct *vuser;
+       user_struct *vuser = NULL;
 
        if (!get_user_creds(c, &uk))
        {
@@ -345,20 +345,25 @@ BOOL msrpcd_init(int c, rpcsrv_struct **l)
                return False;
        }
 
-       if (uk.vuid == UID_FIELD_INVALID)
+       if (uk.vuid != UID_FIELD_INVALID)
        {
-               return False;
-       }
+               if (!become_vuser(&uk))
+               {
+                       return False;
+               }
 
-       if (!become_vuser(&uk))
-       {
-               return False;
+               vuser = get_valid_user_struct(&uk);
+               if (vuser == NULL)
+               {
+                       return False;
+               }
        }
-
-       vuser = get_valid_user_struct(&uk);
-       if (vuser == NULL)
+       else
        {
-               return False;
+               if (!become_guest())
+               {
+                       return False;
+               }
        }
 
        (*l) = malloc(sizeof(*(*l)));
@@ -373,7 +378,7 @@ BOOL msrpcd_init(int c, rpcsrv_struct **l)
        (*l)->key = uk;
        (*l)->c = c;
 
-       if (!vuser->guest)
+       if (vuser != NULL && !vuser->guest)
        {
                char *user = vuser->name;
                if (!strequal(user,lp_guestaccount(-1)) &&
index a80928173869514b7736f263fd99d1be8dc8fa5f..15efec7c83cbf8c3980df908f5298f3827e99498 100644 (file)
@@ -123,6 +123,7 @@ static struct cli_connection *cli_con_get(const char* srv_name,
        }
        else
        {
+#if 0
                NET_USER_INFO_3 usr;
                uid_t uid = getuid();
                gid_t gid = getgid();
@@ -133,8 +134,11 @@ static struct cli_connection *cli_con_get(const char* srv_name,
                con_key.pid = getpid();
                con_key.vuid = register_vuid(con_key.pid,
                                             uid, gid,
-                                            name, name, False,
+                                    name, name, False,
                                             &usr);
+#endif
+               con_key.pid = getpid();
+               con_key.vuid = UID_FIELD_INVALID;
        }
 
        if (srv_name != NULL)
index 012ac6859cf812c5e28850cacad7ca6a71ffec18..c979217571b4b68671df0126143e612496499d21 100644 (file)
@@ -570,6 +570,7 @@ uint32 _samr_set_userinfo(const POLICY_HND *pol, uint16 switch_value,
                        SAM_USER_INFO_12 *id12 = ctr->info.id12;
                        if (!set_user_info_12(tdb_usr, rid, id12))
                        {
+                               DEBUG(10,("_samr_set_userinfo 0x12 failed\n"));
                                return NT_STATUS_ACCESS_DENIED;
                        }
                        break;