]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-windows-list-symlink-20080820
authorJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 20 Aug 2008 20:46:16 +0000 (20:46 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 20 Aug 2008 20:46:16 +0000 (20:46 +0000)
LICENSE MIT

Another casaulty of the Unicode transition, the return value of the
ListLink operation was not being convered from wchar to char before
it was copied into the output buffer.

(cherry picked from commit a00f706eb67c257af9892557cfb6ad35594144cf)

src/WINNT/afsd/cm_ioctl.c

index d4645711522bc7a5e5f84b6d9d9e5ac13809d067..34918db7ac8bfeb5ca4efede087de9aa2e8a22cc 100644 (file)
@@ -1959,16 +1959,20 @@ cm_IoctlListlink(struct cm_ioctl *ioctlp, struct cm_user *userp, cm_scache_t *ds
     code = cm_AssembleLink(scp, "", &newRootScp, &spacep, userp, reqp);
     cm_ReleaseSCache(scp);
     if (code == 0) {
+        char * linkstr;
         cp = ioctlp->outDatap;
         if (newRootScp != NULL) {
             StringCbCopyA(cp, SMB_IOCTL_MAXDATA - (cp - ioctlp->outAllocp), cm_mountRoot);
             StringCbCatA(cp, SMB_IOCTL_MAXDATA - (cp - ioctlp->outAllocp), "/");
             cp += strlen(cp);
         }
-        StringCbCopyA(cp, SMB_IOCTL_MAXDATA - (cp - ioctlp->outAllocp), spacep->data);
+
+        linkstr = cm_ClientStringToFsStringAlloc(spacep->wdata, -1, NULL);
+        StringCbCopyA(cp, SMB_IOCTL_MAXDATA - (cp - ioctlp->outAllocp), linkstr);
         cp += strlen(cp) + 1;
         ioctlp->outDatap = cp;
         cm_FreeSpace(spacep);
+        free(linkstr);
         if (newRootScp != NULL)
             cm_ReleaseSCache(newRootScp);
         code = 0;