summaryrefslogtreecommitdiff
path: root/source3/utils/smbcontrol.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils/smbcontrol.c')
-rw-r--r--source3/utils/smbcontrol.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/source3/utils/smbcontrol.c b/source3/utils/smbcontrol.c
index 843d56234b..27a3b61170 100644
--- a/source3/utils/smbcontrol.c
+++ b/source3/utils/smbcontrol.c
@@ -32,6 +32,7 @@ static struct {
{"profilelevel", MSG_REQ_PROFILELEVEL},
{"debuglevel", MSG_REQ_DEBUGLEVEL},
{"printer-notify", MSG_PRINTER_NOTIFY},
+ {"close-share", MSG_SMB_FORCE_TDIS},
{NULL, -1}
};
@@ -206,7 +207,7 @@ static BOOL do_command(char *dest, char *msg_name, char **params)
}
case MSG_PROFILE:
- if (!params[0]) {
+ if (!params || !params[0]) {
fprintf(stderr,"MSG_PROFILE needs a parameter\n");
return(False);
}
@@ -277,7 +278,7 @@ static BOOL do_command(char *dest, char *msg_name, char **params)
fprintf(stderr,"printer-notify can only be sent to smbd\n");
return(False);
}
- if (!params[0]) {
+ if (!params || !params[0]) {
fprintf(stderr, "printer-notify needs a printer name\n");
return (False);
}
@@ -285,12 +286,25 @@ static BOOL do_command(char *dest, char *msg_name, char **params)
strlen(params[0]) + 1, False);
break;
+ case MSG_SMB_FORCE_TDIS:
+ if (!strequal(dest, "smbd")) {
+ fprintf(stderr,"close-share can only be sent to smbd\n");
+ return(False);
+ }
+ if (!params || !params[0]) {
+ fprintf(stderr, "close-share needs a share name or '*'\n");
+ return (False);
+ }
+ retval = send_message(dest, MSG_SMB_FORCE_TDIS, params[0],
+ strlen(params[0]) + 1, False);
+ break;
+
case MSG_PING:
if (!pong_registered) {
message_register(MSG_PONG, pong_function);
pong_registered = True;
}
- if (!params[0]) {
+ if (!params || !params[0]) {
fprintf(stderr,"MSG_PING needs a parameter\n");
return(False);
}