+ if (!strcasecmp(info[FS_TYPE], "AFS")) {
+ char *path, *args[3], *p;
+ int status, depth, i;
+ if (GetTypeFromUser("Filesystem's lockertype", "lockertype",
+ &info[FS_L_TYPE]) == SUB_ERROR)
+ return(NULL);
+ if (!name || newdefaults) {
+ free(info[FS_PACK]);
+ lowercase(info[FS_MACHINE]);
+ sprintf(temp_buf, "%s:%s", info[FS_MACHINE], info[FS_L_TYPE]);
+ args[0] = temp_buf;
+ args[1] = "AFSPATH";
+ args[2] = "*";
+ path = "???";
+ status = do_mr_query("get_alias", 3, args,
+ GetAliasValue, &path);
+ if (status == MR_SUCCESS) {
+ p = index(path, ':');
+ if (p) {
+ *p = 0;
+ depth = atoi(++p);
+ } else
+ depth = 0;
+ sprintf(temp_buf, "/afs/%s/%s", info[FS_MACHINE], path);
+ if (depth >= 0) {
+ for (p=info[FS_NAME]; *p&&(p-info[FS_NAME])<depth; p++) {
+ if (islower(*p)) {
+ strcat(temp_buf, "/x");
+ temp_buf[strlen(temp_buf)-1] = *p;
+ } else {
+ sprintf(temp_buf, "/afs/%s/%s/other", info[FS_MACHINE], path);
+ break;
+ }
+ }
+ } else if (depth = -1) {
+ if (isdigit(info[FS_NAME][0])) {
+ strcat(temp_buf, "/");
+ depth = strlen(temp_buf);
+ for (p = info[FS_NAME]; *p && isdigit(*p); p++) {
+ temp_buf[depth++] = *p;
+ temp_buf[depth] = 0;
+ }
+ } else
+ strcat(temp_buf, "/other");
+ } else {
+ /* no default */
+ }
+ strcat(temp_buf, "/");
+ strcat(temp_buf, info[FS_NAME]);
+ free(path);
+ } else {
+ sprintf(temp_buf, "/afs/%s/%s/%s", info[FS_MACHINE],
+ lowercase(info[FS_L_TYPE]), info[FS_NAME]);
+ }
+ info[FS_PACK] = strsave(temp_buf);
+ }
+ }