User level permissions

Dr A V Le Blanc LeBlanc at mcc.ac.uk
Tue Jun 29 14:35:15 CEST 1999


On Mon, Jun 28, 1999 at 01:14:14PM -0400, Chris Wing wrote:
> I agree that emulating every minor detail is a waste of time. However,
> regarding the output of 'tokens', printing out the correct AFS ID is a
> useful feature in my opinion, and I think it should be implemented in
> Arla/KTH-KRB.

What I do in some of my programs (linked with Transarc libraries) is
this:

    rc(pr_Initialize(0, AFSCONF_CLIENTNAME, client.cell),
      "Unable to contact ptserver");
    rc(pr_SNameToId(who, &id), "Can't get AFS id");
    pr_End();
    rc(id == ANONYMOUSID, "Got bad AFS id");
    sprintf(client.name, "AFS ID %ld", id);

PR_NameToId() is already a function in the arla libptserver.  As I
understand it, arla's equivalent of pr_Initialize is something like

    connptdb = arlalib_getconnbyname(cell, host,
                                     afsprport,
                                     PR_SERVICE_ID,
                                     arlalib_getauthflag (noauth, 0, 0, 0));
    if (connptdb == NULL)
        errx(1, "Could not connect to ptserver");

and instead of pr_End, you just need

    arlalib_destroyconn(connptdb);

So that ought to give you 90% of the code...

     -- Owen
     LeBlanc at mcc.ac.uk





More information about the Arla-drinkers mailing list