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
6 * Copyright (c) 1987, 1991 by the Massachusetts Institute of Technology.
7 * For copying and distribution information, see the file
20 #ifdef ZEPHYR_USES_KERBEROS
23 char prealm
[REALM_SZ
];
24 static char sender
[ANAME_SZ
+INST_SZ
+REALM_SZ
+3] = "";
27 static char sender
[128] = "";
31 unsigned long sender_size
= sizeof(sender
) - 1;
34 #ifdef ZEPHYR_USES_KERBEROS
35 if ((kerror
= krb_get_tf_fullname((char *)TKT_FILE
, pname
, pinst
, prealm
)) == KSUCCESS
)
37 sprintf(sender
, "%s%s%s@%s", pname
, (pinst
[0] ? "." : ""), pinst
, prealm
);
43 GetUserName(sender
, &sender_size
);
45 /* XXX a uid_t is a u_short (now), but getpwuid
46 * wants an int. AARGH! */
47 pw
= getpwuid((int) getuid());
50 sprintf(sender
, "%s@%s", pw
->pw_name
, __Zephyr_realm
);