has crashed twice in this function, for no apparent reason.
* internet_addressing.c: don't attempt to look up the specified Internet
address in a Citadel directory, if the supplied address has no hostname
portion. (Fixes a crash in the calendar service when alias() attempts to
look up potentially nonexistent attendees during event validation)
$Log$
+ Revision 606.6 2003/06/02 03:01:22 ajc
+ * citserver.c: added another trace message to is_public_client(). Uncensored
+ has crashed twice in this function, for no apparent reason.
+ * internet_addressing.c: don't attempt to look up the specified Internet
+ address in a Citadel directory, if the supplied address has no hostname
+ portion. (Fixes a crash in the calendar service when alias() attempts to
+ look up potentially nonexistent attendees during event validation)
+
Revision 606.5 2003/05/28 03:08:38 ajc
* msgbase.c: validate_recipients() now rejects Internet addresses in
domains belonging to the local system or an attached Citadel network,
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
}
/*
- * check a hostname against the public_clients file
+ * Check a hostname against the public_clients file. This determines
+ * whether the client is allowed to change the hostname for this session
+ * (for example, to show the location of the user rather than the location
+ * of the client).
*/
int is_public_client(char *where)
{
char buf[SIZ];
FILE *fp;
- lprintf(9, "Checking whether %s is a public client\n", where);
-
+ lprintf(9, "Checking whether %s is a local client\n", where);
if (hostnames_match(where, "localhost")) return(1);
if (hostnames_match(where, config.c_fqdn)) return(1);
- fp = fopen("public_clients","r");
+ lprintf(9, "Checking whether %s is a public client\n", where);
+ fp = fopen("public_clients", "r");
if (fp == NULL) return(0);
while (fgets(buf, sizeof buf, fp)!=NULL) {
while (isspace((buf[strlen(buf)-1])))
buf[strlen(buf)-1] = 0;
- if (hostnames_match(where,buf)) {
+ if (hostnames_match(where, buf)) {
fclose(fp);
return(1);
}
char buf[SIZ];
char host[SIZ], type[SIZ];
+ if (fqdn == NULL) return(hostalias_nomatch);
+ if (strlen(fqdn) == 0) return(hostalias_nomatch);
if (!strcasecmp(fqdn, config.c_fqdn)) return(hostalias_localhost);
if (!strcasecmp(fqdn, config.c_nodename)) return(hostalias_localhost);
if (inetcfg == NULL) return(hostalias_nomatch);
struct cdbdata *cdbrec;
char key[SIZ];
+ /* Dump it in there unchanged, just for kicks */
+ strcpy(target, internet_addr);
+
+ /* Only do lookups for addresses with hostnames in them */
+ if (num_tokens(internet_addr, '@') != 2) return(-1);
+
+ /* Only do lookups for domains in the directory */
if (IsDirectory(internet_addr) == 0) return(-1);
directory_key(key, internet_addr);