/**********************************************************************
 * File Exchange client library
 *
 * $Author: probe $
 * $Source: /afs/sipb.mit.edu/project/sipb-athena/repository/src/neos/lib/fx_acl_add.c,v $
 * $Header: /afs/sipb.mit.edu/project/sipb-athena/repository/src/neos/lib/fx_acl_add.c,v 1.1 1993/10/12 03:03:41 probe Exp $
 *
 * Copyright 1989, 1990 by the Massachusetts Institute of Technology.
 *
 * For copying and distribution information, please see the file
 * <mit-copyright.h>.
 **********************************************************************/

#include <mit-copyright.h>

#ifndef lint
static char rcsid_fx_acl_add_c[] = "$Header: /afs/sipb.mit.edu/project/sipb-athena/repository/src/neos/lib/fx_acl_add.c,v 1.1 1993/10/12 03:03:41 probe Exp $";
#endif /* lint */

#include "fxcl.h"

/*
 * fx_acl_add -- add a person to an access control list
 */

long
fx_acl_add(fxp, aclname, person)
     FX *fxp;
     char *aclname, *person;
{
  long *ret, code = 0L;
  acl_maint maint;
  char principal[FX_UNAMSZ];

  maint.aclname = aclname;
  maint.aclparam = person;

#ifdef KERBEROS
  /* lengthen usernames to kerberos principals */
  if (strcmp(person, OWNER_WILDCARD))
    maint.aclparam = _fx_lengthen(fxp, person, principal);
#endif

  ret = add_acl_1(&maint, fxp->cl);
  if (!ret) return(_fx_rpc_errno(fxp->cl));
  code = *ret;
  xdr_free(xdr_long, (char *) ret);
  return(code);
}
