From: Jeffrey Altman Date: Fri, 4 Jun 2004 04:00:39 +0000 (+0000) Subject: ioctl-handle-20040603 X-Git-Tag: openafs-devel-1_3_65~71 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=913876f3a96da9608a18852cb54035854b0eb854;p=packages%2Fo%2Fopenafs.git ioctl-handle-20040603 * Fix GetIoctlHandle so that it will create the handle on the correct volume when a drive letter is not specified as part of the source path --- diff --git a/src/sys/pioctl_nt.c b/src/sys/pioctl_nt.c index 8fac4d497..a08d3ba9d 100644 --- a/src/sys/pioctl_nt.c +++ b/src/sys/pioctl_nt.c @@ -103,7 +103,7 @@ GetIoctlHandle(char *fileNamep, HANDLE * handlep) { char *drivep; char netbiosName[MAX_NB_NAME_LENGTH]; - char tbuffer[100]=""; + char tbuffer[256]=""; HANDLE fh; if (fileNamep) { @@ -112,6 +112,15 @@ GetIoctlHandle(char *fileNamep, HANDLE * handlep) tbuffer[0] = *(drivep - 1); tbuffer[1] = ':'; strcpy(tbuffer + 2, SMB_IOCTL_FILENAME); + } else { + char curdir[256]=""; + + GetCurrentDirectory(sizeof(curdir), curdir); + if ( curdir[1] == ':' ) { + tbuffer[0] = curdir[0]; + tbuffer[1] = ':'; + strcpy(tbuffer + 2, SMB_IOCTL_FILENAME); + } } } if (!tbuffer[0]) {