summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2003-03-30 16:36:21 +0000
committerVolker Lendecke <vlendec@samba.org>2003-03-30 16:36:21 +0000
commit17d188d99971ab0e9a61aecef4ed29c7925aac3c (patch)
tree227adde0b055335f348a5122426dad1a74a41370 /source3/smbd
parent7ea0ef92cbd49db6d7ae0d1e72b8f4f1f1fb7e7c (diff)
downloadsamba-17d188d99971ab0e9a61aecef4ed29c7925aac3c.tar.gz
samba-17d188d99971ab0e9a61aecef4ed29c7925aac3c.tar.bz2
samba-17d188d99971ab0e9a61aecef4ed29c7925aac3c.zip
This changes our handling of invalid service types that the
client requested on tconx. We now return the same error code like NT4SP6 and W2kSP3 return. TCONDEV is a little test for this. Volker (This used to be commit 6ab88f31d6773f16baff8421ec9e530461cc8f93)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/service.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index f67361e66a..5c87eb0729 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -227,22 +227,27 @@ static NTSTATUS share_sanity_checks(int snum, fstring dev)
return NT_STATUS_ACCESS_DENIED;
}
- /* you can only connect to the IPC$ service as an ipc device */
- if (strequal(lp_fstype(snum), "IPC"))
- fstrcpy(dev,"IPC");
-
if (dev[0] == '?' || !dev[0]) {
if (lp_print_ok(snum)) {
fstrcpy(dev,"LPT1:");
+ } else if (strequal(lp_fstype(snum), "IPC")) {
+ fstrcpy(dev, "IPC");
} else {
fstrcpy(dev,"A:");
}
}
- /* if the request is as a printer and you can't print then refuse */
strupper(dev);
- if (!lp_print_ok(snum) && (strncmp(dev,"LPT",3) == 0)) {
- DEBUG(1,("Attempt to connect to non-printer as a printer\n"));
+
+ if (lp_print_ok(snum)) {
+ if (!strequal(dev, "LPT:")) {
+ return NT_STATUS_BAD_DEVICE_TYPE;
+ }
+ } else if (strequal(lp_fstype(snum), "IPC")) {
+ if (!strequal(dev, "IPC")) {
+ return NT_STATUS_BAD_DEVICE_TYPE;
+ }
+ } else if (!strequal(dev, "A:")) {
return NT_STATUS_BAD_DEVICE_TYPE;
}