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;
#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;
/* 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;
* 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);
/*****************************************************
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;
} 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;
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;
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);
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.
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.
}
-/****************************************************************************
-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);
#include "md5.h"
+void MD5Transform(uint32 buf[4], uint32 const in[16]);
+
/*
* Note: this code is harmless on little-endian machines.
*/
* 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;
* @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;
/**
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;
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.
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.
/*****************************************************************
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;
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},
/*******************************************************************
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;
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.
****************************************************************************/
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;
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
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.
****************************************************************************/
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.
};
/* 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;
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";
}
/* 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);
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], ®ister_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
#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.
/* Close established socket */
-void close_sock(void)
+static void close_sock(void)
{
if (winbindd_fd != -1) {
close(winbindd_fd);
return True;
}
-char *attr[] = {"uid", "pwdLastSet", "logonTime",
+static const char *attr[] = {"uid", "pwdLastSet", "logonTime",
"logoffTime", "kickoffTime", "cn",
"pwdCanChange", "pwdMustChange",
"dislplayName", "homeDrive",
#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
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"));
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);
}
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;
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++;
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++;
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;
\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 },
"Nigel Williams" <nigel@veritas.com>.
***********************************************************************************/
-const char *server_disks[] = {"C:"};
+static const char *server_disks[] = {"C:"};
static uint32 get_server_disk_count(void)
{
/*******************************************************************
\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 }
/* 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;
# 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) {
foreach my $s2 (@{$undef{$f2}}) {
if ($s2 eq $s) {
$found = 1;
+ $found_one = 1;
}
}
}
print " '$s' is unique to $f ($t)\n";
}
}
+ if ($found_one == 0) {
+ print " all symbols in '$f' are unused (main program?)\n";
+ }
}
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;
****************************************************************************/
-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;
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 */
/*******************************************************************
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);
}
/* 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. */