- initialising mach_passwd_file locks to zero (prev. uninit.)
authorLuke Leighton <lkcl@samba.org>
Sun, 12 Sep 1999 22:40:27 +0000 (22:40 +0000)
committerLuke Leighton <lkcl@samba.org>
Sun, 12 Sep 1999 22:40:27 +0000 (22:40 +0000)
- cleanup

- #defined report to sprintf as it's #defined to another function in
  other uses of cmd_lsarpc.c

source/include/rpcclient.h
source/passdb/smbpassfile.c
source/rpc_client/cli_lsarpc.c
source/rpc_client/cli_srvsvc.c
source/rpc_parse/parse_lsa.c
source/rpcclient/cmd_lsarpc.c
source/smbd/process.c

index 4380c1236fcc773bc017529870604321db0b55ed..2835203ca813043093842aacc8976aff380e6620 100644 (file)
@@ -24,6 +24,8 @@
 #ifndef _RPCCLIENT_H
 #define _RPCCLIENT_H
 
+#define report fprintf
+
 struct tar_client_info
 {
     int blocksize;
index ecf9efe303e24a6f63bc9cffae1483c01f340f6c..83b0e7ef6b672fab8f1ffde79b4d7a087fccd1c2 100644 (file)
@@ -22,8 +22,8 @@
 extern int DEBUGLEVEL;
 
 BOOL global_machine_password_needs_changing = False;
-static int mach_passwd_lock_depth;
-static FILE *mach_passwd_fp;
+static int mach_passwd_lock_depth = 0;
+static FILE *mach_passwd_fp = NULL;
 
 /************************************************************************
  Routine to get the name for a trust account file.
index 1c764c8b989b7aa44a42ad9ef05a41a9a9b82aa5..af009493250076e572904f8acc12caf6fb887956 100644 (file)
@@ -264,7 +264,7 @@ BOOL lsa_lookup_names(struct cli_state *cli, uint16 fnum,
                if (p && r_l.status != 0)
                {
                        /* report error code */
-                       DEBUG(0,("LSA_LOOKUP_NAMES: %s\n", get_nt_error_msg(r_l.status)));
+                       DEBUG(1,("LSA_LOOKUP_NAMES: %s\n", get_nt_error_msg(r_l.status)));
                        p = False;
                }
 
@@ -390,10 +390,10 @@ BOOL lsa_lookup_sids(struct cli_state *cli, uint16 fnum,
                lsa_io_r_lookup_sids("", &r_l, &rbuf, 0);
                p = rbuf.offset != 0;
                
-               if (p && r_l.status != 0)
+               if (p && r_l.status != 0 && r_l.status != 0x107)
                {
                        /* report error code */
-                       DEBUG(0,("LSA_LOOKUP_SIDS: %s\n", get_nt_error_msg(r_l.status)));
+                       DEBUG(1,("LSA_LOOKUP_SIDS: %s\n", get_nt_error_msg(r_l.status)));
                        p = False;
                }
 
index 5e4af69c6aa7676a0a6882aa80fcd84fdfe3a57f..c3d608c4b3f7e3482e8314c25c4d65e982cbac4e 100644 (file)
@@ -160,7 +160,7 @@ BOOL do_srv_net_srv_sess_enum(struct cli_state *cli, uint16 fnum,
                if (p && r_o.status != 0)
                {
                        /* report error code */
-                       DEBUG(0,("SRV_R_NET_SRV_GET_INFO: %s\n", get_nt_error_msg(r_o.status)));
+                       DEBUG(0,("SRV_R_NET_SRV_SESS_ENUM: %s\n", get_nt_error_msg(r_o.status)));
                        p = 0;
                }
 
index dbcc9d8bccd2f4c9e4d82d15cb0812bb9fe7c204..cff4c027e180d734c0f38827ce58880d51099ca7 100644 (file)
@@ -493,7 +493,7 @@ void make_q_query_secret(LSA_Q_QUERY_SECRET *q_q, POLICY_HND *pol)
 {
        if (q_q == NULL) return;
 
-       DEBUG(5,("make_q_query_secret"));
+       DEBUG(5,("make_q_query_secret\n"));
 
        memcpy(&(q_q->pol), pol, sizeof(q_q->pol));
 
index 101100e66d6911b2009e16eb352ae2a3f16e96c9..57336362d16260fd5606f348ff6189290aa9d8f7 100644 (file)
@@ -21,7 +21,6 @@
 */
 
 
-
 #ifdef SYSLOG
 #undef SYSLOG
 #endif
@@ -33,11 +32,10 @@ extern int DEBUGLEVEL;
 
 #define DEBUG_TESTING
 
-extern struct cli_state *smb_cli;
-extern int smb_tidx;
-
 extern FILE* out_hnd;
 
+extern struct cli_state *smb_cli;
+extern int smb_tidx;
 
 /****************************************************************************
 nt lsa query
@@ -93,25 +91,25 @@ void cmd_lsa_query_info(struct client_info *info)
                fstring sid;
                DEBUG(5,("cmd_lsa_query_info: query succeeded\n"));
 
-               fprintf(out_hnd, "LSA Query Info Policy\n");
+               report(out_hnd, "LSA Query Info Policy\n");
 
                if (info->dom.level3_dom[0] != 0)
                {
                        sid_to_string(sid, &info->dom.level3_sid);
-                       fprintf(out_hnd, "Domain Member     - Domain: %s SID: %s\n",
+                       report(out_hnd, "Domain Member     - Domain: %s SID: %s\n",
                                info->dom.level3_dom, sid);
                        domain_something = True;
                }
                if (info->dom.level5_dom[0] != 0)
                {
                        sid_to_string(sid, &info->dom.level5_sid);
-                       fprintf(out_hnd, "Domain Controller - Domain: %s SID: %s\n",
+                       report(out_hnd, "Domain Controller - Domain: %s SID: %s\n",
                                info->dom.level5_dom, sid);
                        domain_something = True;
                }
                if (!domain_something)
                {
-                       fprintf(out_hnd, "%s is not a Domain Member or Controller\n",
+                       report(out_hnd, "%s is not a Domain Member or Controller\n",
                            info->dest_host);
                }
        }
@@ -154,7 +152,7 @@ void cmd_lsa_lookup_names(struct client_info *info)
 
        if (num_names == 0)
        {
-               fprintf(out_hnd, "lookupnames <name> [<name> ...]\n");
+               report(out_hnd, "lookupnames <name> [<name> ...]\n");
                return;
        }
 
@@ -188,11 +186,11 @@ void cmd_lsa_lookup_names(struct client_info *info)
 
        if (sids != NULL)
        {
-               fprintf(out_hnd,"Lookup Names:\n");
+               report(out_hnd, "Lookup Names:\n");
                for (i = 0; i < num_sids; i++)
                {
                        sid_to_string(temp, &sids[i]);
-                       fprintf(out_hnd, "SID: %s -> %s\n", names[i], temp);
+                       report(out_hnd, "SID: %s -> %s\n", names[i], temp);
 #if 0
                        if (sids[i] != NULL)
                        {
@@ -248,7 +246,7 @@ void cmd_lsa_lookup_sids(struct client_info *info)
 
                        if (sid_name[0] == 0)
                        {
-                               fprintf(out_hnd, "please use lsaquery first or specify a complete SID\n");
+                               report(out_hnd, "please use lsaquery first or specify a complete SID\n");
                                return;
                        }
                                
@@ -262,7 +260,7 @@ void cmd_lsa_lookup_sids(struct client_info *info)
 
        if (num_sids == 0)
        {
-               fprintf(out_hnd, "lookupsid RID or SID\n");
+               report(out_hnd, "lookupsid RID or SID\n");
                return;
        }
 
@@ -295,11 +293,11 @@ void cmd_lsa_lookup_sids(struct client_info *info)
        }
        if (names != NULL)
        {
-               fprintf(out_hnd,"Lookup SIDS:\n");
+               report(out_hnd, "Lookup SIDS:\n");
                for (i = 0; i < num_names; i++)
                {
                        sid_to_string(temp, sids[i]);
-                       fprintf(out_hnd, "SID: %s -> %s\n", temp, names[i]);
+                       report(out_hnd, "SID: %s -> %s\n", temp, names[i]);
                        if (names[i] != NULL)
                        {
                                free(names[i]);
@@ -329,7 +327,7 @@ void cmd_lsa_query_secret(struct client_info *info)
 
        if (!next_token(NULL, secret_name, NULL, sizeof(secret_name)))
        {
-               fprintf(out_hnd, "querysecret <secret name>\n");
+               report(out_hnd, "querysecret <secret name>\n");
                return;
        }
 
@@ -350,7 +348,7 @@ void cmd_lsa_query_secret(struct client_info *info)
        /* lookup domain controller; receive a policy handle */
        res1 = res ? lsa_open_secret(smb_cli, nt_pipe_fnum,
                                &info->dom.lsa_info_pol,
-                               secret_name, 0x20003, &hnd_secret) : False;
+                               secret_name, 0xf003f, &hnd_secret) : False;
 
        res2 = res1 ? lsa_query_secret(smb_cli, nt_pipe_fnum,
                               &hnd_secret, &enc_secret, &last_update) : False;
@@ -364,18 +362,18 @@ void cmd_lsa_query_secret(struct client_info *info)
 
        if (res2 && nt_decrypt_string2(&secret, &enc_secret, smb_cli->pwd.smb_nt_pwd))
        {
-               fprintf(out_hnd, "\tValue       : ");
+               report(out_hnd, "\tValue       : ");
                for (i = 0; i < secret.str_str_len; i++)
                {
-                       fprintf(out_hnd, "%02X", secret.buffer[i]);
+                       report(out_hnd, "%02X", secret.buffer[i]);
                }
 
-               fprintf(out_hnd, "\n\tLast Updated: %s\n\n",
+               report(out_hnd, "\n\tLast Updated: %s\n\n",
                        http_timestring(nt_time_to_unix(&last_update)));
        }
        else
        {
-               fprintf(out_hnd, "LSA Query Secret: failed\n");
+               report(out_hnd, "LSA Query Secret: failed\n");
        }
 }
 
index 13dd932a57236feb9af78f698cad4ae0eaefd9b3..e9fb230624c4fb4ebf268575053f274f594cb169 100644 (file)
@@ -778,7 +778,6 @@ void smbd_process(void)
   {
     extern fstring remote_machine;
     extern fstring local_machine;
-    char *s;
 
     fstrcpy(remote_machine, dns_to_netbios_name(client_name(Client)));
     fstrcpy(local_machine, global_myname);