summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source/auth/pampass.c2
-rw-r--r--source/client/smbspool.c2
-rw-r--r--source/include/proto.h3
-rw-r--r--source/lib/smbrun.c10
-rw-r--r--source/libsmb/nmblib.c2
-rw-r--r--source/nmbd/nmbd_winsserver.c2
-rw-r--r--source/param/loadparm.c4
-rw-r--r--source/passdb/pampass.c2
-rw-r--r--source/printing/print_generic.c27
-rw-r--r--source/rpc_client/cli_lsarpc.c10
-rw-r--r--source/rpc_server/srv_reg_nt.c2
-rw-r--r--source/rpc_server/srv_samr_nt.c4
-rw-r--r--source/rpc_server/srv_spoolss_nt.c24
-rw-r--r--source/rpc_server/srv_srvsvc_nt.c6
-rw-r--r--source/rpcclient/cmd_spoolss.c2
-rw-r--r--source/rpcclient/rpcclient.c2
-rw-r--r--source/smbd/close.c2
-rw-r--r--source/smbd/message.c2
-rw-r--r--source/smbd/reply.c8
-rw-r--r--source/smbd/service.c8
-rw-r--r--source/smbd/trans2.c2
-rw-r--r--source/tdb/tdbutil.c46
-rw-r--r--source/utils/smbcacls.c2
-rw-r--r--source/utils/smbcontrol.c4
-rw-r--r--source/utils/smbrun.c74
25 files changed, 49 insertions, 203 deletions
diff --git a/source/auth/pampass.c b/source/auth/pampass.c
index 08f6027a880..e6de54dfe69 100644
--- a/source/auth/pampass.c
+++ b/source/auth/pampass.c
@@ -61,8 +61,6 @@ static char *PAM_password;
static BOOL pam_error_handler(pam_handle_t *pamh, int pam_error, char *msg, int dbglvl)
{
- int retval;
-
if( pam_error != PAM_SUCCESS)
{
DEBUG(dbglvl, ("PAM: %s : %s\n", msg, pam_strerror(pamh, pam_error)));
diff --git a/source/client/smbspool.c b/source/client/smbspool.c
index 581b6508b8d..b0077b73bae 100644
--- a/source/client/smbspool.c
+++ b/source/client/smbspool.c
@@ -59,7 +59,7 @@ static int smb_print(struct cli_state *, char *, FILE *);
*server, /* Server name */
*printer; /* Printer name */
FILE *fp; /* File to print */
- int status; /* Status of LPD job */
+ int status=0; /* Status of LPD job */
struct cli_state *cli; /* SMB interface */
/* we expect the URI in argv[0]. Detect the case where it is in argv[1] and cope */
diff --git a/source/include/proto.h b/source/include/proto.h
index 34a6cb0f27f..a1d21db27ee 100644
--- a/source/include/proto.h
+++ b/source/include/proto.h
@@ -194,7 +194,7 @@ int vslprintf(char *str, int n, char *format, va_list ap);
/*The following definitions come from lib/smbrun.c */
-int smbrun(char *cmd, int *outfd, char *template);
+int smbrun(char *cmd, int *outfd);
/*The following definitions come from lib/snprintf.c */
@@ -1545,7 +1545,6 @@ enum nss_status winbindd_request(int req_type,
void lp_talloc_free(void);
char *lp_logfile(void);
-char *lp_smbrun(void);
char *lp_configfile(void);
char *lp_tdb_passwd_file(void);
char *lp_smb_passwd_file(void);
diff --git a/source/lib/smbrun.c b/source/lib/smbrun.c
index a543ff5eee4..8e5e2e42cd3 100644
--- a/source/lib/smbrun.c
+++ b/source/lib/smbrun.c
@@ -30,14 +30,12 @@ extern int DEBUGLEVEL;
This is a utility function of smbrun().
****************************************************************************/
-static BOOL setup_out_fd(char *template)
+static BOOL setup_out_fd(void)
{
int fd;
pstring path;
- pstrcpy( path, template);
- pstrcat( path, generate_random_str(17));
- pstrcat( path, ".XXXXXX");
+ slprintf(path, sizeof(path)-1, "%s/smb.XXXXXX", tmpdir());
/* now create the file */
fd = smb_mkstemp(path);
@@ -60,7 +58,7 @@ run a command being careful about uid/gid handling and putting the output in
outfd (or discard it if outfd is NULL).
****************************************************************************/
-int smbrun(char *cmd, int *outfd, char *template)
+int smbrun(char *cmd, int *outfd)
{
pid_t pid;
uid_t uid = current_user.uid;
@@ -73,7 +71,7 @@ int smbrun(char *cmd, int *outfd, char *template)
/* point our stdout at the file we want output to go into */
- if (outfd && ((*outfd = setup_out_fd(template)) == -1)) {
+ if (outfd && ((*outfd = setup_out_fd()) == -1)) {
return -1;
}
diff --git a/source/libsmb/nmblib.c b/source/libsmb/nmblib.c
index 22ff09faa31..0a6bbe87e23 100644
--- a/source/libsmb/nmblib.c
+++ b/source/libsmb/nmblib.c
@@ -749,7 +749,7 @@ struct packet_struct *read_packet(int fd,enum packet_type packet_type)
******************************************************************/
static BOOL send_udp(int fd,char *buf,int len,struct in_addr ip,int port)
{
- BOOL ret;
+ BOOL ret = False;
int i;
struct sockaddr_in sock_out;
diff --git a/source/nmbd/nmbd_winsserver.c b/source/nmbd/nmbd_winsserver.c
index 7836f0570c8..296102fd99c 100644
--- a/source/nmbd/nmbd_winsserver.c
+++ b/source/nmbd/nmbd_winsserver.c
@@ -62,7 +62,7 @@ static void wins_hook(char *operation, struct name_record *namerec, int ttl)
}
DEBUG(3,("calling wins hook for %s\n", nmb_namestr(&namerec->name)));
- smbrun(command, NULL, NULL);
+ smbrun(command, NULL);
}
diff --git a/source/param/loadparm.c b/source/param/loadparm.c
index cfc53f35d1c..f8e540466b5 100644
--- a/source/param/loadparm.c
+++ b/source/param/loadparm.c
@@ -145,7 +145,6 @@ typedef struct
char *szLogonPath;
char *szLogonDrive;
char *szLogonHome;
- char *szSmbrun;
char *szWINSserver;
char *szCodingSystem;
char *szInterfaces;
@@ -957,7 +956,6 @@ static struct parm_struct parm_table[] = {
{"add share command", P_STRING, P_GLOBAL, &Globals.szAddShareCommand, NULL, NULL, 0},
{"change share command", P_STRING, P_GLOBAL, &Globals.szChangeShareCommand, NULL, NULL, 0},
{"delete share command", P_STRING, P_GLOBAL, &Globals.szDeleteShareCommand, NULL, NULL, 0},
- {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL, NULL, 0},
{"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE},
{"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_DOS_STRING},
@@ -1210,7 +1208,6 @@ static void init_globals(void)
string_set(&Globals.szUtmpHostname, "%m");
Globals.bUtmpConsolidate = False;
#endif /* WITH_UTMP */
- string_set(&Globals.szSmbrun, SMBRUN);
string_set(&Globals.szSocketAddress, "0.0.0.0");
pstrcpy(s, "Samba ");
pstrcat(s, VERSION);
@@ -1426,7 +1423,6 @@ static char *lp_string(const char *s)
int fn_name(int i) {return(LP_SNUM_OK(i)? pSERVICE(i)->val : sDefault.val);}
FN_GLOBAL_STRING(lp_logfile, &Globals.szLogFile)
-FN_GLOBAL_STRING(lp_smbrun, &Globals.szSmbrun)
FN_GLOBAL_STRING(lp_configfile, &Globals.szConfigFile)
/* #ifdef WITH_TDBPWD
FN_GLOBAL_STRING(lp_tdb_passwd_file, &Globals.szTDBPasswdFile)
diff --git a/source/passdb/pampass.c b/source/passdb/pampass.c
index 08f6027a880..e6de54dfe69 100644
--- a/source/passdb/pampass.c
+++ b/source/passdb/pampass.c
@@ -61,8 +61,6 @@ static char *PAM_password;
static BOOL pam_error_handler(pam_handle_t *pamh, int pam_error, char *msg, int dbglvl)
{
- int retval;
-
if( pam_error != PAM_SUCCESS)
{
DEBUG(dbglvl, ("PAM: %s : %s\n", msg, pam_strerror(pamh, pam_error)));
diff --git a/source/printing/print_generic.c b/source/printing/print_generic.c
index 45c9d445e8b..eff394593ce 100644
--- a/source/printing/print_generic.c
+++ b/source/printing/print_generic.c
@@ -54,33 +54,14 @@ run a given print command
a null terminated list of value/substitute pairs is provided
for local substitution strings
****************************************************************************/
-
-#ifdef HAVE_STDARG_H
-static int print_run_command(int snum,char *command, int *outfd, char *outfile, ...)
-{
-#else /* HAVE_STDARG_H */
-static int print_run_command(va_alist)
-va_dcl
+static int print_run_command(int snum,char *command, int *outfd, ...)
{
- int snum;
- int *outfd;
- char *command, *outfile;
-#endif /* HAVE_STDARG_H */
pstring syscmd;
char *p, *arg;
int ret;
va_list ap;
-
-#ifdef HAVE_STDARG_H
- va_start(ap, outfile);
-#else /* HAVE_STDARG_H */
- va_start(ap);
- snum = va_arg(ap,int);
- fd = va_arg(ap, int *);
- command = va_arg(ap,char *);
- outfile = va_arg(ap,char *);
-#endif /* HAVE_STDARG_H */
+ va_start(ap, outfd);
if (!command || !*command) return -1;
@@ -104,7 +85,7 @@ va_dcl
/* Convert script args to unix-codepage */
dos_to_unix(syscmd, True);
- ret = smbrun(syscmd,outfd,outfile);
+ ret = smbrun(syscmd,outfd);
DEBUG(3,("Running the command `%s' gave %d\n",syscmd,ret));
@@ -214,7 +195,7 @@ static int generic_queue_get(int snum, print_queue_struct **q, print_status_stru
int fd;
pstring tmp_file;
int numlines, i, qcount;
- print_queue_struct *queue;
+ print_queue_struct *queue = NULL;
fstring printer_name;
/* Convert printer name (i.e. share name) to unix-codepage */
diff --git a/source/rpc_client/cli_lsarpc.c b/source/rpc_client/cli_lsarpc.c
index 649be20a52f..f6424f4d1a1 100644
--- a/source/rpc_client/cli_lsarpc.c
+++ b/source/rpc_client/cli_lsarpc.c
@@ -297,7 +297,7 @@ uint32 lsa_open_policy(const char *system_name, POLICY_HND *hnd,
LSA_Q_OPEN_POL q_o;
LSA_SEC_QOS qos;
struct cli_connection *con = NULL;
- uint32 result;
+ uint32 result = 0;
if (!cli_connection_init(system_name, PIPE_LSARPC, &con)) {
return NT_STATUS_UNSUCCESSFUL;
@@ -365,7 +365,7 @@ uint32 lsa_close(POLICY_HND *hnd)
prs_struct rbuf;
prs_struct buf;
LSA_Q_CLOSE q_c;
- uint32 result;
+ uint32 result = 0;
if (hnd == NULL) return False;
@@ -419,7 +419,7 @@ uint32 lsa_lookup_sids(POLICY_HND *hnd, int num_sids, DOM_SID *sids,
prs_struct buf;
LSA_Q_LOOKUP_SIDS q_l;
TALLOC_CTX *ctx = talloc_init();
- uint32 result;
+ uint32 result = 0;
ZERO_STRUCT(q_l);
@@ -454,7 +454,7 @@ uint32 lsa_lookup_sids(POLICY_HND *hnd, int num_sids, DOM_SID *sids,
LSA_R_LOOKUP_SIDS r_l;
DOM_R_REF ref;
LSA_TRANS_NAME_ENUM t_names;
- BOOL p, valid_response;
+ BOOL p, valid_response = False;
r_l.dom_ref = &ref;
r_l.names = &t_names;
@@ -576,7 +576,7 @@ uint32 lsa_lookup_names(POLICY_HND *hnd, int num_names, char **names,
LSA_Q_LOOKUP_NAMES q_l;
BOOL valid_response = False;
TALLOC_CTX *ctx = talloc_init();
- uint32 result;
+ uint32 result = 0;
if (hnd == NULL || num_sids == 0 || sids == NULL) return False;
diff --git a/source/rpc_server/srv_reg_nt.c b/source/rpc_server/srv_reg_nt.c
index 4f941e3e1bd..502d5514378 100644
--- a/source/rpc_server/srv_reg_nt.c
+++ b/source/rpc_server/srv_reg_nt.c
@@ -117,7 +117,7 @@ uint32 _reg_open_entry(pipes_struct *p, REG_Q_OPEN_ENTRY *q_u, REG_R_OPEN_ENTRY
uint32 _reg_info(pipes_struct *p, REG_Q_INFO *q_u, REG_R_INFO *r_u)
{
uint32 status = NT_STATUS_NOPROBLEMO;
- char *key;
+ char *key = NULL;
uint32 type=0x1; /* key type: REG_SZ */
UNISTR2 *uni_key = NULL;
diff --git a/source/rpc_server/srv_samr_nt.c b/source/rpc_server/srv_samr_nt.c
index 1e3240e02ab..cf9918992d1 100644
--- a/source/rpc_server/srv_samr_nt.c
+++ b/source/rpc_server/srv_samr_nt.c
@@ -1266,8 +1266,8 @@ static BOOL make_samr_lookup_rids(TALLOC_CTX *ctx, uint32 num_names, fstring nam
UNIHDR **pp_hdr_name, UNISTR2 **pp_uni_name)
{
uint32 i;
- UNIHDR *hdr_name;
- UNISTR2 *uni_name;
+ UNIHDR *hdr_name = NULL;
+ UNISTR2 *uni_name = NULL;
*pp_uni_name = NULL;
*pp_hdr_name = NULL;
diff --git a/source/rpc_server/srv_spoolss_nt.c b/source/rpc_server/srv_spoolss_nt.c
index 3bf44cd041e..9a337cc9806 100644
--- a/source/rpc_server/srv_spoolss_nt.c
+++ b/source/rpc_server/srv_spoolss_nt.c
@@ -296,7 +296,7 @@ static uint32 delete_printer_handle(pipes_struct *p, POLICY_HND *hnd)
dos_to_unix(command, True); /* Convert printername to unix-codepage */
DEBUG(10,("Running [%s]\n", command));
- ret = smbrun(command, NULL, NULL);
+ ret = smbrun(command, NULL);
if (ret != 0) {
return ERROR_INVALID_HANDLE; /* What to return here? */
}
@@ -4123,7 +4123,6 @@ static BOOL add_printer_hook(NT_PRINTER_INFO_LEVEL *printer)
char *cmd = lp_addprinter_cmd();
char *path;
char **qlines;
- pstring tmp_file;
pstring command;
pstring driverlocation;
int numlines;
@@ -4141,16 +4140,15 @@ static BOOL add_printer_hook(NT_PRINTER_INFO_LEVEL *printer)
/* change \ to \\ for the shell */
all_string_sub(driverlocation,"\\","\\\\",sizeof(pstring));
- slprintf(tmp_file, sizeof(tmp_file)-1, "%s/smbcmd.%d.", path, sys_getpid());
slprintf(command, sizeof(command)-1, "%s \"%s\" \"%s\" \"%s\" \"%s\" \"%s\" \"%s\"",
cmd, printer->info_2->printername, printer->info_2->sharename,
printer->info_2->portname, printer->info_2->drivername,
printer->info_2->location, driverlocation);
- /* Convert script args to unix-codepage */
- dos_to_unix(command, True);
- DEBUG(10,("Running [%s > %s]\n", command,tmp_file));
- ret = smbrun(command, &fd, tmp_file);
+ /* Convert script args to unix-codepage */
+ dos_to_unix(command, True);
+ DEBUG(10,("Running [%s]\n", command));
+ ret = smbrun(command, &fd);
DEBUGADD(10,("returned [%d]\n", ret));
if ( ret != 0 ) {
@@ -4160,7 +4158,7 @@ static BOOL add_printer_hook(NT_PRINTER_INFO_LEVEL *printer)
}
numlines = 0;
- /* Get lines and convert them back to dos-codepage */
+ /* Get lines and convert them back to dos-codepage */
qlines = fd_lines_load(fd, &numlines, True);
DEBUGADD(10,("Lines returned = [%d]\n", numlines));
close(fd);
@@ -5307,7 +5305,7 @@ uint32 _spoolss_getform(pipes_struct *p, SPOOL_Q_GETFORM *q_u, SPOOL_R_GETFORM *
FORM_1 form_1;
fstring form_name;
int buffer_size=0;
- int numofforms, i;
+ int numofforms=0, i;
/* that's an [in out] buffer */
spoolss_move_buffer(q_u->buffer, &r_u->buffer);
@@ -5406,7 +5404,6 @@ static uint32 enumports_level_1(NEW_BUFFER *buffer, uint32 offered, uint32 *need
char *cmd = lp_enumports_cmd();
char *path;
char **qlines;
- pstring tmp_file;
pstring command;
int numlines;
int ret;
@@ -5417,11 +5414,10 @@ static uint32 enumports_level_1(NEW_BUFFER *buffer, uint32 offered, uint32 *need
else
path = lp_lockdir();
- slprintf(tmp_file, sizeof(tmp_file)-1, "%s/smbcmd.%d.", path, sys_getpid());
slprintf(command, sizeof(command)-1, "%s \"%d\"", cmd, 1);
- DEBUG(10,("Running [%s > %s]\n", command,tmp_file));
- ret = smbrun(command, &fd, tmp_file);
+ DEBUG(10,("Running [%s]\n", command));
+ ret = smbrun(command, &fd);
DEBUG(10,("Returned [%d]\n", ret));
if (ret != 0) {
if (fd != -1)
@@ -5519,7 +5515,7 @@ static uint32 enumports_level_2(NEW_BUFFER *buffer, uint32 offered, uint32 *need
unlink(tmp_file);
DEBUG(10,("Running [%s > %s]\n", command,tmp_file));
- ret = smbrun(command, &fd, tmp_file);
+ ret = smbrun(command, &fd);
DEBUGADD(10,("returned [%d]\n", ret));
if (ret != 0) {
if (fd != -1)
diff --git a/source/rpc_server/srv_srvsvc_nt.c b/source/rpc_server/srv_srvsvc_nt.c
index 474a80c8337..1ace46930dd 100644
--- a/source/rpc_server/srv_srvsvc_nt.c
+++ b/source/rpc_server/srv_srvsvc_nt.c
@@ -1303,7 +1303,7 @@ uint32 _srv_net_share_set_info(pipes_struct *p, SRV_Q_NET_SHARE_SET_INFO *q_u, S
dos_to_unix(command, True); /* Convert to unix-codepage */
DEBUG(10,("_srv_net_share_set_info: Running [%s]\n", command ));
- if ((ret = smbrun(command, NULL, NULL)) != 0) {
+ if ((ret = smbrun(command, NULL)) != 0) {
DEBUG(0,("_srv_net_share_set_info: Running [%s] returned (%d)\n", command, ret ));
return ERROR_ACCESS_DENIED;
}
@@ -1420,7 +1420,7 @@ uint32 _srv_net_share_add(pipes_struct *p, SRV_Q_NET_SHARE_ADD *q_u, SRV_R_NET_S
dos_to_unix(command, True); /* Convert to unix-codepage */
DEBUG(10,("_srv_net_share_add: Running [%s]\n", command ));
- if ((ret = smbrun(command, NULL, NULL)) != 0) {
+ if ((ret = smbrun(command, NULL)) != 0) {
DEBUG(0,("_srv_net_share_add: Running [%s] returned (%d)\n", command, ret ));
return ERROR_ACCESS_DENIED;
}
@@ -1487,7 +1487,7 @@ uint32 _srv_net_share_del(pipes_struct *p, SRV_Q_NET_SHARE_DEL *q_u, SRV_R_NET_S
dos_to_unix(command, True); /* Convert to unix-codepage */
DEBUG(10,("_srv_net_share_del: Running [%s]\n", command ));
- if ((ret = smbrun(command, NULL, NULL)) != 0) {
+ if ((ret = smbrun(command, NULL)) != 0) {
DEBUG(0,("_srv_net_share_del: Running [%s] returned (%d)\n", command, ret ));
return ERROR_ACCESS_DENIED;
}
diff --git a/source/rpcclient/cmd_spoolss.c b/source/rpcclient/cmd_spoolss.c
index f3f692310d6..52ff8b2cdfe 100644
--- a/source/rpcclient/cmd_spoolss.c
+++ b/source/rpcclient/cmd_spoolss.c
@@ -768,7 +768,7 @@ static uint32 cmd_spoolss_getdriver(struct cli_state *cli, int argc, char **argv
*/
static uint32 cmd_spoolss_enum_drivers(struct cli_state *cli, int argc, char **argv)
{
- uint32 result,
+ uint32 result=0,
info_level = 1;
PRINTER_DRIVER_CTR ctr;
fstring server;
diff --git a/source/rpcclient/rpcclient.c b/source/rpcclient/rpcclient.c
index d2d5ed2d717..db4b5c5bdeb 100644
--- a/source/rpcclient/rpcclient.c
+++ b/source/rpcclient/rpcclient.c
@@ -398,7 +398,7 @@ static uint32 process_cmd(struct cli_state *cli, char *cmd)
BOOL found = False;
pstring buf;
char *p = cmd;
- uint32 result;
+ uint32 result=0;
if (!next_token(&p, buf, " ", sizeof(buf))) {
return 0;
diff --git a/source/smbd/close.c b/source/smbd/close.c
index 10c95398345..45df9b2e0d9 100644
--- a/source/smbd/close.c
+++ b/source/smbd/close.c
@@ -58,7 +58,7 @@ static void check_magic(files_struct *fsp,connection_struct *conn)
slprintf(magic_output,sizeof(fname)-1, "%s.out",fname);
chmod(fname,0755);
- ret = smbrun(fname,&tmp_fd,magic_output);
+ ret = smbrun(fname,&tmp_fd);
DEBUG(3,("Invoking magic command %s gave %d\n",fname,ret));
unlink(fname);
if (ret != 0 || tmp_fd == -1) {
diff --git a/source/smbd/message.c b/source/smbd/message.c
index c04ee952606..56088549758 100644
--- a/source/smbd/message.c
+++ b/source/smbd/message.c
@@ -91,7 +91,7 @@ static void msg_deliver(void)
pstring_sub(s,"%t",alpha_strcpy(alpha_msgto,msgto,sizeof(alpha_msgto)));
standard_sub_basic(s);
pstring_sub(s,"%s",name);
- smbrun(s,NULL,NULL);
+ smbrun(s,NULL);
}
msgpos = 0;
diff --git a/source/smbd/reply.c b/source/smbd/reply.c
index bcfef60798b..9d91cb9d686 100644
--- a/source/smbd/reply.c
+++ b/source/smbd/reply.c
@@ -507,7 +507,7 @@ int smb_create_user(char *unix_user, char *homedir)
all_string_sub(add_script, "%u", unix_user, sizeof(pstring));
if (homedir)
all_string_sub(add_script, "%H", homedir, sizeof(pstring));
- ret = smbrun(add_script,NULL,NULL);
+ ret = smbrun(add_script,NULL);
DEBUG(3,("smb_create_user: Running the command `%s' gave %d\n",add_script,ret));
return ret;
}
@@ -524,7 +524,7 @@ static int smb_delete_user(char *unix_user)
pstrcpy(del_script, lp_deluser_script());
if (! *del_script) return -1;
all_string_sub(del_script, "%u", unix_user, sizeof(pstring));
- ret = smbrun(del_script,NULL,NULL);
+ ret = smbrun(del_script,NULL);
DEBUG(3,("smb_delete_user: Running the command `%s' gave %d\n",del_script,ret));
return ret;
}
@@ -570,7 +570,7 @@ static BOOL check_server_security(char *orig_user, char *domain, char *unix_user
smb_apasswd, smb_apasslen,
smb_ntpasswd, smb_ntpasslen);
if(ret) {
- struct passwd *pwd;
+ struct passwd *pwd = NULL;
/*
* User validated ok against Domain controller.
@@ -611,7 +611,7 @@ static BOOL check_domain_security(char *orig_user, char *domain, char *unix_user
{
BOOL ret = False;
BOOL user_exists = True;
- struct passwd *pwd;
+ struct passwd *pwd = NULL;
if(lp_security() != SEC_DOMAIN)
return False;
diff --git a/source/smbd/service.c b/source/smbd/service.c
index 6a43a4c6c31..394f8ae46d5 100644
--- a/source/smbd/service.c
+++ b/source/smbd/service.c
@@ -569,7 +569,7 @@ connection_struct *make_connection(char *service,char *user,char *password, int
pstrcpy(cmd,lp_rootpreexec(SNUM(conn)));
standard_sub_conn(conn,cmd);
DEBUG(5,("cmd=%s\n",cmd));
- ret = smbrun(cmd,NULL,NULL);
+ ret = smbrun(cmd,NULL);
if (ret != 0 && lp_rootpreexec_close(SNUM(conn))) {
DEBUG(1,("preexec gave %d - failing connection\n", ret));
conn_free(conn);
@@ -621,7 +621,7 @@ connection_struct *make_connection(char *service,char *user,char *password, int
pstring cmd;
pstrcpy(cmd,lp_preexec(SNUM(conn)));
standard_sub_conn(conn,cmd);
- ret = smbrun(cmd,NULL,NULL);
+ ret = smbrun(cmd,NULL);
if (ret != 0 && lp_preexec_close(SNUM(conn))) {
DEBUG(1,("preexec gave %d - failing connection\n", ret));
conn_free(conn);
@@ -698,7 +698,7 @@ void close_cnum(connection_struct *conn, uint16 vuid)
pstring cmd;
pstrcpy(cmd,lp_postexec(SNUM(conn)));
standard_sub_conn(conn,cmd);
- smbrun(cmd,NULL,NULL);
+ smbrun(cmd,NULL);
unbecome_user();
}
@@ -708,7 +708,7 @@ void close_cnum(connection_struct *conn, uint16 vuid)
pstring cmd;
pstrcpy(cmd,lp_rootpostexec(SNUM(conn)));
standard_sub_conn(conn,cmd);
- smbrun(cmd,NULL,NULL);
+ smbrun(cmd,NULL);
}
conn_free(conn);
}
diff --git a/source/smbd/trans2.c b/source/smbd/trans2.c
index ee4ca4eec1c..05a02238957 100644
--- a/source/smbd/trans2.c
+++ b/source/smbd/trans2.c
@@ -1588,7 +1588,7 @@ static int call_trans2setfilepathinfo(connection_struct *conn,
struct utimbuf tvs;
SMB_STRUCT_STAT sbuf;
pstring fname1;
- char *fname;
+ char *fname = NULL;
int fd = -1;
BOOL bad_path = False;
files_struct *fsp = NULL;
diff --git a/source/tdb/tdbutil.c b/source/tdb/tdbutil.c
index 4df7f9004eb..d683d70c469 100644
--- a/source/tdb/tdbutil.c
+++ b/source/tdb/tdbutil.c
@@ -120,16 +120,8 @@ TDB_DATA tdb_fetch_by_string(TDB_CONTEXT *tdb, char *keystr)
/* useful pair of routines for packing/unpacking data consisting of
integers and strings */
-#ifdef HAVE_STDARG_H
size_t tdb_pack(char *buf, int bufsize, char *fmt, ...)
{
-#else /* HAVE_STDARG_H */
- size_t tdb_pack(va_alist)
-va_dcl
-{
- char *buf, *fmt;
- int bufsize;
-#endif /* HAVE_STDARG_H */
va_list ap;
uint16 w;
uint32 d;
@@ -138,26 +130,11 @@ va_dcl
int len;
char *s;
char c;
-#ifdef HAVE_STDARG_H
char *buf0 = buf;
char *fmt0 = fmt;
int bufsize0 = bufsize;
va_start(ap, fmt);
-#else /* HAVE_STDARG_H */
- char *buf0;
- char *fmt0;
- int bufsize0;
-
- va_start(ap);
- buf = va_arg(ap,char *);
- bufsize = va_arg(ap,int);
- fmt = va_arg(ap,char *);
-
- buf0 = buf;
- fmt0 = fmt;
- bufsize0 = bufsize;
-#endif /* HAVE_STDARG_H */
while (*fmt) {
switch ((c = *fmt++)) {
@@ -230,16 +207,8 @@ va_dcl
/* useful pair of routines for packing/unpacking data consisting of
integers and strings */
-#ifdef HAVE_STDARG_H
int tdb_unpack(char *buf, int bufsize, char *fmt, ...)
{
-#else /* HAVE_STDARG_H */
- int tdb_unpack(va_alist)
-va_dcl
-{
- char *buf, *fmt;
- int bufsize;
-#endif /* HAVE_STDARG_H */
va_list ap;
uint16 *w;
uint32 *d;
@@ -248,26 +217,11 @@ va_dcl
void **p;
char *s, **b;
char c;
-#ifdef HAVE_STDARG_H
char *buf0 = buf;
char *fmt0 = fmt;
int bufsize0 = bufsize;
va_start(ap, fmt);
-#else /* HAVE_STDARG_H */
- char *buf0;
- char *fmt0;
- int bufsize0;
-
- va_start(ap);
- buf = va_arg(ap,char *);
- bufsize = va_arg(ap,int);
- fmt = va_arg(ap,char *);
-
- buf0 = buf;
- fmt0 = fmt;
- bufsize0 = bufsize;
-#endif /* HAVE_STDARG_H */
while (*fmt) {
switch ((c=*fmt++)) {
diff --git a/source/utils/smbcacls.c b/source/utils/smbcacls.c
index 48a021afa8d..4803da9f33d 100644
--- a/source/utils/smbcacls.c
+++ b/source/utils/smbcacls.c
@@ -816,7 +816,7 @@ You can string acls together with spaces, commas or newlines\n\
int opt;
char *p;
static pstring servicesf = CONFIGFILE;
- struct cli_state *cli;
+ struct cli_state *cli=NULL;
enum acl_mode mode;
char *the_acl = NULL;
enum chown_mode change_mode = REQUEST_NONE;
diff --git a/source/utils/smbcontrol.c b/source/utils/smbcontrol.c
index 26c01ced9e8..c5462ea1fb7 100644
--- a/source/utils/smbcontrol.c
+++ b/source/utils/smbcontrol.c
@@ -97,7 +97,7 @@ Prints out the current Profile level returned by MSG_PROFILELEVEL
void profilelevel_function(int msg_type, pid_t src, void *buf, size_t len)
{
int level;
- char *s;
+ char *s=NULL;
memcpy(&level, buf, sizeof(int));
if (level) {
@@ -175,7 +175,7 @@ static BOOL do_command(char *dest, char *msg_name, char *params[])
{
int i, n, v;
int mtype;
- BOOL retval;
+ BOOL retval=False;
int debuglevel_class[DBGC_LAST];
mtype = parse_type(msg_name);
diff --git a/source/utils/smbrun.c b/source/utils/smbrun.c
deleted file mode 100644
index b7c678411c6..00000000000
--- a/source/utils/smbrun.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- Unix SMB/Netbios implementation.
- Version 1.9.
- external program running routine
- Copyright (C) Andrew Tridgell 1992-1998
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#include "includes.h"
-
-
-/*******************************************************************
-close the low 3 fd's and open dev/null in their place
-********************************************************************/
-static void close_fds(void)
-{
- int fd;
- int i;
- close(0); close(1); close(2);
- /* try and use up these file descriptors, so silly
- library routines writing to stdout etc won't cause havoc */
- for (i=0;i<3;i++) {
- fd = open("/dev/null",O_RDWR,0);
- if (fd < 0) fd = open("/dev/null",O_WRONLY,0);
- if (fd != i) return;
- }
-}
-
-
-/*
-This is a wrapper around the system() call to allow commands to run correctly
-as non root from a program which is switching between root and non-root
-
-It takes 3 arguments as uid,gid,command and runs command after
-becoming a non-root user */
- int main(int argc,char *argv[])
-{
- uid_t uid;
- gid_t gid;
-
- close_fds();
-
- if (argc != 4) exit(2);
-
- uid = (uid_t)atoi(argv[1]);
- gid = (gid_t)atoi(argv[2]);
-
- become_user_permanently( uid, gid);
-
- /* paranoia :-) */
- if (getuid() != uid)
- return(3);
-
- if (geteuid() != getuid())
- return(4);
-
- /* this is to make sure that the system() call doesn't run forever */
- alarm(30);
-
- return(system(argv[3]));
-}