1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

handle errors from receive_smb better, and print error string

(This used to be commit 7814eca4b2)
This commit is contained in:
Andrew Tridgell 1996-05-29 07:54:01 +00:00
parent debd5b6ae9
commit ec52001809
2 changed files with 9 additions and 9 deletions

View File

@ -2683,12 +2683,11 @@ BOOL receive_smb(int fd,char *buffer,int timeout)
if (len == -1) if (len == -1)
return(False); return(False);
if (len > BUFFER_SIZE) if (len > BUFFER_SIZE) {
{ DEBUG(0,("Invalid packet length! (%d bytes)\n",len));
DEBUG(0,("Invalid packet length! (%d bytes)\n",len)); if (len > BUFFER_SIZE + (SAFETY_MARGIN/2))
if (len > BUFFER_SIZE + (SAFETY_MARGIN/2)) exit(1);
exit(1); }
}
ok = (read_data(fd,buffer+4,len) == len); ok = (read_data(fd,buffer+4,len) == len);

View File

@ -2394,7 +2394,8 @@ int make_connection(char *service,char *user,char *password, int pwlen, char *de
if (ChDir(pcon->connectpath) != 0) if (ChDir(pcon->connectpath) != 0)
{ {
DEBUG(0,("Can't change directory to %s\n",pcon->connectpath)); DEBUG(0,("Can't change directory to %s (%s)\n",
pcon->connectpath,strerror(errno)));
pcon->open = False; pcon->open = False;
unbecome_user(); unbecome_user();
if (!IS_IPC(cnum)) { if (!IS_IPC(cnum)) {
@ -3721,8 +3722,8 @@ void process(void )
extern int keepalive; extern int keepalive;
/* check for socket failure */ /* check for socket failure */
if (errno == EBADF) { if (errno) {
DEBUG(3,("%s Bad file descriptor - exiting\n",timestring())); DEBUG(3,("receive_smb error (%s) exiting\n",strerror(errno)));
return; return;
} }