diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-10-12 06:07:55 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:59:49 -0500 |
commit | 2ec58445cac6152a652024372d367fc23d4770da (patch) | |
tree | 88958ca78fc68c6b60753bc1504b472546ae5561 /source4 | |
parent | ca23572f700a059970e0d0e08ee4feef972f326f (diff) | |
download | samba-2ec58445cac6152a652024372d367fc23d4770da.tar.gz samba-2ec58445cac6152a652024372d367fc23d4770da.tar.bz2 samba-2ec58445cac6152a652024372d367fc23d4770da.zip |
r2931: use next_codepoint() to ensure we properly handle multi-byte characters in pvfs_unix_path()
(This used to be commit 0acf95d84c51d564f7215d34364c37ca74a2a150)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/ntvfs/posix/pvfs_resolve.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source4/ntvfs/posix/pvfs_resolve.c b/source4/ntvfs/posix/pvfs_resolve.c index 01f6b13ec2..205e1e283f 100644 --- a/source4/ntvfs/posix/pvfs_resolve.c +++ b/source4/ntvfs/posix/pvfs_resolve.c @@ -217,8 +217,10 @@ static NTSTATUS pvfs_unix_path(struct pvfs_state *pvfs, const char *cifs_name, /* now do an in-place conversion of '\' to '/', checking for legal characters */ - for (;*p;p++) { - switch (*p) { + while (*p) { + size_t c_size; + codepoint_t c = next_codepoint(p, &c_size); + switch (c) { case '\\': if (name->has_wildcard) { /* wildcards are only allowed in the last part @@ -251,6 +253,8 @@ static NTSTATUS pvfs_unix_path(struct pvfs_state *pvfs, const char *cifs_name, case '|': return NT_STATUS_ILLEGAL_CHARACTER; } + + p += c_size; } name->full_name = ret; |