+static struct aliasent *
+extract_alias(XDR *xdr)
+{
+ int i, j, nkeys, nvals, status;
+ char *key, **vals;
+ struct aliasent *a;
+
+ if (xdr == NULL) return NULL;
+
+ if (!xdr_int(xdr, &nkeys)) return NULL;
+
+ a = (struct aliasent *)calloc(1, sizeof(struct aliasent));
+
+ for (i = 0; i < nkeys; i++)
+ {
+ key = NULL;
+ vals = NULL;
+ nvals = 0;
+
+ status = _lu_xdr_attribute(xdr, &key, &vals, &nvals);
+ if (status < 0)
+ {
+ free_alias(a);
+ return NULL;
+ }
+
+ if (nvals == 0)
+ {
+ free(key);
+ continue;
+ }
+
+ j = 0;
+
+ if ((a->alias_name == NULL) && (!strcmp("name", key)))
+ {
+ a->alias_name = vals[0];
+ j = 1;
+ }
+ else if (!strcmp("alias_local", key))
+ {
+ a->alias_local = atoi(vals[0]);
+ }
+ else if ((a->alias_members == NULL) && (!strcmp("members", key)))
+ {
+ a->alias_members_len = nvals;
+ a->alias_members = vals;
+ j = nvals;
+ vals = NULL;
+ }
+
+ free(key);
+ if (vals != NULL)
+ {
+ for (; j < nvals; j++) free(vals[j]);
+ free(vals);
+ }
+ }
+
+ if (a->alias_name == NULL) a->alias_name = strdup("");
+ if (a->alias_members == NULL) a->alias_members = (char **)calloc(1, sizeof(char *));
+
+ return a;
+}
+
+static struct aliasent *
+copy_alias(struct aliasent *in)