summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-04-13 19:12:06 +0000
committerJeremy Allison <jra@samba.org>2001-04-13 19:12:06 +0000
commit2ef68c7e92d4661664f0410509f7cb551e74a198 (patch)
tree7a3ea392bf8664e28ad46b2edb1afd750335ccc9 /source3/rpc_server
parent14748b0bf56239695cadb6aa40d9095259ebb6e2 (diff)
downloadsamba-2ef68c7e92d4661664f0410509f7cb551e74a198.tar.gz
samba-2ef68c7e92d4661664f0410509f7cb551e74a198.tar.bz2
samba-2ef68c7e92d4661664f0410509f7cb551e74a198.zip
Merge of Andrew's changes in 2.2.
Jeremy. (This used to be commit fc76681812b1469208ad6c8847afdfc68bc6db49)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_reg_nt.c2
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c26
-rw-r--r--source3/rpc_server/srv_srvsvc_nt.c10
3 files changed, 17 insertions, 21 deletions
diff --git a/source3/rpc_server/srv_reg_nt.c b/source3/rpc_server/srv_reg_nt.c
index 4f941e3e1b..502d551437 100644
--- a/source3/rpc_server/srv_reg_nt.c
+++ b/source3/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/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 3bf44cd041..917885eafb 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/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)
@@ -6045,7 +6041,7 @@ uint32 _spoolss_setprinterdata( pipes_struct *p, SPOOL_Q_SETPRINTERDATA *q_u, SP
ZERO_STRUCT(old_param);
if (get_specific_param(*printer, 2, param->value, &old_param.data,
- &old_param.type, (unsigned int *)&old_param.data_len)) {
+ &old_param.type, (uint32 *)&old_param.data_len)) {
if (param->type == old_param.type &&
param->data_len == old_param.data_len &&
diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c
index e5d93b8b3d..887c100d57 100644
--- a/source3/rpc_server/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srv_srvsvc_nt.c
@@ -50,7 +50,7 @@ static void init_srv_share_info_1(SRV_SHARE_INFO_1 *sh1, int snum)
if (lp_print_ok(snum))
type = STYPE_PRINTQ;
- if (strequal("IPC", lp_fstype(snum)))
+ if (strequal("IPC$", net_name) || strequal("ADMIN$", net_name))
type = STYPE_IPC;
if (net_name[len_net_name] == '$')
type |= STYPE_HIDDEN;
@@ -85,7 +85,7 @@ static void init_srv_share_info_2(SRV_SHARE_INFO_2 *sh2, int snum)
if (lp_print_ok(snum))
type = STYPE_PRINTQ;
- if (strequal("IPC", lp_fstype(snum)))
+ if (strequal("IPC$", net_name) || strequal("ADMIN$", net_name))
type = STYPE_IPC;
if (net_name[len_net_name] == '$')
type |= STYPE_HIDDEN;
@@ -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;
}