From beddd7058f4c45695622776ef190bb6503dfcbd8 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 11 Oct 2002 21:01:46 +0000 Subject: sync with SAMBA_2_2 for 2.2.6rc3 --- source/client/smbspool.c | 4 ++++ source/smbd/filename.c | 12 ++++++++++++ 2 files changed, 16 insertions(+) (limited to 'source') diff --git a/source/client/smbspool.c b/source/client/smbspool.c index 64484f0aa99..88d7421813f 100644 --- a/source/client/smbspool.c +++ b/source/client/smbspool.c @@ -307,18 +307,21 @@ smb_connect(char *workgroup, /* I - Workgroup */ if (!cli_set_port(c, SMB_PORT)) { fputs("ERROR: cli_set_port() failed...\n", stderr); + cli_shutdown(c); return (NULL); } if (!cli_connect(c, server, &ip)) { fputs("ERROR: cli_connect() failed...\n", stderr); + cli_shutdown(c); return (NULL); } if (!cli_session_request(c, &calling, &called)) { fputs("ERROR: cli_session_request() failed...\n", stderr); + cli_shutdown(c); return (NULL); } @@ -339,6 +342,7 @@ smb_connect(char *workgroup, /* I - Workgroup */ workgroup)) { fprintf(stderr, "ERROR: SMB session setup failed: %s\n", cli_errstr(c)); + cli_shutdown(c); return (NULL); } diff --git a/source/smbd/filename.c b/source/smbd/filename.c index 51246dbc056..fd4377c54fd 100644 --- a/source/smbd/filename.c +++ b/source/smbd/filename.c @@ -324,6 +324,18 @@ BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component, pstrcat(start,"/"); pstrcat(start,rest); *end = '\0'; + } else { + /* + * We just scanned for, and found the end of the path. + * We must return a valid stat struct if it exists. + * JRA. + */ + + if (vfs_stat(conn,name, &st) == 0) { + *pst = st; + } else { + ZERO_STRUCT(st); + } } } /* end else */ -- cgit