mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-10 21:42:00 +03:00
(smbfs_stat): Don't write to path.
This commit is contained in:
parent
ca70ee44c5
commit
e751871446
23
vfs/smbfs.c
23
vfs/smbfs.c
@ -1439,7 +1439,7 @@ smbfs_stat (vfs * me, char *path, struct stat *buf)
|
|||||||
{
|
{
|
||||||
smbfs_connection *sc;
|
smbfs_connection *sc;
|
||||||
pstring server_url;
|
pstring server_url;
|
||||||
char *service, *pp;
|
char *service, *pp, *at;
|
||||||
const char *p;
|
const char *p;
|
||||||
|
|
||||||
DEBUG (3, ("smbfs_stat(path:%s)\n", path));
|
DEBUG (3, ("smbfs_stat(path:%s)\n", path));
|
||||||
@ -1463,16 +1463,19 @@ smbfs_stat (vfs * me, char *path, struct stat *buf)
|
|||||||
p++;
|
p++;
|
||||||
|
|
||||||
pp = strchr (p, '/'); /* advance past next '/' */
|
pp = strchr (p, '/'); /* advance past next '/' */
|
||||||
|
at = strchr (p, '@');
|
||||||
pstrcpy (server_url, URL_HEADER);
|
pstrcpy (server_url, URL_HEADER);
|
||||||
if (pp) {
|
if (at && at < pp) { /* user@server */
|
||||||
char *t = strchr (p, '@');
|
char *z = &(server_url[sizeof (server_url) - 1]);
|
||||||
if (t && t < pp) { /* user@server */
|
const char *s = p;
|
||||||
*t = 0;
|
|
||||||
pstrcat (server_url, p);
|
at = &(server_url [HEADER_LEN]) + (at - p + 1);
|
||||||
pstrcat (server_url, "@");
|
if (z > at)
|
||||||
*t = '@';
|
z = at;
|
||||||
}
|
at = &(server_url [HEADER_LEN]);
|
||||||
|
while (at < z)
|
||||||
|
*at++ = *s++;
|
||||||
|
*z = 0;
|
||||||
}
|
}
|
||||||
pstrcat (server_url, current_bucket->host);
|
pstrcat (server_url, current_bucket->host);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user