error-code checking in lsa_lookup_sids. anonymous connections for
authorLuke Leighton <lkcl@samba.org>
Fri, 1 Oct 1999 18:11:57 +0000 (18:11 +0000)
committerLuke Leighton <lkcl@samba.org>
Fri, 1 Oct 1999 18:11:57 +0000 (18:11 +0000)
domain info.  adjusting net_srv_get_info function.
(This used to be commit 42eb916fae0d377f8908dfc42b332e6a53c4e2d9)

source3/include/proto.h
source3/rpc_client/cli_lsarpc.c
source3/rpcclient/cmd_samr.c
source3/rpcclient/cmd_srvsvc.c

index f391f19879756ecc32c3dcef97b182988e41bb49..4326cb4762d4696ebf7cce6476ccc38e0d07465b 100644 (file)
@@ -3189,6 +3189,9 @@ void cmd_sam_enum_groups(struct client_info *info);
 
 /*The following definitions come from  rpcclient/cmd_srvsvc.c  */
 
+BOOL net_srv_get_info(struct client_info *info,
+               uint32 info_level,
+               SRV_INFO_CTR *ctr);
 void cmd_srv_query_info(struct client_info *info);
 void cmd_srv_enum_conn(struct client_info *info);
 void cmd_srv_enum_shares(struct client_info *info);
index 45ec91d37c65e82bd04ba71337169f53fca368a9..002e98572d7439e5a084f64ae1b7fa1c94744067 100644 (file)
@@ -407,7 +407,7 @@ BOOL lsa_lookup_sids(struct cli_state *cli, uint16 fnum,
                
                if (p && r_l.status != 0 &&
                         r_l.status != 0x107 &&
-                        r_l.status != 0xC0000000 | NT_STATUS_NONE_MAPPED)
+                        r_l.status != (0xC0000000 | NT_STATUS_NONE_MAPPED))
                {
                        /* report error code */
                        DEBUG(1,("LSA_LOOKUP_SIDS: %s\n", get_nt_error_msg(r_l.status)));
index 08dedac7013d1bb1d1bf4fbe6498c26f5525c69b..1d2940384222d8ff15c698c9472110d3f30e7d1d 100644 (file)
@@ -1676,7 +1676,7 @@ void cmd_sam_query_dominfo(struct client_info *info)
        BOOL res = True;
        fstring info_str;
        uint32 switch_value = 2;
-       uint32 ace_perms = 0x304; /* absolutely no idea. */
+       uint32 ace_perms = 0x02000000; /* absolutely no idea. */
        SAM_UNK_CTR ctr;
 
        sid_to_string(sid, &info->dom.level5_sid);
index c433908e202971b3c32720c57891bbef37f98435..547b39b2b8410d1ff0467f840b54ddacbb187468 100644 (file)
@@ -41,43 +41,54 @@ extern FILE* out_hnd;
 /****************************************************************************
 server get info query
 ****************************************************************************/
-void cmd_srv_query_info(struct client_info *info)
+BOOL net_srv_get_info(struct client_info *info,
+               uint32 info_level,
+               SRV_INFO_CTR *ctr)
 {
        uint16 nt_pipe_fnum;
        fstring dest_srv;
-       fstring tmp;
-       SRV_INFO_CTR ctr;
-       uint32 info_level = 101;
 
        BOOL res = True;
 
-       bzero(&ctr, sizeof(ctr));
-
        fstrcpy(dest_srv, "\\\\");
        fstrcat(dest_srv, info->dest_host);
        strupper(dest_srv);
 
-       if (next_token(NULL, tmp, NULL, sizeof(tmp)-1))
-       {
-               info_level = (uint32)strtol(tmp, (char**)NULL, 10);
-       }
-
-       DEBUG(4,("cmd_srv_query_info: server:%s info level: %d\n",
+       DEBUG(4,("net_srv_get_info: server:%s info level: %d\n",
                                dest_srv, (int)info_level));
 
-       DEBUG(5, ("cmd_srv_query_info: smb_cli->fd:%d\n", smb_cli->fd));
-
        /* open LSARPC session. */
        res = res ? cli_nt_session_open(smb_cli, PIPE_SRVSVC, &nt_pipe_fnum) : False;
 
        /* send info level: receive requested info.  hopefully. */
        res = res ? do_srv_net_srv_get_info(smb_cli, nt_pipe_fnum,
-                               dest_srv, info_level, &ctr) : False;
+                               dest_srv, info_level, ctr) : False;
 
        /* close the session */
        cli_nt_session_close(smb_cli, nt_pipe_fnum);
 
-       if (res)
+       return res;
+}
+
+/****************************************************************************
+server get info query
+****************************************************************************/
+void cmd_srv_query_info(struct client_info *info)
+{
+       uint32 info_level = 101;
+       SRV_INFO_CTR ctr;
+       fstring tmp;
+
+       bzero(&ctr, sizeof(ctr));
+
+       if (next_token(NULL, tmp, NULL, sizeof(tmp)-1))
+       {
+               info_level = (uint32)strtol(tmp, (char**)NULL, 10);
+       }
+
+       DEBUG(5, ("cmd_srv_query_info: smb_cli->fd:%d\n", smb_cli->fd));
+
+       if (net_srv_get_info(info, info_level, &ctr))
        {
                DEBUG(5,("cmd_srv_query_info: query succeeded\n"));