struct Acl *afs_getacl(char *path)
afs_getacl(char *path)
struct Acl *afs_getacl(char *path){    struct Acl *oldacl;    struct ViceIoctl a_params;    struct AclEntry *pos=NULL;    struct AclEntry *neg=NULL;    char *curptr;    char tmpname[MAXNAME];    int tmprights;    int i;    oldacl=(struct Acl *) malloc(sizeof(struct Acl));    if(oldacl == NULL) {	printf("fs: Out of memory\n");	return NULL;    }    a_params.in_size=0;    a_params.out_size=MAXSIZE;    a_params.in=NULL;    a_params.out=malloc(MAXSIZE);    if(a_params.out == NULL) {	printf ("fs: Out of memory\n");	free (oldacl);	return NULL;    }        if(k_pioctl(path,VIOCGETAL,&a_params,1)==-1) {	fserr(PROGNAME, errno, path);	free (oldacl);	free(a_params.out);	return NULL;    }    curptr=a_params.out;    /* Number of pos/neg entries parsing */    sscanf(curptr, "%d\n%d\n", &oldacl->NumPositiveEntries,	   &oldacl->NumNegativeEntries);    skipline(&curptr);    skipline(&curptr);      if(oldacl->NumPositiveEntries)	for(i=0; i<oldacl->NumPositiveEntries; i++) {      	    sscanf(curptr, "%100s %d", tmpname, &tmprights);	    skipline(&curptr);	    if(!i) {		pos=malloc(sizeof(struct AclEntry));		oldacl->pos=pos;	    }	    else {		pos->next=malloc(sizeof(struct AclEntry));		pos=pos->next;	    }	    pos->RightsMask=tmprights;	    strncpy(pos->name, tmpname, 100);	    pos->next=NULL;	}    if(oldacl->NumNegativeEntries)	for(i=0; i<oldacl->NumNegativeEntries; i++) {      	    sscanf(curptr, "%100s %d", tmpname, &tmprights);	    skipline(&curptr);	    if(!i) {		neg=malloc(sizeof(struct AclEntry));		oldacl->neg=neg;	    }	    else {		neg->next=malloc(sizeof(struct AclEntry));		neg=neg->next;	    }	    neg->RightsMask=tmprights;	    strncpy(neg->name, tmpname, 100);	    neg->next=NULL;	}    free(a_params.out);    return oldacl;}