]> code.citadel.org Git - citadel.git/blobdiff - citadel/user_ops.c
* check whether our chkpwd binary exists or not
[citadel.git] / citadel / user_ops.c
index 4ac224e521bdaf5c29cd8efbf8f1c4301c1dcaa9..d3e507365bb23ea21bad9dc6d5157d983c6c9230 100644 (file)
@@ -611,10 +611,16 @@ static int validpw(uid_t uid, const char *pass)
  */
 void start_chkpwd_daemon(void) {
        pid_t chkpwd_pid;
+       struct stat filestats;
        int i;
 
        lprintf(CTDL_DEBUG, "Starting chkpwd daemon for host authentication mode\n");
 
+       if ((stat(file_chkpwd, &filestats)==-1) ||
+           (filestats.st_size==0)){
+               printf("didn't find chkpwd daemon in %s: %s\n", file_chkpwd, strerror(errno));
+               abort();
+       }
        if (pipe(chkpwd_write_pipe) != 0) {
                lprintf(CTDL_EMERG, "Unable to create pipe for chkpwd daemon: %s\n", strerror(errno));
                abort();