used findstatic.pl to make some variables static and remove some dead
authorAndrew Tridgell <tridge@samba.org>
Mon, 1 Jul 2002 09:12:41 +0000 (09:12 +0000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 1 Jul 2002 09:12:41 +0000 (09:12 +0000)
code
(This used to be commit 91ad9041e9507d36eb3f40c23c5d4df61f139ef0)

23 files changed:
source3/client/client.c
source3/client/clitar.c
source3/include/md5.h
source3/lib/genrand.c
source3/lib/interface.c
source3/lib/md5.c
source3/lib/talloc.c
source3/lib/time.c
source3/lib/util_sid.c
source3/lib/util_sock.c
source3/libads/disp_sec.c
source3/libsmb/namequery.c
source3/nsswitch/wb_common.c
source3/passdb/pdb_ldap.c
source3/printing/printing.c
source3/rpc_parse/parse_lsa.c
source3/rpc_server/srv_srvsvc.c
source3/rpc_server/srv_srvsvc_nt.c
source3/rpc_server/srv_wkssvc.c
source3/rpcclient/rpcclient.c
source3/script/findstatic.pl
source3/smbd/fileio.c
source3/smbd/vfs.c

index 5b5910b49f28728c66eabd647b457ffc9a143489..0eb264a853becbc01c4967564b7cbf40aa961ea4 100644 (file)
@@ -34,7 +34,7 @@ extern BOOL in_client;
 extern BOOL AllowDebugChange;
 static int port = 0;
 pstring cur_dir = "\\";
-pstring cd_path = "";
+static pstring cd_path = "";
 static pstring service;
 static pstring desthost;
 extern pstring global_myname;
@@ -61,9 +61,9 @@ static int cmd_help(void);
 #define FID_UNUSED (0xFFFF)
 
 time_t newer_than = 0;
-int archive_level = 0;
+static int archive_level = 0;
 
-BOOL translation = False;
+static BOOL translation = False;
 
 static BOOL have_ip;
 
@@ -74,30 +74,30 @@ extern BOOL tar_reset;
 /* clitar bits end */
  
 
-mode_t myumask = 0755;
+static mode_t myumask = 0755;
 
-BOOL prompt = True;
+static BOOL prompt = True;
 
-int printmode = 1;
+static int printmode = 1;
 
 static BOOL recurse = False;
 BOOL lowercase = False;
 
-struct in_addr dest_ip;
+static struct in_addr dest_ip;
 
 #define SEPARATORS " \t\n\r"
 
-BOOL abort_mget = True;
+static BOOL abort_mget = True;
 
-pstring fileselection = "";
+static pstring fileselection = "";
 
 extern file_info def_finfo;
 
 /* timing globals */
 int get_total_size = 0;
 int get_total_time_ms = 0;
-int put_total_size = 0;
-int put_total_time_ms = 0;
+static int put_total_size = 0;
+static int put_total_time_ms = 0;
 
 /* totals globals */
 static double dir_total;
@@ -1958,7 +1958,7 @@ static BOOL list_servers(char *wk_grp)
  *       field is NULL, and NULL in that field is used in process_tok()
  *       (below) to indicate the end of the list.  crh
  */
-struct
+static struct
 {
   char *name;
   int (*fn)(void);
@@ -2238,7 +2238,7 @@ static void process_stdin(void)
 /***************************************************** 
 return a connection to a server
 *******************************************************/
-struct cli_state *do_connect(const char *server, const char *share)
+static struct cli_state *do_connect(const char *server, const char *share)
 {
        struct cli_state *c;
        struct nmb_name called, calling;
index 10a00efb5119521abf22b52902a94bb490e81ec0..1d9d09066beee8153309a2a843946d1cfd1b3f33 100644 (file)
@@ -66,7 +66,7 @@ typedef struct
 
 } stack;
 
-stack dir_stack = {NULL, 0}; /* Want an empty stack */
+static stack dir_stack = {NULL, 0}; /* Want an empty stack */
 
 #define SEPARATORS " \t\n\r"
 extern struct cli_state *cli;
@@ -86,25 +86,25 @@ static char *tarbuf, *buffer_p;
 static int tp, ntarf, tbufsiz;
 static double ttarf;
 /* Incremental mode */
-BOOL tar_inc=False;
+static BOOL tar_inc=False;
 /* Reset archive bit */
-BOOL tar_reset=False;
+static BOOL tar_reset=False;
 /* Include / exclude mode (true=include, false=exclude) */
-BOOL tar_excl=True;
+static BOOL tar_excl=True;
 /* use regular expressions for search on file names */
-BOOL tar_re_search=False;
+static BOOL tar_re_search=False;
 #ifdef HAVE_REGEX_H
 regex_t *preg;
 #endif
 /* Do not dump anything, just calculate sizes */
-BOOL dry_run=False;
+static BOOL dry_run=False;
 /* Dump files with System attribute */
-BOOL tar_system=True;
+static BOOL tar_system=True;
 /* Dump files with Hidden attribute */
-BOOL tar_hidden=True;
+static BOOL tar_hidden=True;
 /* Be noisy - make a catalogue */
-BOOL tar_noisy=True;
-BOOL tar_real_noisy=False;  /* Don't want to be really noisy by default */
+static BOOL tar_noisy=True;
+static BOOL tar_real_noisy=False;  /* Don't want to be really noisy by default */
 
 char tar_type='\0';
 static char **cliplist=NULL;
@@ -120,8 +120,8 @@ extern pstring cur_dir;
 extern int get_total_time_ms;
 extern int get_total_size;
 
-int blocksize=20;
-int tarhandle;
+static int blocksize=20;
+static int tarhandle;
 
 static void writetarheader(int f,  char *aname, int size, time_t mtime,
                           char *amode, unsigned char ftype);
index dc2f2dd207fa362f88a7df59e1183a69d0f1561d..6665171e7c57c3aef33c52d432fa809faa428d23 100644 (file)
@@ -15,7 +15,6 @@ void MD5Init(struct MD5Context *context);
 void MD5Update(struct MD5Context *context, unsigned char const *buf,
               unsigned len);
 void MD5Final(unsigned char digest[16], struct MD5Context *context);
-void MD5Transform(uint32 buf[4], uint32 const in[16]);
 
 /*
  * This is needed to make RSAREF happy on some MS-DOS compilers.
index 6296ead726a60e75d9ccb63a99e1a705e5339fbb..ee8bc0b1d5abc59a11e75596cdc39872d3a0c874 100644 (file)
@@ -24,8 +24,8 @@
 
 static unsigned char hash[258];
 static uint32 counter;
-unsigned char *reseed_data;
-size_t reseed_data_size;
+static unsigned char *reseed_data;
+static size_t reseed_data_size;
 
 /**************************************************************** 
  Copy any user given reseed data.
index 2704397fb2e94a04ab2fb6a485cf2f399f76fdd2..0d751a9c7cf265acd3c0dc5cebdcfdb03cf0016a 100644 (file)
@@ -318,38 +318,11 @@ struct in_addr *iface_n_bcast(int n)
 }
 
 
-/****************************************************************************
-this function provides a simple hash of the configured interfaces. It is
-used to detect a change in interfaces to tell us whether to discard
-the current wins.dat file.
-Note that the result is independent of the order of the interfaces
-  **************************************************************************/
-unsigned iface_hash(void)
-{
-       unsigned ret = 0;
-       struct interface *i;
-
-       for (i=local_interfaces;i;i=i->next) {
-               unsigned x1 = (unsigned)str_checksum(inet_ntoa(i->ip));
-               unsigned x2 = (unsigned)str_checksum(inet_ntoa(i->nmask));
-               ret ^= (x1 ^ x2);
-       }
-
-       return ret;
-}
-
-
 /* these 3 functions return the ip/bcast/nmask for the interface
    most appropriate for the given ip address. If they can't find
    an appropriate interface they return the requested field of the
    first known interface. */
 
-struct in_addr *iface_bcast(struct in_addr ip)
-{
-       struct interface *i = iface_find(ip, True);
-       return(i ? &i->bcast : &local_interfaces->bcast);
-}
-
 struct in_addr *iface_ip(struct in_addr ip)
 {
        struct interface *i = iface_find(ip, True);
index 627725bb25274165ccb53abfa0309bb3e23046be..0d8f8e74d925ca5b8040ef0b3186a99a62ce62bb 100644 (file)
@@ -22,6 +22,8 @@
 
 #include "md5.h"
 
+void MD5Transform(uint32 buf[4], uint32 const in[16]);
+
 /*
  * Note: this code is harmless on little-endian machines.
  */
@@ -161,7 +163,7 @@ void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
  * reflect the addition of 16 longwords of new data.  MD5Update blocks
  * the data and converts bytes into longwords for this routine.
  */
-void MD5Transform(uint32 buf[4], uint32 const in[16])
+static void MD5Transform(uint32 buf[4], uint32 const in[16])
 {
     register uint32 a, b, c, d;
 
index d81528588cec67a710a8f55279faa914f16c82e2..0f293e172596c57bd150ccc172923a89467e3c35 100644 (file)
@@ -82,7 +82,7 @@ struct talloc_ctx {
  * @todo We should turn the global list off when using Insure++,
  * otherwise all the memory will be seen as still reachable.
  **/
-TALLOC_CTX *list_head = NULL;
+static TALLOC_CTX *list_head = NULL;
 
 
 /**
index 9df4763b4c3b1787a54e147829ec06e99f898bfd..9d87414aea058f01e612a64039754a936a792884 100644 (file)
@@ -44,11 +44,6 @@ int extra_time_offset = 0;
  External access to time_t_min and time_t_max.
 ********************************************************************/
 
-time_t get_time_t_min(void)
-{
-       return TIME_T_MIN;
-}
-
 time_t get_time_t_max(void)
 {
        return TIME_T_MAX;
index b27040b658468aa88bf4cb959002880a02605da0..7d3bd848efd65aa96bbbebdb02d4fc4f1c5c8770 100644 (file)
@@ -34,16 +34,16 @@ DOM_SID global_sid_Builtin;                                 /* Local well-known domain */
 DOM_SID global_sid_World_Domain;               /* Everyone domain */
 DOM_SID global_sid_World;                              /* Everyone */
 DOM_SID global_sid_Creator_Owner_Domain;    /* Creator Owner domain */
-DOM_SID global_sid_Creator_Owner;              /* Creator Owner */
-DOM_SID global_sid_Creator_Group;              /* Creator Group */
 DOM_SID global_sid_NT_Authority;               /* NT Authority */
 DOM_SID global_sid_NULL;                       /* NULL sid */
 DOM_SID global_sid_Builtin_Guests;                     /* Builtin guest users */
 DOM_SID global_sid_Authenticated_Users;                /* All authenticated rids */
 DOM_SID global_sid_Network;                                    /* Network rids */
-DOM_SID global_sid_Anonymous;                          /* Anonymous login */
 
-const DOM_SID *global_sid_everyone = &global_sid_World;
+static DOM_SID global_sid_Creator_Owner;               /* Creator Owner */
+static DOM_SID global_sid_Creator_Group;              /* Creator Group */
+static DOM_SID global_sid_Anonymous;                           /* Anonymous login */
+static const DOM_SID *global_sid_everyone = &global_sid_World;
 
 /*
  * An NT compatible anonymous token.
@@ -302,24 +302,6 @@ void sid_copy(DOM_SID *dst, const DOM_SID *src)
                dst->sub_auths[i] = src->sub_auths[i];
 }
 
-/*****************************************************************
- Duplicates a sid - mallocs the target.
-*****************************************************************/
-
-DOM_SID *sid_dup(DOM_SID *src)
-{
-  DOM_SID *dst;
-
-  if(!src)
-    return NULL;
-
-  if((dst = malloc(sizeof(DOM_SID))) != NULL) {
-       memset(dst, '\0', sizeof(DOM_SID));
-       sid_copy( dst, src);
-  }
-
-  return dst;
-}
 
 /*****************************************************************
  Write a sid out into on-the-wire format.
@@ -361,7 +343,7 @@ BOOL sid_parse(char *inbuf, size_t len, DOM_SID *sid)
 /*****************************************************************
  Compare the auth portion of two sids.
 *****************************************************************/  
-int sid_compare_auth(const DOM_SID *sid1, const DOM_SID *sid2)
+static int sid_compare_auth(const DOM_SID *sid1, const DOM_SID *sid2)
 {
        int i;
 
index f72c4638dcc148304ea5ca93bc2859ede4188407..b16d34e1f421bcd63f1e8fe07ae2fecc1e17c660 100644 (file)
@@ -50,7 +50,7 @@ typedef struct smb_socket_option {
        int opttype;
 } smb_socket_option;
 
-smb_socket_option socket_options[] = {
+static const smb_socket_option socket_options[] = {
   {"SO_KEEPALIVE",      SOL_SOCKET,    SO_KEEPALIVE,    0,                 OPT_BOOL},
   {"SO_REUSEADDR",      SOL_SOCKET,    SO_REUSEADDR,    0,                 OPT_BOOL},
   {"SO_BROADCAST",      SOL_SOCKET,    SO_BROADCAST,    0,                 OPT_BOOL},
@@ -189,7 +189,7 @@ ssize_t read_udp_socket(int fd,char *buf,size_t len)
 /*******************************************************************
  checks if read data is outstanding.
  ********************************************************************/
-int read_data_outstanding(int fd, unsigned int time_out)
+static int read_data_outstanding(int fd, unsigned int time_out)
 {
        int selrtn;
        fd_set fds;
@@ -364,20 +364,6 @@ ssize_t read_with_timeout(int fd, char *buf, size_t mincnt, size_t maxcnt,
        return((ssize_t)nread);
 }
 
-/****************************************************************************
-send a keepalive packet (rfc1002)
-****************************************************************************/
-
-BOOL send_keepalive(int client)
-{
-       unsigned char buf[4];
-
-       buf[0] = SMBkeepalive;
-       buf[1] = buf[2] = buf[3] = 0;
-
-       return(write_socket_data(client,(char *)buf,4) == 4);
-}
-
 /****************************************************************************
   read data from the client, reading exactly N bytes. 
 ****************************************************************************/
@@ -466,7 +452,7 @@ ssize_t write_data(int fd,char *buffer,size_t N)
  Write data to a socket - use send rather than write.
 ****************************************************************************/
 
-ssize_t write_socket_data(int fd,char *buffer,size_t N)
+static ssize_t write_socket_data(int fd,char *buffer,size_t N)
 {
        size_t total=0;
        ssize_t ret;
@@ -505,6 +491,21 @@ ssize_t write_socket(int fd,char *buf,size_t len)
        return(ret);
 }
 
+/****************************************************************************
+send a keepalive packet (rfc1002)
+****************************************************************************/
+
+BOOL send_keepalive(int client)
+{
+       unsigned char buf[4];
+
+       buf[0] = SMBkeepalive;
+       buf[1] = buf[2] = buf[3] = 0;
+
+       return(write_socket_data(client,(char *)buf,4) == 4);
+}
+
+
 /****************************************************************************
 read 4 bytes of a smb packet and return the smb length of the packet
 store the result in the buffer
@@ -655,45 +656,6 @@ BOOL send_smb(int fd,char *buffer)
        return True;
 }
 
-/****************************************************************************
-send a single packet to a port on another machine
-****************************************************************************/
-
-BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type)
-{
-  BOOL ret;
-  int out_fd;
-  struct sockaddr_in sock_out;
-
-  /* create a socket to write to */
-  out_fd = socket(AF_INET, type, 0);
-  if (out_fd == -1) 
-    {
-      DEBUG(0,("socket failed"));
-      return False;
-    }
-
-  /* set the address and port */
-  memset((char *)&sock_out,'\0',sizeof(sock_out));
-  putip((char *)&sock_out.sin_addr,(char *)&ip);
-  sock_out.sin_port = htons( port );
-  sock_out.sin_family = AF_INET;
-  
-  if (DEBUGLEVEL > 0)
-    DEBUG(3,("sending a packet of len %d to (%s) on port %d of type %s\n",
-            len,inet_ntoa(ip),port,type==SOCK_DGRAM?"DGRAM":"STREAM"));
-       
-  /* send it */
-  ret = (sys_sendto(out_fd,buf,len,0,(struct sockaddr *)&sock_out,sizeof(sock_out)) >= 0);
-
-  if (!ret)
-    DEBUG(0,("Packet send to %s(%d) failed ERRNO=%s\n",
-            inet_ntoa(ip),port,strerror(errno)));
-
-  close(out_fd);
-  return(ret);
-}
-
 /****************************************************************************
  Open a socket of the specified type, port, and address for incoming data.
 ****************************************************************************/
@@ -1002,37 +964,6 @@ char *get_socket_addr(int fd)
        return addr_buf;
 }
 
-/*******************************************************************
- opens and connects to a unix pipe socket
- ******************************************************************/
-int open_pipe_sock(char *path)
-{
-       int sock;
-       struct sockaddr_un sa;
-
-       sock = socket(AF_UNIX, SOCK_STREAM, 0);
-
-       if (sock < 0)
-       {
-               DEBUG(0, ("unix socket open failed\n"));
-               return sock;
-       }
-
-       ZERO_STRUCT(sa);
-       sa.sun_family = AF_UNIX;
-       safe_strcpy(sa.sun_path, path, sizeof(sa.sun_path)-1);
-
-       DEBUG(10, ("socket open succeeded.  file name: %s\n", sa.sun_path));
-
-       if (connect(sock, (struct sockaddr*) &sa, sizeof(sa)) < 0)
-       {
-               DEBUG(0,("socket connect to %s failed\n", sa.sun_path));
-               close(sock);
-               return -1;
-       }
-
-       return sock;
-}
 
 /*******************************************************************
  Create protected unix domain socket.
index 35a7af7b367039aa517dfa4465e8e92dc4fc69d5..a930fd6fe09b0530f66b6dae81bf7385bbb8a2e6 100644 (file)
@@ -52,7 +52,7 @@ static struct perm_mask_str {
 };
 
 /* convert a security permissions into a string */
-void ads_disp_perms(uint32 type)
+static void ads_disp_perms(uint32 type)
 {
        int i = 0;
        int j = 0;
@@ -82,20 +82,8 @@ void ads_disp_perms(uint32 type)
        puts("");
 }
 
-/* Check if ACE has OBJECT type */
-BOOL ads_ace_object(uint8 type)
-{
-       if (type == SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT ||
-            type == SEC_ACE_TYPE_ACCESS_DENIED_OBJECT ||
-            type == SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT ||
-            type == SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT) {
-               return True;
-       }
-       return False;
-}
-
 /* display ACE */
-void ads_disp_ace(SEC_ACE *sec_ace)
+static void ads_disp_ace(SEC_ACE *sec_ace)
 {
        char *access_type = "UNKNOWN";
 
@@ -135,7 +123,7 @@ void ads_disp_ace(SEC_ACE *sec_ace)
 }
 
 /* display ACL */
-void ads_disp_acl(SEC_ACL *sec_acl, char *type)
+static void ads_disp_acl(SEC_ACL *sec_acl, char *type)
 {
         if (!sec_acl)
                printf("------- (%s) ACL not present\n", type);
index 2bf72fbaac9f0bb9f30f525a18613524867616b2..68c09751bdcf3db57d58ef03b678c0e352c472fa 100644 (file)
@@ -207,97 +207,6 @@ BOOL name_status_find(const char *q_name, int q_type, int type, struct in_addr t
        return result;
 }
 
-/****************************************************************************
- Do a NetBIOS name registation to try to claim a name ...
-***************************************************************************/
-BOOL name_register(int fd, const char *name, int name_type,
-                  struct in_addr name_ip, int opcode,
-                  BOOL bcast, 
-                  struct in_addr to_ip, int *count)
-{
-  int retries = 3;
-  struct timeval tval;
-  struct packet_struct p;
-  struct packet_struct *p2;
-  struct nmb_packet *nmb = &p.packet.nmb;
-  struct in_addr register_ip;
-
-  DEBUG(4, ("name_register: %s as %s on %s\n", name, inet_ntoa(name_ip), inet_ntoa(to_ip)));
-
-  register_ip.s_addr = name_ip.s_addr;  /* Fix this ... */
-  
-  memset((char *)&p, '\0', sizeof(p));
-
-  *count = 0;
-
-  nmb->header.name_trn_id = generate_trn_id();
-  nmb->header.opcode = opcode;
-  nmb->header.response = False;
-  nmb->header.nm_flags.bcast = False;
-  nmb->header.nm_flags.recursion_available = False;
-  nmb->header.nm_flags.recursion_desired = True;  /* ? */
-  nmb->header.nm_flags.trunc = False;
-  nmb->header.nm_flags.authoritative = True;
-
-  nmb->header.qdcount = 1;
-  nmb->header.ancount = 0;
-  nmb->header.nscount = 0;
-  nmb->header.arcount = 1;
-
-  make_nmb_name(&nmb->question.question_name, name, name_type);
-
-  nmb->question.question_type = 0x20;
-  nmb->question.question_class = 0x1;
-
-  /* Now, create the additional stuff for a registration request */
-
-  if ((nmb->additional = (struct res_rec *)malloc(sizeof(struct res_rec))) == NULL) {
-
-    DEBUG(0, ("name_register: malloc fail for additional record.\n"));
-    return False;
-
-  }
-
-  memset((char *)nmb->additional, '\0', sizeof(struct res_rec));
-
-  nmb->additional->rr_name  = nmb->question.question_name;
-  nmb->additional->rr_type  = RR_TYPE_NB;
-  nmb->additional->rr_class = RR_CLASS_IN;
-
-  /* See RFC 1002, sections 5.1.1.1, 5.1.1.2 and 5.1.1.3 */
-  if (nmb->header.nm_flags.bcast)
-    nmb->additional->ttl = PERMANENT_TTL;
-  else
-    nmb->additional->ttl = lp_max_ttl();
-
-  nmb->additional->rdlength = 6;
-
-  nmb->additional->rdata[0] = NB_MFLAG & 0xFF;
-
-  /* Set the address for the name we are registering. */
-  putip(&nmb->additional->rdata[2], &register_ip);
-
-  p.ip = to_ip;
-  p.port = NMB_PORT;
-  p.fd = fd;
-  p.timestamp = time(NULL);
-  p.packet_type = NMB_PACKET;
-
-  GetTimeOfDay(&tval);
-
-  if (!send_packet(&p))
-    return False;
-
-  retries--;
-
-  if ((p2 = receive_nmb_packet(fd, 10, nmb->header.name_trn_id))) {
-    debug_nmb_packet(p2);
-    SAFE_FREE(p2);  /* No memory leaks ... */
-  }
-
-  return True;
-}
-
 
 /*
   comparison function used by sort_ip_list
@@ -1248,14 +1157,6 @@ NT GETDC call, UNICODE, NT domain SID and uncle tom cobbley and all...
 #endif /* defined(I_HATE_WINDOWS_REPLY_CODE) */
 }
 
-/********************************************************
-  Get the IP address list of the Local Master Browsers
- ********************************************************/ 
-
-BOOL get_lmb_list(struct in_addr **ip_list, int *count)
-{
-    return internal_resolve_name( MSBROWSE, 0x1, ip_list, count);
-}
 
 /********************************************************
  Get the IP address list of the PDC/BDC's of a Domain.
index 928b70d8b1b329caa1bdd758a60856cfcac522fb..89dd6252412719eede0aab1756b7efea0b637fce 100644 (file)
@@ -86,7 +86,7 @@ void init_response(struct winbindd_response *response)
 
 /* Close established socket */
 
-void close_sock(void)
+static void close_sock(void)
 {
        if (winbindd_fd != -1) {
                close(winbindd_fd);
index aef366fe7ebeb00dc4f65d397773a050edad8a63..8e8e8f1574c24f5d0b5e5f57e194b8ef3e1a919f 100644 (file)
@@ -136,7 +136,7 @@ static BOOL fetch_ldapsam_pw(char **dn, char** pw)
        return True;
 }
 
-char *attr[] = {"uid", "pwdLastSet", "logonTime",
+static const char *attr[] = {"uid", "pwdLastSet", "logonTime",
                "logoffTime", "kickoffTime", "cn",
                "pwdCanChange", "pwdMustChange",
                "dislplayName", "homeDrive",
index f8b3c9cef09b3f7c7672076a5bbbe4338f16b053..654d79365b0162e9053bb9f0c86fb4eec5d00612 100644 (file)
@@ -22,7 +22,7 @@
 #include "printing.h"
 
 /* Current printer interface */
-struct printif *current_printif = &generic_printif;
+static struct printif *current_printif = &generic_printif;
 
 /* 
    the printing backend revolves around a tdb database that stores the
index 0cf7ea38f214a16f5f5387272d2bd068ebb7f0e4..a6aecb796726a499b40918a3969d40f6971cab06 100644 (file)
@@ -192,7 +192,7 @@ static BOOL lsa_io_sec_qos(char *desc,  LSA_SEC_QOS *qos, prs_struct *ps,
  Inits an LSA_OBJ_ATTR structure.
 ********************************************************************/
 
-void init_lsa_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, LSA_SEC_QOS *qos)
+static void init_lsa_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, LSA_SEC_QOS *qos)
 {
        DEBUG(5, ("init_lsa_obj_attr\n"));
 
@@ -729,7 +729,7 @@ static BOOL lsa_io_dom_query_3(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int
  Reads or writes a dom query structure.
 ********************************************************************/
 
-BOOL lsa_io_dom_query_5(char *desc, DOM_QUERY_5 *d_q, prs_struct *ps, int depth)
+static BOOL lsa_io_dom_query_5(char *desc, DOM_QUERY_5 *d_q, prs_struct *ps, int depth)
 {
        return lsa_io_dom_query("", d_q, ps, depth);
 }
@@ -808,7 +808,7 @@ BOOL lsa_io_r_query(char *desc, LSA_R_QUERY_INFO *r_q, prs_struct *ps,
  Inits a LSA_SID_ENUM structure.
 ********************************************************************/
 
-void init_lsa_sid_enum(TALLOC_CTX *mem_ctx, LSA_SID_ENUM *sen, 
+static void init_lsa_sid_enum(TALLOC_CTX *mem_ctx, LSA_SID_ENUM *sen, 
                       int num_entries, DOM_SID *sids)
 {
        int i;
@@ -1753,7 +1753,7 @@ BOOL lsa_io_q_enum_privsaccount(char *desc, LSA_Q_ENUMPRIVSACCOUNT *r_c, prs_str
  Reads or writes an LUID structure.
 ********************************************************************/
 
-BOOL lsa_io_luid(char *desc, LUID *r_c, prs_struct *ps, int depth)
+static BOOL lsa_io_luid(char *desc, LUID *r_c, prs_struct *ps, int depth)
 {
        prs_debug(ps, depth, desc, "lsa_io_luid");
        depth++;
@@ -1774,7 +1774,7 @@ BOOL lsa_io_luid(char *desc, LUID *r_c, prs_struct *ps, int depth)
  Reads or writes an LUID_ATTR structure.
 ********************************************************************/
 
-BOOL lsa_io_luid_attr(char *desc, LUID_ATTR *r_c, prs_struct *ps, int depth)
+static BOOL lsa_io_luid_attr(char *desc, LUID_ATTR *r_c, prs_struct *ps, int depth)
 {
        prs_debug(ps, depth, desc, "lsa_io_luid_attr");
        depth++;
@@ -1795,7 +1795,7 @@ BOOL lsa_io_luid_attr(char *desc, LUID_ATTR *r_c, prs_struct *ps, int depth)
  Reads or writes an PRIVILEGE_SET structure.
 ********************************************************************/
 
-BOOL lsa_io_privilege_set(char *desc, PRIVILEGE_SET *r_c, prs_struct *ps, int depth)
+static BOOL lsa_io_privilege_set(char *desc, PRIVILEGE_SET *r_c, prs_struct *ps, int depth)
 {
        uint32 i;
 
index 96e617236622284e48e9fa5024cf30e13a5a1ccc..5e1c005d540519baca4177ff35ec28772304af93 100644 (file)
@@ -495,7 +495,7 @@ static BOOL api_srv_net_file_set_secdesc(pipes_struct *p)
 \PIPE\srvsvc commands
 ********************************************************************/
 
-struct api_struct api_srv_cmds[] =
+static const struct api_struct api_srv_cmds[] =
 {
        { "SRV_NET_CONN_ENUM"       ,  SRV_NET_CONN_ENUM       ,   api_srv_net_conn_enum    },
        { "SRV_NET_SESS_ENUM"       ,  SRV_NET_SESS_ENUM       ,   api_srv_net_sess_enum    },
index d99b45f3e6dc25b049c7d97eb2561eeb7f58af33..e8fe603ed87b4e8422e874310f2fb46ab6118efa 100644 (file)
@@ -1824,7 +1824,7 @@ WERROR _srv_net_file_set_secdesc(pipes_struct *p, SRV_Q_NET_FILE_SET_SECDESC *q_
  "Nigel Williams" <nigel@veritas.com>.
 ***********************************************************************************/
 
-const char *server_disks[] = {"C:"};
+static const char *server_disks[] = {"C:"};
 
 static uint32 get_server_disk_count(void)
 {
index 013884844021bfb3851716f6929d43830bc16abe..c783becbbeba38ea41ce810ead017f63ff3e76a1 100644 (file)
@@ -58,7 +58,7 @@ static BOOL api_wks_query_info(pipes_struct *p)
 /*******************************************************************
  \PIPE\wkssvc commands
  ********************************************************************/
-struct api_struct api_wks_cmds[] =
+static struct api_struct api_wks_cmds[] =
 {
        { "WKS_Q_QUERY_INFO", WKS_QUERY_INFO, api_wks_query_info },
        { NULL             , 0            , NULL }
index 42fb71abee17191adf3b0dd13c90810b3a67b05f..3ef5da1fef7002aa58c9be33a57780ce2daaa24d 100644 (file)
@@ -186,7 +186,7 @@ static void get_username (char *username)
 
 /* Fetch the SID for this computer */
 
-void fetch_machine_sid(struct cli_state *cli)
+static void fetch_machine_sid(struct cli_state *cli)
 {
        POLICY_HND pol;
        NTSTATUS result = NT_STATUS_OK;
index d2d1b4d9240e5b2e4e70238825e5643200b59876..43a4916435d5910fada7d3934fdc0abcce0cbb82 100755 (executable)
@@ -45,6 +45,7 @@ for (my($i)=0; $i <= $#{@lines}; $i++) {
 # are defined
 foreach my $f (keys %def) {
        print "Checking $f\n";
+       my($found_one) = 0;
        foreach my $s (@{$def{$f}}) {
                my($found) = 0;
                foreach my $f2 (keys %undef) {
@@ -52,6 +53,7 @@ foreach my $f (keys %def) {
                                foreach my $s2 (@{$undef{$f2}}) {
                                        if ($s2 eq $s) {
                                                $found = 1;
+                                               $found_one = 1;
                                        }
                                }
                        }
@@ -61,5 +63,8 @@ foreach my $f (keys %def) {
                        print "  '$s' is unique to $f  ($t)\n";
                }
        }
+       if ($found_one == 0) {
+               print "  all symbols in '$f' are unused (main program?)\n";
+       }
 }
 
index fd660f40d08ee224e025f454d5f302b3909881c4..710ba396d8d0165009ade95ab7a478a9c5b42acf 100644 (file)
@@ -28,7 +28,7 @@ static BOOL setup_write_cache(files_struct *, SMB_OFF_T);
  Seek a file. Try to avoid the seek if possible.
 ****************************************************************************/
 
-SMB_OFF_T seek_file(files_struct *fsp,SMB_OFF_T pos)
+static SMB_OFF_T seek_file(files_struct *fsp,SMB_OFF_T pos)
 {
        SMB_OFF_T offset = 0;
        SMB_OFF_T seek_ret;
@@ -58,7 +58,7 @@ SMB_OFF_T seek_file(files_struct *fsp,SMB_OFF_T pos)
 ****************************************************************************/
 
 
-BOOL read_from_write_cache(files_struct *fsp,char *data,SMB_OFF_T pos,size_t n)
+static BOOL read_from_write_cache(files_struct *fsp,char *data,SMB_OFF_T pos,size_t n)
 {
        write_cache *wcp = fsp->wcp;
 
index 1d1e1e45fc043fb534b11029635ebd8ec55ff5aa..5e1dc68bdb44cb5ab0a21553004700c7544f4360 100644 (file)
@@ -32,7 +32,7 @@ struct vfs_syminfo {
    very important.  They must be in the same order as defined in
    vfs.h.  Change at your own peril. */
 
-struct vfs_ops default_vfs_ops = {
+static struct vfs_ops default_vfs_ops = {
 
        /* Disk operations */
 
@@ -222,7 +222,7 @@ BOOL vfs_directory_exist(connection_struct *conn, const char *dname, SMB_STRUCT_
 /*******************************************************************
  vfs getwd wrapper 
 ********************************************************************/
-char *vfs_getwd(connection_struct *conn, char *path)
+static char *vfs_getwd(connection_struct *conn, char *path)
 {
        return conn->vfs_ops.getwd(conn,path);
 }
@@ -562,7 +562,7 @@ int vfs_ChDir(connection_struct *conn, char *path)
 /* number of list structures for a caching GetWd function. */
 #define MAX_GETWDCACHE (50)
 
-struct {
+static struct {
        SMB_DEV_T dev; /* These *must* be compatible with the types returned in a stat() call. */
        SMB_INO_T inode; /* These *must* be compatible with the types returned in a stat() call. */
        char *dos_path; /* The pathname in DOS format. */