Author: herb
Date: 2006-12-12 17:38:42 +0000 (Tue, 12 Dec 2006)
New Revision: 20124

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20124

Log:
clean up nested extern declaration warnings


Modified:
   branches/SAMBA_3_0/source/client/smbmount.c
   branches/SAMBA_3_0/source/include/smb_macros.h
   branches/SAMBA_3_0/source/libsmb/clientgen.c
   branches/SAMBA_3_0/source/modules/vfs_expand_msdfs.c
   branches/SAMBA_3_0/source/modules/vfs_full_audit.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_ads.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_util.c
   branches/SAMBA_3_0/source/printing/print_generic.c
   branches/SAMBA_3_0/source/printing/printing.c
   branches/SAMBA_3_0/source/smbd/blocking.c
   branches/SAMBA_3_0/source/smbd/nttrans.c
   branches/SAMBA_3_0/source/smbd/sesssetup.c


Changeset:
Modified: branches/SAMBA_3_0/source/client/smbmount.c
===================================================================
--- branches/SAMBA_3_0/source/client/smbmount.c 2006-12-12 17:37:41 UTC (rev 
20123)
+++ branches/SAMBA_3_0/source/client/smbmount.c 2006-12-12 17:38:42 UTC (rev 
20124)
@@ -26,6 +26,8 @@
 
 extern BOOL in_client;
 extern pstring user_socket_options;
+extern char *optarg;
+extern int optind;
 
 static pstring credentials;
 static pstring my_netbios_name;
@@ -712,7 +714,6 @@
        int opt;
        char *opts;
        char *opteq;
-       extern char *optarg;
        int val;
        char *p;
 
@@ -862,8 +863,6 @@
 ****************************************************************************/
  int main(int argc,char *argv[])
 {
-       extern char *optarg;
-       extern int optind;
        char *p;
 
        DEBUGLEVEL = 1;

Modified: branches/SAMBA_3_0/source/include/smb_macros.h
===================================================================
--- branches/SAMBA_3_0/source/include/smb_macros.h      2006-12-12 17:37:41 UTC 
(rev 20123)
+++ branches/SAMBA_3_0/source/include/smb_macros.h      2006-12-12 17:38:42 UTC 
(rev 20124)
@@ -86,10 +86,10 @@
 #define IS_IPC(conn)       ((conn) && (conn)->ipc)
 #define IS_PRINT(conn)       ((conn) && (conn)->printer)
 /* you must add the following extern declaration to files using this macro
+ * (do not add it to the macro as that causes nested extern declaration 
warnings)
  * extern struct current_user current_user;
  */
 #define FSP_BELONGS_CONN(fsp,conn) do {\
-                       extern struct current_user current_user;\
                        if (!((fsp) && (conn) && ((conn)==(fsp)->conn) && 
(current_user.vuid==(fsp)->vuid))) \
                                return ERROR_NT(NT_STATUS_INVALID_HANDLE); \
                        } while(0)
@@ -97,10 +97,10 @@
 #define FNUM_OK(fsp,c) ((fsp) && !(fsp)->is_directory && (c)==(fsp)->conn && 
current_user.vuid==(fsp)->vuid)
 
 /* you must add the following extern declaration to files using this macro
+ * (do not add it to the macro as that causes nested extern declaration 
warnings)
  * extern struct current_user current_user;
  */
 #define CHECK_FSP(fsp,conn) do {\
-                       extern struct current_user current_user;\
                        if (!(fsp) || !(conn)) \
                                return ERROR_NT(NT_STATUS_INVALID_HANDLE); \
                        else if (((conn) != (fsp)->conn) || current_user.vuid 
!= (fsp)->vuid) \

Modified: branches/SAMBA_3_0/source/libsmb/clientgen.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/clientgen.c        2006-12-12 17:37:41 UTC 
(rev 20123)
+++ branches/SAMBA_3_0/source/libsmb/clientgen.c        2006-12-12 17:38:42 UTC 
(rev 20124)
@@ -20,6 +20,8 @@
 
 #include "includes.h"
 
+extern int smb_read_error;
+
 /****************************************************************************
  Change the timeout (in milliseconds).
 ****************************************************************************/
@@ -79,7 +81,6 @@
 
 BOOL cli_receive_smb(struct cli_state *cli)
 {
-       extern int smb_read_error;
        BOOL ret;
 
        /* fd == -1 causes segfaults -- Tom ([EMAIL PROTECTED]) */

Modified: branches/SAMBA_3_0/source/modules/vfs_expand_msdfs.c
===================================================================
--- branches/SAMBA_3_0/source/modules/vfs_expand_msdfs.c        2006-12-12 
17:37:41 UTC (rev 20123)
+++ branches/SAMBA_3_0/source/modules/vfs_expand_msdfs.c        2006-12-12 
17:38:42 UTC (rev 20124)
@@ -23,6 +23,8 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_VFS
 
+extern userdom_struct current_user_info;
+
 /**********************************************************
   Under mapfile we expect a table of the following format:
 
@@ -110,7 +112,6 @@
        int filename_len;
        pstring targethost;
        pstring new_target;
-       extern userdom_struct current_user_info;
 
        if (filename_start == NULL) {
                DEBUG(10, ("No filename start in %s\n", target));

Modified: branches/SAMBA_3_0/source/modules/vfs_full_audit.c
===================================================================
--- branches/SAMBA_3_0/source/modules/vfs_full_audit.c  2006-12-12 17:37:41 UTC 
(rev 20123)
+++ branches/SAMBA_3_0/source/modules/vfs_full_audit.c  2006-12-12 17:38:42 UTC 
(rev 20124)
@@ -60,6 +60,8 @@
 
 #include "includes.h"
 
+extern userdom_struct current_user_info;
+
 static int vfs_full_audit_debug_level = DBGC_VFS;
 
 struct vfs_full_audit_private_data {
@@ -647,7 +649,6 @@
 static char *audit_prefix(connection_struct *conn)
 {
        static pstring prefix;
-       extern userdom_struct current_user_info;
 
        pstrcpy(prefix, lp_parm_const_string(SNUM(conn), "full_audit",
                                             "prefix", "%u|%I"));

Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_ads.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_ads.c   2006-12-12 17:37:41 UTC 
(rev 20123)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_ads.c   2006-12-12 17:38:42 UTC 
(rev 20124)
@@ -30,6 +30,8 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_WINBIND
 
+extern struct winbindd_methods reconnect_methods;
+
 /*
   return our ads connections structure for a domain. We keep the connection
   open to make things faster
@@ -117,7 +119,6 @@
                    server, fall back to MSRPC */
                if (status.error_type == ENUM_ADS_ERROR_SYSTEM &&
                    status.err.rc == ECONNREFUSED) {
-                       extern struct winbindd_methods reconnect_methods;
                        /* 'reconnect_methods' is the MS-RPC backend. */
                        DEBUG(1,("Trying MSRPC methods\n"));
                        domain->backend = &reconnect_methods;

Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c 2006-12-12 17:37:41 UTC 
(rev 20123)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c 2006-12-12 17:38:42 UTC 
(rev 20124)
@@ -29,6 +29,12 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_WINBIND
 
+extern struct winbindd_methods reconnect_methods;
+extern BOOL opt_nocache;
+#ifdef HAVE_ADS
+extern struct winbindd_methods ads_methods;
+#endif
+
 /* Global online/offline state - False when online. winbindd starts up online
    and sets this to true if the first query fails and there's an entry in
    the cache tdb telling us to stay offline. */
@@ -112,10 +118,7 @@
         */
 
        if (!domain->backend) {
-               extern struct winbindd_methods reconnect_methods;
 #ifdef HAVE_ADS
-               extern struct winbindd_methods ads_methods;
-
                /* find our domain first so we can figure out if we 
                   are joined to a kerberized domain */
 
@@ -558,8 +561,6 @@
        char *kstr;
        struct cache_entry *centry;
 
-       extern BOOL opt_nocache;
-
        if (opt_nocache) {
                return NULL;
        }
@@ -2359,8 +2360,6 @@
 /* flush the cache */
 void wcache_flush_cache(void)
 {
-       extern BOOL opt_nocache;
-
        if (!wcache)
                return;
        if (wcache->tdb) {

Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c    2006-12-12 17:37:41 UTC 
(rev 20123)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c    2006-12-12 17:38:42 UTC 
(rev 20124)
@@ -65,6 +65,8 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_WINBIND
 
+extern struct winbindd_methods reconnect_methods;
+
 static NTSTATUS init_dc_connection_network(struct winbindd_domain *domain);
 static void set_dc_type_and_flags( struct winbindd_domain *domain );
 
@@ -196,7 +198,6 @@
 
 static void set_domain_online(struct winbindd_domain *domain)
 {
-       extern struct winbindd_methods reconnect_methods;
        struct timeval now;
 
        DEBUG(10,("set_domain_online: called for domain %s\n",

Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c  2006-12-12 17:37:41 UTC 
(rev 20123)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c  2006-12-12 17:38:42 UTC 
(rev 20124)
@@ -34,6 +34,8 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_WINBIND
 
+extern BOOL override_logfile;
+
 /* Read some data from a client connection */
 
 static void child_read_request(struct winbindd_cli_state *state)
@@ -759,7 +761,6 @@
        int fdpair[2];
        struct winbindd_cli_state state;
        struct winbindd_domain *domain;
-       extern BOOL override_logfile;
 
        if (socketpair(AF_UNIX, SOCK_STREAM, 0, fdpair) != 0) {
                DEBUG(0, ("Could not open child pipe: %s\n",

Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_util.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_util.c  2006-12-12 17:37:41 UTC 
(rev 20123)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_util.c  2006-12-12 17:38:42 UTC 
(rev 20124)
@@ -27,6 +27,9 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_WINBIND
 
+extern struct winbindd_methods cache_methods;
+extern struct winbindd_methods passdb_methods;
+
 /**
  * @file winbindd_util.c
  *
@@ -225,7 +228,6 @@
 
 static void trustdom_recv(void *private_data, BOOL success)
 {
-       extern struct winbindd_methods cache_methods;
        struct trustdom_state *state =
                talloc_get_type_abort(private_data, struct trustdom_state);
        struct winbindd_response *response = state->response;
@@ -493,8 +495,6 @@
 /* Look up global info for the winbind daemon */
 BOOL init_domain_list(void)
 {
-       extern struct winbindd_methods cache_methods;
-       extern struct winbindd_methods passdb_methods;
        struct winbindd_domain *domain;
        int role = lp_server_role();
 

Modified: branches/SAMBA_3_0/source/printing/print_generic.c
===================================================================
--- branches/SAMBA_3_0/source/printing/print_generic.c  2006-12-12 17:37:41 UTC 
(rev 20123)
+++ branches/SAMBA_3_0/source/printing/print_generic.c  2006-12-12 17:38:42 UTC 
(rev 20124)
@@ -21,6 +21,8 @@
 #include "includes.h"
 #include "printing.h"
 
+extern struct current_user current_user;
+extern userdom_struct current_user_info;
 
 /****************************************************************************
 run a given print command 
@@ -30,9 +32,6 @@
 static int print_run_command(int snum, const char* printername, BOOL do_sub,
                             const char *command, int *outfd, ...)
 {
-       extern struct current_user current_user;
-       extern userdom_struct current_user_info;
-       
        pstring syscmd;
        char *arg;
        int ret;

Modified: branches/SAMBA_3_0/source/printing/printing.c
===================================================================
--- branches/SAMBA_3_0/source/printing/printing.c       2006-12-12 17:37:41 UTC 
(rev 20123)
+++ branches/SAMBA_3_0/source/printing/printing.c       2006-12-12 17:38:42 UTC 
(rev 20124)
@@ -25,6 +25,8 @@
 
 extern SIG_ATOMIC_T got_sig_term;
 extern SIG_ATOMIC_T reload_after_sighup;
+extern struct current_user current_user;
+extern userdom_struct current_user_info;
 
 /* Current printer interface */
 static BOOL remove_from_jobs_changed(const char* sharename, uint32 jobid);
@@ -1438,8 +1440,6 @@
 
 static void print_queue_update(int snum, BOOL force)
 {
-       extern struct current_user current_user;
-       extern userdom_struct current_user_info;
        fstring key;
        fstring sharename;
        pstring lpqcommand, lprmcommand;

Modified: branches/SAMBA_3_0/source/smbd/blocking.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/blocking.c   2006-12-12 17:37:41 UTC (rev 
20123)
+++ branches/SAMBA_3_0/source/smbd/blocking.c   2006-12-12 17:38:42 UTC (rev 
20124)
@@ -22,6 +22,8 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_LOCKING
 
+extern int max_send;
+
 /****************************************************************************
  This is the structure to queue to implement blocking locks.
  notify. It consists of the requesting SMB and the expiry time.
@@ -425,7 +427,6 @@
 
 static BOOL process_trans2(blocking_lock_record *blr)
 {
-       extern int max_send;
        char *inbuf = blr->inbuf;
        char *outbuf;
        char params[2];

Modified: branches/SAMBA_3_0/source/smbd/nttrans.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/nttrans.c    2006-12-12 17:37:41 UTC (rev 
20123)
+++ branches/SAMBA_3_0/source/smbd/nttrans.c    2006-12-12 17:38:42 UTC (rev 
20124)
@@ -2345,7 +2345,6 @@
        SMB_NTQUOTA_STRUCT qt;
        SMB_NTQUOTA_LIST *tmp_list;
        SMB_NTQUOTA_HANDLE *qt_handle = NULL;
-       extern struct current_user current_user;
 
        ZERO_STRUCT(qt);
 

Modified: branches/SAMBA_3_0/source/smbd/sesssetup.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/sesssetup.c  2006-12-12 17:37:41 UTC (rev 
20123)
+++ branches/SAMBA_3_0/source/smbd/sesssetup.c  2006-12-12 17:38:42 UTC (rev 
20124)
@@ -23,6 +23,12 @@
 
 #include "includes.h"
 
+extern struct auth_context *negprot_global_auth_context;
+extern BOOL global_encrypted_passwords_negotiated;
+extern BOOL global_spnego_negotiated;
+extern enum protocol_types Protocol;
+extern int max_send;
+
 uint32 global_client_caps = 0;
 
 /*
@@ -840,13 +846,7 @@
        fstring native_lanman;
        fstring primary_domain;
        static BOOL done_sesssetup = False;
-       extern BOOL global_encrypted_passwords_negotiated;
-       extern BOOL global_spnego_negotiated;
-       extern enum protocol_types Protocol;
-       extern int max_send;
-
        auth_usersupplied_info *user_info = NULL;
-       extern struct auth_context *negprot_global_auth_context;
        auth_serversupplied_info *server_info = NULL;
 
        NTSTATUS nt_status;

Reply via email to