summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-11-27 22:58:11 +0000
committerLuke Leighton <lkcl@samba.org>1999-11-27 22:58:11 +0000
commit70b218b3ea5a285f5016a42b483e78f01ac34eba (patch)
tree6b976980d199aaee1c85b13607f1c049bed49785 /source3/rpcclient
parentad1e5fdd96aa2c2d42b14a55c88d39ec0b927014 (diff)
downloadsamba-70b218b3ea5a285f5016a42b483e78f01ac34eba.tar.gz
samba-70b218b3ea5a285f5016a42b483e78f01ac34eba.tar.bz2
samba-70b218b3ea5a285f5016a42b483e78f01ac34eba.zip
moved at command over to new abstract connection system. matthew, you
initialised dest_wks _after_ using it in at_soon() :-) so i fixed this :) (This used to be commit 0aaf0c9c80b4a506955065e822a356b1c43a5ac5)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_atsvc.c31
1 files changed, 9 insertions, 22 deletions
diff --git a/source3/rpcclient/cmd_atsvc.c b/source3/rpcclient/cmd_atsvc.c
index 39dc5213cf..547ca96053 100644
--- a/source3/rpcclient/cmd_atsvc.c
+++ b/source3/rpcclient/cmd_atsvc.c
@@ -33,7 +33,6 @@ extern int DEBUGLEVEL;
#define DEBUG_TESTING
-extern struct cli_state *smb_cli;
extern FILE* out_hnd;
@@ -160,7 +159,6 @@ scheduler add job
****************************************************************************/
void cmd_at(struct client_info *info, int argc, char *argv[])
{
- uint16 nt_pipe_fnum;
fstring dest_wks;
BOOL add = False;
BOOL del = False;
@@ -173,6 +171,10 @@ void cmd_at(struct client_info *info, int argc, char *argv[])
uint8 flags = JOB_NONINTERACTIVE;
pstring command;
+ safe_strcpy(dest_wks, "\\\\", sizeof(dest_wks));
+ safe_strcat(dest_wks, info->dest_host, sizeof(dest_wks));
+ strupper(dest_wks);
+
while (argc > 1)
{
argc--;
@@ -289,14 +291,6 @@ void cmd_at(struct client_info *info, int argc, char *argv[])
return;
}
- safe_strcpy(dest_wks, "\\\\", sizeof(dest_wks));
- safe_strcat(dest_wks, info->dest_host, sizeof(dest_wks));
- strupper(dest_wks);
-
- /* open scheduler session. */
- if (!cli_nt_session_open(smb_cli, PIPE_ATSVC, &nt_pipe_fnum))
- return;
-
if (add) /* add job */
{
AT_JOB_INFO job;
@@ -311,8 +305,7 @@ void cmd_at(struct client_info *info, int argc, char *argv[])
display_at_job_info(out_hnd, ACTION_ENUMERATE, &job, command);
display_at_job_info(out_hnd, ACTION_FOOTER , &job, command);
- if (at_add_job(smb_cli, nt_pipe_fnum, dest_wks, &job,
- command, &jobid))
+ if (at_add_job(dest_wks, &job, command, &jobid))
{
fprintf(out_hnd, "\tJob ID: %d\n\n", jobid);
}
@@ -322,14 +315,12 @@ void cmd_at(struct client_info *info, int argc, char *argv[])
if (jobid == -1)
{
fprintf(out_hnd, "\tDeleting all jobs.\n\n");
- at_del_job(smb_cli, nt_pipe_fnum, dest_wks,
- 0, 0xffffffff);
+ at_del_job(dest_wks, 0, 0xffffffff);
}
else
{
fprintf(out_hnd, "\tDeleting job %d.\n\n", jobid);
- at_del_job(smb_cli, nt_pipe_fnum, dest_wks,
- jobid, jobid);
+ at_del_job(dest_wks, jobid, jobid);
}
}
@@ -339,8 +330,7 @@ void cmd_at(struct client_info *info, int argc, char *argv[])
char **commands;
uint32 num_jobs;
- if (at_enum_jobs(smb_cli, nt_pipe_fnum, dest_wks, &num_jobs,
- jobs, &commands))
+ if (at_enum_jobs(dest_wks, &num_jobs, jobs, &commands))
{
display_at_enum_info(out_hnd, ACTION_HEADER , num_jobs, jobs, commands);
display_at_enum_info(out_hnd, ACTION_ENUMERATE, num_jobs, jobs, commands);
@@ -353,14 +343,11 @@ void cmd_at(struct client_info *info, int argc, char *argv[])
{
AT_JOB_INFO job;
- if (at_query_job(smb_cli, nt_pipe_fnum, dest_wks, jobid, &job, command))
+ if (at_query_job(dest_wks, jobid, &job, command))
{
display_at_job_info(out_hnd, ACTION_HEADER , &job, command);
display_at_job_info(out_hnd, ACTION_ENUMERATE, &job, command);
display_at_job_info(out_hnd, ACTION_FOOTER , &job, command);
}
}
-
- /* close the session */
- cli_nt_session_close(smb_cli, nt_pipe_fnum);
}