+++ /dev/null
-*.diff
-*.patch
-*.d
-*.lo
-*.mo
-*.ro
-*.socket
-.AppleDouble
-.libs
-Makefile
-aclocal.m4
-aidepost
-autom4te.cache
-autom4te-2.53.cache
-base64
-chkpwd
-citadel
-citadel.config
-citadel.control
-citadel.log
-citlogin
-citmail
-citserver
-citserver.log
-config.cache
-config.h.in
-config.log
-config.status
-configure
-data
-icq
-import
-libcitserver.la
-libtool
-mailinglist
-migratenet
-msgform
-netconfigs
-netmailer
-netpoll
-netproc
-netsetup
-parsedate.c
-proxy
-qpdecode
-rcit
-readlog
-sendcommand
-setup
-so_locations
-stats
-stress
-sysdep.h
-sysdep.h.in
-sysoputil
-useradmin
-userlist
-weekly
-whobbs
-ltmain.sh
-configure.lineno
-config.sub
-config.guess
-openldap-data
-keys
-bio
-bitbucket
-citadel-easyinstall.sum
-files
-gmon.out
-images
-info
-network
-network/spoolin
-network/spoolout
-network/systems
-userpics
-citadel.pid
if (CtdlAccessCheck(ac_logged_in)) return;
extract_token(search_string, argbuf, 0, '|', sizeof search_string);
- if (strlen(search_string) == 0) {
+ if (IsEmptyStr(search_string)) {
cprintf("%d You supplied an empty partial.\n",
ERROR + ILLEGAL_VALUE);
return;
0
);
- if (strlen(imm.uid) > 0) {
+ if (!IsEmptyStr(imm.uid)) {
if (msg->cm_fields['E'] != NULL) {
free(msg->cm_fields['E']);
}
msg->cm_fields['E'] = strdup(imm.uid);
lprintf(CTDL_DEBUG, "Saving calendar UID <%s>\n", msg->cm_fields['E']);
}
- if (strlen(imm.subject) > 0) {
+ if (!IsEmptyStr(imm.subject)) {
if (msg->cm_fields['U'] != NULL) {
free(msg->cm_fields['U']);
}
GenerateRoomDisplay(roomname, ccptr, CC);
if ((CC->user.axlevel < 6)
- && (strlen(ccptr->fake_roomname)>0)) {
+ && (!IsEmptyStr(ccptr->fake_roomname))) {
strcpy(roomname, ccptr->fake_roomname);
}
GenerateRoomDisplay(roomname, ccptr, CC);
if ((CC->user.axlevel < 6)
- && (strlen(ccptr->fake_roomname)>0)) {
+ && (!IsEmptyStr(ccptr->fake_roomname))) {
strcpy(roomname, ccptr->fake_roomname);
}
}
/* if we have a complete line, do send processing */
- if (strlen(cmdbuf) > 0)
+ if (!IsEmptyStr(cmdbuf))
if (cmdbuf[strlen(cmdbuf) - 1] == 10) {
cmdbuf[strlen(cmdbuf) - 1] = 0;
time(&CC->lastcmd);
msgnum = CtdlSubmitMsg(logmsg, NULL, PAGELOGROOM);
/* Now save a copy in the global log room, if configured */
- if (strlen(config.c_logpages) > 0) {
+ if (!IsEmptyStr(config.c_logpages)) {
create_room(config.c_logpages, 3, "", 0, 1, 1, VIEW_BBS);
CtdlSaveMsgPointerInRoom(config.c_logpages, msgnum, 0, NULL);
}
strcmp(x_msg, "000")) {
x_big_msgbuf = realloc(x_big_msgbuf,
strlen(x_big_msgbuf) + strlen(x_msg) + 4);
- if (strlen(x_big_msgbuf) > 0)
+ if (!IsEmptyStr(x_big_msgbuf))
if (x_big_msgbuf[strlen(x_big_msgbuf)] != '\n')
strcat(x_big_msgbuf, "\n");
strcat(x_big_msgbuf, x_msg);
message_sent = PerformXmsgHooks(lun, x_user, x_msg);
if (message_sent > 0) {
- if (strlen(x_msg) > 0)
+ if (!IsEmptyStr(x_msg))
cprintf("%d Message sent", CIT_OK);
else
cprintf("%d Ok to send message", CIT_OK);
goto nuke;
}
/* Are we allowed to push? */
- if ( strlen(config.c_funambol_host) == 0) {
+ if (IsEmptyStr(config.c_funambol_host)) {
goto nuke;
} else {
lprintf(CTDL_INFO, "Push enabled\n");
cdb_free(cdbus);
CtdlRoomAccess(&CC->room, &temp, &ra, NULL);
- if (strlen(temp.fullname) > 0) {
+ if (!IsEmptyStr(temp.fullname)) {
imap_acl_flags(rights, ra);
- if (strlen(rights) > 0) {
+ if (!IsEmptyStr(rights)) {
cprintf(" ");
imap_strout(temp.fullname);
cprintf(" %s", rights);
ptr = memreadline(ptr, buf, sizeof buf);
if (*ptr != 0) {
striplt(buf);
- if (strlen(buf) == 0) {
+ if (IsEmptyStr(buf)) {
headers_size = ptr - IMAP->cached_rfc822_data;
}
}
if (!strcasecmp(desired_section, mbuf2)) {
cprintf("Content-type: %s", cbtype);
- if (strlen(cbcharset) > 0)
+ if (!IsEmptyStr(cbcharset))
cprintf("; charset=\"%s\"", cbcharset);
- if (strlen(name) > 0)
+ if (!IsEmptyStr(name))
cprintf("; name=\"%s\"", name);
cprintf("\r\n");
- if (strlen(encoding) > 0)
+ if (!IsEmptyStr(encoding))
cprintf("Content-Transfer-Encoding: %s\r\n", encoding);
- if (strlen(encoding) > 0) {
+ if (!IsEmptyStr(encoding)) {
cprintf("Content-Disposition: %s", disp);
- if (strlen(filename) > 0) {
+ if (!IsEmptyStr(filename)) {
cprintf("; filename=\"%s\"", filename);
}
cprintf("\r\n");
return;
}
- if (strlen(addr) == 0) {
+ if (IsEmptyStr(addr)) {
cprintf("NIL ");
return;
}
strcat(boiled_headers, "\r\n");
}
- if (strlen(buf) == 0) done_headers = 1;
+ if (IsEmptyStr(buf)) done_headers = 1;
if (buf[0]=='\r') done_headers = 1;
if (buf[0]=='\n') done_headers = 1;
}
if (strchr(section, '[') != NULL) {
stripallbut(section, '[', ']');
}
- lprintf(CTDL_DEBUG, "Section is: %s%s\n", section, ((strlen(section)==0) ? "(empty)" : "") );
+ lprintf(CTDL_DEBUG, "Section is: %s%s\n", section, ((IsEmptyStr(section)0) ? "(empty)" : "") );
if (!strncasecmp(section, "HEADER", 6)) {
need_body = 0;
}
is_partial = 1;
}
if (is_partial == 0) strcpy(partial, "");
- /* if (strlen(partial) > 0) lprintf(CTDL_DEBUG, "Partial is %s\n", partial); */
+ /* if (!IsEmptyStr(partial)) lprintf(CTDL_DEBUG, "Partial is %s\n", partial); */
if (IMAP->cached_body == NULL) {
CC->redirect_buffer = malloc(SIZ);
char cbmaintype[128];
char cbsubtype[128];
- if (cbtype != NULL) if (strlen(cbtype)>0) have_cbtype = 1;
+ if (cbtype != NULL) if (!IsEmptyStr(cbtype)) have_cbtype = 1;
if (have_cbtype) {
extract_token(cbmaintype, cbtype, 0, '/', sizeof cbmaintype);
extract_token(cbsubtype, cbtype, 1, '/', sizeof cbsubtype);
if (cbcharset == NULL) {
cprintf("(\"CHARSET\" \"US-ASCII\"");
}
- else if (strlen(cbcharset) == 0) {
+ else if (IsEmptyStr(cbcharset)) {
cprintf("(\"CHARSET\" \"US-ASCII\"");
}
else {
imap_strout(cbcharset);
}
- if (name != NULL) if (strlen(name)>0) {
+ if (name != NULL) if (!IsEmptyStr(name)) {
cprintf(" \"NAME\" ");
imap_strout(name);
}
cprintf("NIL "); /* Body ID */
cprintf("NIL "); /* Body description */
- if (encoding != NULL) if (strlen(encoding) > 0) have_encoding = 1;
+ if (encoding != NULL) if (!IsEmptyStr(encoding)) have_encoding = 1;
if (have_encoding) {
imap_strout(encoding);
}
if (disp == NULL) {
cprintf("NIL");
}
- else if (strlen(disp) == 0) {
+ else if (IsEmptyStr(disp)) {
cprintf("NIL");
}
else {
cprintf("(");
imap_strout(disp);
- if (filename != NULL) if (strlen(filename)>0) {
+ if (filename != NULL) if (!IsEmptyStr(filename)) {
cprintf(" (\"FILENAME\" ");
imap_strout(filename);
cprintf(")");
ptr = rfc822;
while (ptr = memreadline(ptr, buf, sizeof buf), *ptr != 0) {
++lines;
- if ((strlen(buf) == 0) && (rfc822_body == NULL)) {
+ if ((IsEmptyStr(buf)) && (rfc822_body == NULL)) {
rfc822_body = ptr;
}
}
* We'll fix this later when we have time.
*/
if (return_children) {
- if (strlen(return_options) > 0) {
+ if (!IsEmptyStr(return_options)) {
strcat(return_options, " ");
}
strcat(return_options, "\\HasChildren");
* hierarchy delimiter and the root name of the name given in the
* reference parameter.
*/
- if ( (strlen(patterns[0]) == 0) && (extended_list_in_use == 0) ) {
+ if ( (IsEmptyStr(patterns[0])) && (extended_list_in_use == 0) ) {
cprintf("* %s (\\Noselect) \"/\" \"\"\r\n", verb);
}
int i;
if (new_message_flags == NULL) return;
- if (strlen(new_message_flags) == 0) return;
+ if (IsEmptyStr(new_message_flags)) return;
safestrncpy(flags, new_message_flags, sizeof flags);
if (buf == NULL)
return (0); /* stupidity checks */
- if (strlen(buf) == 0)
+ if (IsEmptyStr(buf))
return (0);
if (!strcasecmp(buf, "ALL"))
IMAP->authstate = imap_as_normal;
- if (strlen(ident) > 0) {
+ if (!IsEmptyStr(ident)) {
result = CtdlLoginExistingUser(user, ident);
}
else {
do {
extract_token(buf, conf, 0, '\n', sizeof buf);
strcpy(conf, &conf[strlen(buf)+1]);
- } while ( (strlen(conf)>0) && (strlen(buf)>0) );
+ } while ( (!IsEmptyStr(conf)) && (!IsEmptyStr(buf)) );
if (inetcfg != NULL) free(inetcfg);
inetcfg = conf;
*/
if ( (!strcasecmp(v->prop[i].name, "fburl"))
||(!strncasecmp(v->prop[i].name, "fburl;", 6)) ) {
- if ( (strlen(calFBURL) == 0)
+ if ( (IsEmptyStr(calFBURL))
|| (!strncasecmp(v->prop[i].name, "fburl;pref", 10)) ) {
safestrncpy(calFBURL, v->prop[i].value, sizeof calFBURL);
}
attrs[num_attrs-1]->mod_values[1] = NULL;
/* "givenname" (first name) based on info in vCard */
- if (strlen(givenname) == 0) strcpy(givenname, "_");
- if (strlen(sn) == 0) strcpy(sn, "_");
+ if (IsEmptyStr(givenname)) strcpy(givenname, "_");
+ if (IsEmptyStr(sn)) strcpy(sn, "_");
attrs = realloc(attrs, (sizeof(LDAPMod *) * ++num_attrs) );
attrs[num_attrs-1] = malloc(sizeof(LDAPMod));
memset(attrs[num_attrs-1], 0, sizeof(LDAPMod));
}
/* Add a "calFBURL" attribute if a calendar free/busy URL exists */
- if (strlen(calFBURL) > 0) {
+ if (!IsEmptyStr(calFBURL)) {
attrs = realloc(attrs, (sizeof(LDAPMod *) * ++num_attrs) );
attrs[num_attrs-1] = malloc(sizeof(LDAPMod));
memset(attrs[num_attrs-1], 0, sizeof(LDAPMod));
#ifdef HAVE_LDAP
CtdlRegisterCleanupHook(serv_ldap_cleanup);
- if (strlen(config.c_ldap_host) > 0) {
+ if (!IsEmptyStr(config.c_ldap_host)) {
CtdlConnectToLdap();
}
* make another pass at the file, stripping out lines referring to
* that address.
*/
- if (strlen(address_to_unsubscribe) > 0) {
+ if (!IsEmptyStr(address_to_unsubscribe)) {
holdbuf = malloc(SIZ);
begin_critical_section(S_NETCONFIGS);
ncfp = fopen(filename, "r+");
*/
if (success) {
cprintf("%d %d operation(s) confirmed.\n", CIT_OK, success);
- lprintf(CTDL_NOTICE, "Mailing list: %s %ssubscribed to %s with token %s\n", email, (strlen(address_to_unsubscribe) > 0) ? "un" : "", room, token);
+ lprintf(CTDL_NOTICE,
+ "Mailing list: %s %ssubscribed to %s with token %s\n",
+ email,
+ (!IsEmptyStr(address_to_unsubscribe)) ? "un" : "",
+ room,
+ token);
}
else {
cprintf("%d Invalid token.\n", ERROR + ILLEGAL_VALUE);
char *cursor = token;
char *number;
- while ((*cursor != '\0') &&
+ while (!IsEmptyStr(cursor) &&
(*cursor != '{'))
{
cursor++;
}
- if (*cursor == '\0')
+ if (IsEmptyStr(cursor))
return -1;
number = cursor + 1;
while ((*cursor != '\0') &&
if (cursor[-1] == '+')
cursor--;
- if (*cursor == '\0')
+ if (IsEmptyStr(cursor))
return -1;
return atol(number);
/* Cowardly refuse to add an any/any/any entry that would
* end up filtering every single message.
*/
- if (strlen(nptr->fl_user) + strlen(nptr->fl_room)
- + strlen(nptr->fl_node) == 0) {
+ if (IsEmptyStr(nptr->fl_user) &&
+ IsEmptyStr(nptr->fl_room) &&
+ IsEmptyStr(nptr->fl_node)) {
free(nptr);
}
else {
if (msg->cm_fields['I'] == NULL) {
return(0);
}
- if (strlen(msg->cm_fields['I']) == 0) {
+ if (IsEmptyStr(msg->cm_fields['I'])) {
return(0);
}
for (nmptr = the_netmap; nmptr != NULL; nmptr = nmptr->next) {
serialized_map = realloc(serialized_map,
(strlen(serialized_map)+SIZ) );
- if (strlen(nmptr->nodename) > 0) {
+ if (!IsEmptyStr(nmptr->nodename)) {
snprintf(&serialized_map[strlen(serialized_map)],
SIZ,
"%s|%ld|%s\n",
if (msg->cm_fields['C'] != NULL) {
free(msg->cm_fields['C']);
}
- if (strlen(mptr->remote_roomname) > 0) {
+ if (!IsEmptyStr(mptr->remote_roomname)) {
msg->cm_fields['C'] = strdup(mptr->remote_roomname);
}
else {
extract_token(roomname, buf, 2, '|', sizeof roomname);
strcpy(nexthop, "xxx");
if (is_valid_node(nexthop, NULL, nodename) == 0) {
- if (strlen(nexthop) == 0) {
+ if (IsEmptyStr(nexthop)) {
mptr = (struct maplist *)
malloc(sizeof(struct maplist));
mptr->next = sc.ignet_push_shares;
}
fprintf(fp, "ignet_push_share|%s",
sc.ignet_push_shares->remote_nodename);
- if (strlen(sc.ignet_push_shares->remote_roomname) > 0) {
+ if (!IsEmptyStr(sc.ignet_push_shares->remote_roomname)) {
fprintf(fp, "|%s", sc.ignet_push_shares->remote_roomname);
}
fprintf(fp, "\n");
else {
strcpy(force_room, "");
}
- if ( (valid == NULL) && (strlen(force_room) == 0) ) {
+ if ( (valid == NULL) && IsEmptyStr(force_room) ) {
strcpy(force_room, config.c_aideroom);
}
CtdlSubmitMsg(msg, valid, force_room);
serialize_message(&sermsg, msg);
/* now send it */
- if (strlen(nexthop) == 0) {
+ if (IsEmptyStr(nexthop)) {
strcpy(nexthop, msg->cm_fields['D']);
}
snprintf(filename,
strcpy(nexthop, "");
i = is_valid_node(nexthop, NULL, d->d_name);
- if ( (i != 0) || (strlen(nexthop) > 0) ) {
+ if ( (i != 0) || !IsEmptyStr(nexthop) ) {
unlink(filename);
}
}
extract_token(secret, linebuf, 1, '|', sizeof secret);
extract_token(host, linebuf, 2, '|', sizeof host);
extract_token(port, linebuf, 3, '|', sizeof port);
- if ( (strlen(node) > 0) && (strlen(secret) > 0)
- && (strlen(host) > 0) && strlen(port) > 0) {
+ if ( !IsEmptyStr(node) && !IsEmptyStr(secret)
+ && !IsEmptyStr(host) && !IsEmptyStr(port)) {
poll = full_poll;
if (poll == 0) {
snprintf(spoolfile,
}
lprintf(9, "UUID of note is: %s\n", uuid);
- if (strlen(uuid) > 0) {
+ if (!IsEmptyStr(uuid)) {
if (msg->cm_fields['E'] != NULL) {
free(msg->cm_fields['E']);
extract_token(newroomname, argbuf, 0, '|', sizeof newroomname);
newroomname[ROOMNAMELEN-1] = 0;
- if (strlen(newroomname) > 0) {
+ if (!IsEmptyStr(newroomname)) {
safestrncpy(CC->fake_roomname, newroomname,
sizeof(CC->fake_roomname) );
}
char newhostname[64];
extract_token(newhostname, argbuf, 0, '|', sizeof newhostname);
- if (strlen(newhostname) > 0) {
+ if (!IsEmptyStr(newhostname)) {
safestrncpy(CC->fake_hostname, newhostname,
sizeof(CC->fake_hostname) );
}
if (CtdlAccessCheck(ac_aide)) return;
- if (strlen(newusername) > 0) {
+ if (!IsEmptyStr(newusername)) {
CC->cs_flags &= ~CS_STEALTH;
memset(CC->fake_username, 0, 32);
if (strncasecmp(newusername, CC->curr_user,
lprintf(CTDL_DEBUG, "Action is REJECT\n");
/* If we don't know who sent the message, do a DISCARD instead. */
- if (strlen(cs->sender) == 0) {
+ if (IsEmptyStr(cs->sender)) {
lprintf(CTDL_INFO, "Unknown sender. Doing DISCARD instead of REJECT.\n");
return ctdl_discard(s, my);
}
/* First see if the supplied value is ok */
- if (strlen(script_name) == 0) {
+ if (IsEmptyStr(script_name)) {
ok = 1;
}
else {
if (!strcasecmp(subcmd, "putscript")) {
extract_token(script_name, argbuf, 1, '|', sizeof script_name);
- if (strlen(script_name) > 0) {
+ if (!IsEmptyStr(script_name)) {
cprintf("%d Transmit script now\n", SEND_LISTING);
script_content = CtdlReadMessageBody("000", config.c_maxmsglen, NULL, 0);
msiv_putscript(&u, script_name, script_content);
SMTP->command_state = smtp_command;
- if (strlen(ident) > 0) {
+ if (!IsEmptyStr(ident)) {
result = CtdlLoginExistingUser(user, ident);
}
else {
char node[SIZ];
char name[SIZ];
- if (strlen(SMTP->from) != 0) {
+ if (!IsEmptyStr(SMTP->from)) {
cprintf("503 5.1.0 Only one sender permitted\r\n");
return;
}
* address so we don't have to contend with the empty string causing
* other code to fail when it's expecting something there.
*/
- if (strlen(SMTP->from) == 0) {
+ if (IsEmptyStr(SMTP->from)) {
strcpy(SMTP->from, "someone@somewhere.org");
}
char message_to_spammer[SIZ];
struct recptypes *valid = NULL;
- if (strlen(SMTP->from) == 0) {
+ if (IsEmptyStr(SMTP->from)) {
cprintf("503 5.5.1 Need MAIL before RCPT\r\n");
return;
}
}
cprintf("250 2.1.5 RCPT ok <%s>\r\n", recp);
- if (strlen(SMTP->recipients) > 0) {
+ if (!IsEmptyStr(SMTP->recipients)) {
strcat(SMTP->recipients, ",");
}
strcat(SMTP->recipients, recp);
int i;
char result[SIZ];
- if (strlen(SMTP->from) == 0) {
+ if (IsEmptyStr(SMTP->from)) {
cprintf("503 5.5.1 Need MAIL command first.\r\n");
return;
}
scan_done = 1;
}
} while (scan_done == 0);
- if (strlen(mailfrom)==0) strcpy(mailfrom, "someone@somewhere.org");
+ if (IsEmptyStr(mailfrom)) strcpy(mailfrom, "someone@somewhere.org");
stripallbut(mailfrom, '<', '>');
/* Figure out what mail exchanger host we have to connect to */
}
/* Do an AUTH command if necessary */
- if (strlen(mx_user) > 0) {
+ if (!IsEmptyStr(mx_user)) {
char encoded[1024];
sprintf(buf, "%s%c%s%c%s", mx_user, '\0', mx_user, '\0', mx_pass);
CtdlEncodeBase64(encoded, buf, strlen(mx_user) + strlen(mx_user) + strlen(mx_pass) + 2);
/* First try the user who sent the message */
lprintf(CTDL_DEBUG, "bounce to user? <%s>\n", bounceto);
- if (strlen(bounceto) == 0) {
+ if (IsEmptyStr(bounceto)) {
lprintf(CTDL_ERR, "No bounce address specified\n");
bounce_msgid = (-1L);
}
cprintf("%ld\n", vbuf.v_roomgen);
cprintf("%ld\n", vbuf.v_usernum);
- if (strlen(vbuf.v_seen) > 0) {
+ if (!IsEmptyStr(vbuf.v_seen)) {
cprintf("%s\n", vbuf.v_seen);
}
else {
if (s != NULL) {
addr = strdup(s);
striplt(addr);
- if (strlen(addr) > 0) {
+ if (!IsEmptyStr(addr)) {
if (callback != NULL) {
callback(addr, citadel_address);
}
while (s = vcard_get_prop(v, "email;internet", 0, instance++, 0), s != NULL) {
addr = strdup(s);
striplt(addr);
- if (strlen(addr) > 0) {
+ if (!IsEmptyStr(addr)) {
if ( (IsDirectory(addr, 1)) ||
(!local_addrs_only) ) {
++saved_instance;
cprintf("%d valid screen names:\n", LISTING_FOLLOWS);
cprintf("%s\n", CC->user.fullname);
- if ( (strlen(CC->cs_inet_fn) > 0) && (strcasecmp(CC->user.fullname, CC->cs_inet_fn)) ) {
+ if ( (!IsEmptyStr(CC->cs_inet_fn)) && (strcasecmp(CC->user.fullname, CC->cs_inet_fn)) ) {
cprintf("%s\n", CC->cs_inet_fn);
}
cprintf("000\n");
if (CtdlAccessCheck(ac_logged_in)) return;
cprintf("%d valid email addresses:\n", LISTING_FOLLOWS);
- if (strlen(CC->cs_inet_email) > 0) {
+ if (!IsEmptyStr(CC->cs_inet_email)) {
cprintf("%s\n", CC->cs_inet_email);
}
- if (strlen(CC->cs_inet_other_emails) > 0) {
+ if (!IsEmptyStr(CC->cs_inet_other_emails)) {
num_secondary_emails = num_tokens(CC->cs_inet_other_emails, '|');
for (i=0; i<num_secondary_emails; ++i) {
extract_token(buf, CC->cs_inet_other_emails,i,'|',sizeof CC->cs_inet_other_emails);
CtdlForEachMessage(MSGS_ALL, 0, NULL, "^[Tt][Ee][Xx][Tt]/.*[Vv][Cc][Aa][Rr][Dd]$", NULL,
strip_addresses_already_have, aptr->collected_addresses);
- if (strlen(aptr->collected_addresses) > 0)
+ if (!IsEmptyStr(aptr->collected_addresses))
for (i=0; i<num_tokens(aptr->collected_addresses, ','); ++i) {
/* Make a vCard out of each address */