+/* $OpenLDAP$ */
/*
* main.c: for rcpt500 (X.500 email query responder)
*
}
if ( errflg || optind < argc ) {
fprintf( stderr, usage, prog );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
#ifdef SIGPIPE
*/
#ifdef LOG_DAEMON
openlog( prog, OPENLOG_OPTIONS, LOG_DAEMON );
-#else
+#elif LOG_DEBUG
openlog( prog, OPENLOG_OPTIONS );
#endif
}
if ( dosyslog ) {
syslog( LOG_INFO, "processing command \"%s %s\" from %s",
( msg.msg_command < 0 ) ? "Unknown" :
- cmds[ msg.msg_command ].cmd_text,
+ rcpt_cmds[ msg.msg_command ].cmd_text,
( msg.msg_arg == NULL ) ? "" : msg.msg_arg, msg.msg_replyto );
}
/*
sprintf( reply, "Your request was interpreted as: %s %s\n\n",
- cmds[ msg.msg_command ].cmd_text, msg.msg_arg );
+ rcpt_cmds[ msg.msg_command ].cmd_text, msg.msg_arg );
*/
- (*cmds[ msg.msg_command ].cmd_handler)( &msg, reply );
+ (*rcpt_cmds[ msg.msg_command ].cmd_handler)( &msg, reply );
if ( send_reply( &msg, reply ) < 0 ) {
if ( dosyslog ) {
if ( dosyslog ) {
syslog( LOG_ERR, "strdup: %m" );
}
- exit( 1 );
+ exit( EXIT_FAILURE );
}
while ( 1 ) {
if ( dosyslog ) {
syslog( LOG_ERR, "realloc: %m" );
}
- exit( 1 );
+ exit( EXIT_FAILURE );
}
strcat( hdr, "\n" );
strcat( hdr, *linep );
}
*s = '\0';
- for ( i = 0; cmds[ i ].cmd_text != NULL; ++i ) {
- if (( s = strstr( argbuf, cmds[ i ].cmd_text )) != NULL
- && isspace( (unsigned char) s[ strlen( cmds[ i ].cmd_text ) ] )) {
- strcpy( argbuf, text + (s - argbuf) + strlen( cmds[ i ].cmd_text ));
+ for ( i = 0; rcpt_cmds[ i ].cmd_text != NULL; ++i ) {
+ if (( s = strstr( argbuf, rcpt_cmds[ i ].cmd_text )) != NULL
+ && isspace( (unsigned char) s[ strlen( rcpt_cmds[ i ].cmd_text ) ] )) {
+ strcpy( argbuf, text + (s - argbuf) + strlen( rcpt_cmds[ i ].cmd_text ));
*argp = argbuf;
while ( isspace( (unsigned char) **argp )) {
++(*argp);