1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

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 dadb1ffb4c)
This commit is contained in:
Jeremy Allison 1997-09-02 22:21:38 +00:00
parent 918cc5f033
commit e1e4b37ac7
3 changed files with 33 additions and 7 deletions

View File

@ -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) {

View File

@ -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);

View File

@ -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
@ -2009,6 +2021,19 @@ int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int
}
}
/* 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));
}