summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/util.c4
-rw-r--r--source3/smbd/reply.c5
-rw-r--r--source3/smbd/server.c31
3 files changed, 33 insertions, 7 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 0f2786a5cf..3b4453dd5b 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -91,7 +91,11 @@ void setup_logging(char *pname,BOOL interactive)
if (!interactive) {
char *p = strrchr(pname,'/');
if (p) pname = p+1;
+#ifdef LOG_DAEMON
openlog(pname, LOG_PID, LOG_DAEMON);
+#else /* LOG_DAEMON - for old systems that have no facility codes. */
+ openlog(pname, LOG_PID);
+#endif /* LOG_DAEMON */
}
#endif
if (interactive) {
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 8e304a77df..58b509ecec 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -269,11 +269,8 @@ int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize)
else
{
char *fsname = "NTFS";
- int devlen = strlen(devicename)+1;
- int fslen = strlen(fsname)+1;
- int len = devlen + fslen + 1;
-
char *p;
+
set_message(outbuf,3,3,True);
p = smb_buf(outbuf);
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 93724a9861..50f3214919 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -1978,6 +1978,18 @@ struct
{0,0,0}
};
+/* Mapping for old clients. */
+
+struct
+{
+ int new_smb_error;
+ int old_smb_error;
+ int protocol_level;
+} old_client_errmap[] =
+{
+ {ERRbaddirectory, ERRbadpath, (int)PROTOCOL_NT1},
+ {0,0,0}
+};
/****************************************************************************
create an error packet from errno
@@ -1998,17 +2010,30 @@ int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int
else
{
while (unix_smb_errmap[i].smbclass != 0)
- {
- if (unix_smb_errmap[i].unixerror == errno)
+ {
+ if (unix_smb_errmap[i].unixerror == errno)
{
eclass = unix_smb_errmap[i].smbclass;
ecode = unix_smb_errmap[i].smbcode;
break;
}
i++;
- }
+ }
}
+ /* Make sure we don't return error codes that old
+ clients don't understand. */
+
+ for(i = 0; old_client_errmap[i].new_smb_error != 0; i++)
+ {
+ if((Protocol < old_client_errmap[i].protocol_level) &&
+ (old_client_errmap[i].new_smb_error == ecode))
+ {
+ ecode = old_client_errmap[i].old_smb_error;
+ break;
+ }
+ }
+
return(error_packet(inbuf,outbuf,eclass,ecode,line));
}