summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-06-20 03:05:09 +0000
committerAndrew Tridgell <tridge@samba.org>2001-06-20 03:05:09 +0000
commitfcda2645f099e5d356361ec3de4f45d97285f0b5 (patch)
tree38c0fe748321786e6c457d62f1426d1dca9d572c /source3/utils
parent1c831ce6d868ca5f7de498c8c7f90efe2238d1b4 (diff)
downloadsamba-fcda2645f099e5d356361ec3de4f45d97285f0b5.tar.gz
samba-fcda2645f099e5d356361ec3de4f45d97285f0b5.tar.bz2
samba-fcda2645f099e5d356361ec3de4f45d97285f0b5.zip
added a close-share smbcontrol message that forcibly closes a share in smbd (to allow unmount)
(This used to be commit 15b17a80db605a55f667c95fb7e316877a441887)
Diffstat (limited to 'source3/utils')
-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);
}