From a62fc323540429a6381220b42a8b84bb5195abdb Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sat, 12 Feb 2011 11:52:12 -0500 Subject: [PATCH] Windows: Fix GetIoctlHandle path construction GetIoctlHandle() is used to construct the magic pioctl file path used to initiate pioctl operations with the cache manager. The first error introduced double directory separators. The second error was testing an uninitialized value which could have resulted in a missing directory separator. Change-Id: I691fde63adf295c380312772e7d320ff99e89d70 Reviewed-on: http://gerrit.openafs.org/3929 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/sys/pioctl_nt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sys/pioctl_nt.c b/src/sys/pioctl_nt.c index 5b064d2fe..71d7982b8 100644 --- a/src/sys/pioctl_nt.c +++ b/src/sys/pioctl_nt.c @@ -641,10 +641,10 @@ GetIoctlHandle(char *fileNamep, HANDLE * handlep) count++; i++; } - if (fileNamep[i] == 0) + if (fileNamep[i] == 0 || (fileNamep[i-1] != '\\' && fileNamep[i-1] != '/')) tbuffer[i++] = '\\'; tbuffer[i] = 0; - strcat(tbuffer, SMB_IOCTL_FILENAME); + strcat(tbuffer, SMB_IOCTL_FILENAME_NOSLASH); } else { char curdir[MAX_PATH]=""; @@ -682,7 +682,7 @@ GetIoctlHandle(char *fileNamep, HANDLE * handlep) count++; i++; } - if (tbuffer[i] == 0) + if (curdir[i] == 0 || (curdir[i-1] != '\\' && curdir[i-1] != '/')) tbuffer[i++] = '\\'; tbuffer[i] = 0; strcat(tbuffer, SMB_IOCTL_FILENAME_NOSLASH); -- 2.39.5