Mercurial > pidgin
annotate src/protocols/zephyr/ZGetSender.c @ 10038:eb8ccdd6f5f2
[gaim-migrate @ 10997]
" Fix Philip Mucci's bug (reported to gaim-devel on the
16th), where malformed (visibility) strings, caused
users to be unmessageable and hidden, by normalizing
them, and using sane defaults.
Fixes CraigD's bug IRC reported on IRC (non-kerberized
zephyr users always have the realm "local-realm"), by
adding a user-specified "Realm" option string.
Also added two new preferences (import from .anyone and
import from .zephyr.subs) to go with (export to .anyone
and "export to .zephyr.subs"). Since one can now use
multiple accounts, most people wouldn't want to use the
same buddy lists and chat room lists for both accounts.
Added a /topic command to make zephyr use the same
command name as the other protocols which have topics." --Arun A Tharuvai
committer: Tailor Script <tailor@pidgin.im>
| author | Luke Schierer <lschiere@pidgin.im> |
|---|---|
| date | Sat, 18 Sep 2004 22:25:12 +0000 |
| parents | 43d6c08d7e96 |
| children | 5727afad0fb8 |
| rev | line source |
|---|---|
| 2086 | 1 /* This file is part of the Project Athena Zephyr Notification System. |
| 2 * It contains source for the ZGetSender.c function. | |
| 3 * | |
| 4 * Created by: Robert French | |
| 5 * | |
| 6 * $Source$ | |
| 10038 | 7 * $Author: lschiere $ |
| 2086 | 8 * |
| 9 * Copyright (c) 1987, 1991 by the Massachusetts Institute of Technology. | |
| 10 * For copying and distribution information, see the file | |
| 11 * "mit-copyright.h". | |
| 12 */ | |
| 13 /* $Header$ */ | |
| 14 | |
|
8792
43d6c08d7e96
[gaim-migrate @ 9554]
Christian Hammond <chipx86@chipx86.com>
parents:
2086
diff
changeset
|
15 #include "internal.h" |
| 2086 | 16 |
| 17 #ifndef lint | |
| 18 static const char rcsid_ZGetSender_c[] = | |
| 10038 | 19 "$Id: ZGetSender.c 10997 2004-09-18 22:25:12Z lschiere $"; |
| 2086 | 20 #endif |
| 21 | |
| 22 #include <pwd.h> | |
| 23 | |
| 24 char *ZGetSender() | |
| 25 { | |
| 26 struct passwd *pw; | |
| 27 #ifdef ZEPHYR_USES_KERBEROS | |
| 28 char pname[ANAME_SZ], pinst[INST_SZ], prealm[REALM_SZ]; | |
| 29 static char sender[ANAME_SZ+INST_SZ+REALM_SZ+3] = ""; | |
| 30 #else | |
| 31 static char sender[128] = ""; | |
| 32 #endif | |
| 33 | |
| 34 /* Return it if already cached */ | |
| 10038 | 35 |
| 36 /* if (*sender) | |
| 2086 | 37 return (sender); |
| 10038 | 38 */ |
| 2086 | 39 |
| 40 #ifdef ZEPHYR_USES_KERBEROS | |
| 41 if (krb_get_tf_fullname((char *)TKT_FILE, pname, pinst, prealm) == KSUCCESS) | |
| 42 { | |
| 43 (void) sprintf(sender, "%s%s%s@%s", pname, (pinst[0]?".":""), | |
| 44 pinst, prealm); | |
| 45 return (sender); | |
| 46 } | |
| 47 #endif | |
| 48 | |
| 49 /* XXX a uid_t is a u_short (now), but getpwuid | |
| 50 * wants an int. AARGH! */ | |
| 51 pw = getpwuid((int) getuid()); | |
| 52 if (!pw) | |
| 53 return ("unknown"); | |
| 54 (void) sprintf(sender, "%s@%s", pw->pw_name, __Zephyr_realm); | |
| 55 return (sender); | |
| 56 } |
