]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
windows-list-symlink-20080820
authorJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 20 Aug 2008 20:44:56 +0000 (20:44 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 20 Aug 2008 20:44:56 +0000 (20:44 +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.

src/WINNT/afsd/cm_ioctl.c

index 531a203e421623202e5f9c6e1a978b3a415fa982..a161f90b3012e8f877f8fa4913cf7f96dc566e8d 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;