summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2002-10-11 21:01:46 +0000
committerGerald Carter <jerry@samba.org>2002-10-11 21:01:46 +0000
commitbeddd7058f4c45695622776ef190bb6503dfcbd8 (patch)
treea668d4a2f1afd817814967769fa00e8f04ece991 /source
parente3dcaa9d6d29f8c083ac845dfae47ebf80e7f147 (diff)
downloadsamba-beddd7058f4c45695622776ef190bb6503dfcbd8.tar.gz
samba-beddd7058f4c45695622776ef190bb6503dfcbd8.tar.xz
samba-beddd7058f4c45695622776ef190bb6503dfcbd8.zip
sync with SAMBA_2_2 for 2.2.6rc3
Diffstat (limited to 'source')
-rw-r--r--source/client/smbspool.c4
-rw-r--r--source/smbd/filename.c12
2 files changed, 16 insertions, 0 deletions
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 */