summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1997-09-02 22:21:38 +0000
committerJeremy Allison <jra@samba.org>1997-09-02 22:21:38 +0000
commite1e4b37ac785da3829f4326722c34a473a17ade5 (patch)
tree484ddd3771b13b01841aeffefb8b209887f10be3 /source3
parent918cc5f033360508da21d61ca1358ba8c7f0700d (diff)
downloadsamba-e1e4b37ac785da3829f4326722c34a473a17ade5.tar.gz
samba-e1e4b37ac785da3829f4326722c34a473a17ade5.tar.bz2
samba-e1e4b37ac785da3829f4326722c34a473a17ade5.zip
reply.c: Removed unused variables. Caught by gcc -Wall -Werror
server.c: Fix for old DOS clients not understanding ERRbaddirectory - map to ERRbadpath. util.c: Fix for systems with no LOG_DAEMON facility. Jeremy (jallison@whistle.com) (This used to be commit dadb1ffb4ca5222c0b62d785cd714d65cae328e8)
Diffstat (limited to 'source3')
-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));
}