1 /* This file is part of the Project Athena Zephyr Notification System.
2 * It contains source for the ZGetSender.c function.
4 * Created by: Robert French
8 * Copyright (c) 1987, 1991 by the Massachusetts Institute of Technology.
9 * For copying and distribution information, see the file
16 static const char rcsid_ZGetSender_c[] =
26 char pname[ANAME_SZ], pinst[INST_SZ], prealm[REALM_SZ];
27 static char sender[ANAME_SZ+INST_SZ+REALM_SZ+3] = "";
29 static char sender[128] = "";
32 /* Return it if already cached */
37 if (krb_get_tf_fullname((char *)TKT_FILE, pname, pinst, prealm) == KSUCCESS)
39 (void) sprintf(sender, "%s%s%s@%s", pname, (pinst[0]?".":""),
45 /* XXX a uid_t is a u_short (now), but getpwuid
46 * wants an int. AARGH! */
47 pw = getpwuid((int) getuid());
50 (void) sprintf(sender, "%s@%s", pw->pw_name, __Zephyr_realm);