windows-fs-path-in-afs-20090507
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 7 May 2009 16:02:53 +0000 (16:02 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 7 May 2009 16:02:53 +0000 (16:02 +0000)
LICENSE MIT

Switch the PathInAfs test to use VIOCGETFID instead of VIOC_GET_CELL_NAME
so that the literal option can be used.

src/WINNT/afsd/fs.c

index e47dd5a..c87a27a 100644 (file)
@@ -246,13 +246,20 @@ static int
 InAFS(char *apath)
 {
     struct ViceIoctl blob;
+    cm_ioctlQueryOptions_t options;
+    cm_fid_t fid;
     afs_int32 code;
 
-    blob.in_size = 0;
-    blob.out_size = MAXSIZE;
-    blob.out = space;
+    memset(&options, 0, sizeof(options));
+    options.size = sizeof(options);
+    options.field_flags |= CM_IOCTL_QOPTS_FIELD_LITERAL;
+    options.literal = 1;
+    blob.in_size = options.size;    /* no variable length data */
+    blob.in = &options;
+    blob.out_size = sizeof(cm_fid_t);
+    blob.out = (char *) &fid;
 
-    code = pioctl_utf8(apath, VIOC_FILE_CELL_NAME, &blob, 1);
+    code = pioctl_utf8(apath, VIOCGETFID, &blob, 1);
     if (code) {
        if ((errno == EINVAL) || (errno == ENOENT)) 
             return 0;