-
- if (strlen(name) > 255)
- return EINVAL;
-
- result = _mbr_MapName(GetServerPort(), 1, (char*)name, (guid_t*)uu);
-
- if (result == KERN_FAILURE)
- return ENOENT;
- else if (result != KERN_SUCCESS)
- return EIO;
-
+
+ if (name == NULL) return EINVAL;
+ if (strlen(name) > 255) return EINVAL;
+
+ token.val[0] = -1;
+ token.val[1] = -1;
+
+ result = _mbr_MapName(GetServerPort(), 1, (char *)name, (guid_t *)uu, &token);
+ if (result == KERN_FAILURE) return ENOENT;
+ else if (result != KERN_SUCCESS) return EIO;
+
+ if (token.val[0] != 0) return EAUTH;
+