- Timestamp:
- Mar 24, 2011, 4:56:24 PM (13 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- 3a3863e
- Parents:
- 5d56a27
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zephyr.c
r5d56a27 r4e29ecb 771 771 char *buff; 772 772 owl_zwrite zw; 773 char *realm;774 773 775 774 tmp = short_zuser(retnotice->z_recipient); … … 804 803 zw.class = g_strdup(retnotice->z_class); 805 804 zw.inst = g_strdup(retnotice->z_class_inst); 806 realm = strchr(retnotice->z_recipient, '@'); 807 if(realm) { 808 zw.realm = g_strdup(realm + 1); 809 } else { 810 zw.realm = g_strdup(owl_zephyr_get_realm()); 811 } 805 zw.realm = g_strdup(zuser_realm(retnotice->z_recipient)); 812 806 zw.opcode = g_strdup(retnotice->z_opcode); 813 807 zw.zsig = g_strdup(""); … … 1187 1181 } 1188 1182 return g_strdup_printf("%s@%s", in, owl_zephyr_get_realm()); 1183 } 1184 1185 /* Return the realm of the zephyr user name. Caller does /not/ free the return. 1186 * The string is valid at least as long as the input is. 1187 */ 1188 const char *zuser_realm(const char *in) 1189 { 1190 char *ptr = strrchr(in, '@'); 1191 /* If the name has an @ and does not end with @, use that. Otherwise, take 1192 * the default realm. */ 1193 return (ptr && ptr[1]) ? (ptr+1) : owl_zephyr_get_realm(); 1189 1194 } 1190 1195
Note: See TracChangeset
for help on using the changeset viewer.