X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Futils%2Fchkpw.c;h=fb37fc86206fd72654bcddd0eb1313631286444c;hp=9adabaca500586db5243e8883d2a7ae5e0afd4af;hb=feb542114454b1f979c025ede9474f53b6715bce;hpb=8ab55c43ca0ef3ab0c63da570bcc0f3613cee0f8 diff --git a/citadel/utils/chkpw.c b/citadel/utils/chkpw.c index 9adabaca5..fb37fc862 100644 --- a/citadel/utils/chkpw.c +++ b/citadel/utils/chkpw.c @@ -51,9 +51,21 @@ static int validpw(uid_t uid, const char *pass) int rv; rv = write(chkpwd_write_pipe[1], &uid, sizeof(uid_t)); + if (rv == -1) { + printf( "Communicatino with chkpwd broken: %s\n", strerror(errno)); + return 0; + } + rv = write(chkpwd_write_pipe[1], pass, 256); + if (rv == -1) { + printf( "Communicatino with chkpwd broken: %s\n", strerror(errno)); + return 0; + } rv = read(chkpwd_read_pipe[0], buf, 4); - + if (rv == -1) { + printf( "Communicatino with chkpwd broken: %s\n", strerror(errno)); + return 0; + } if (!strncmp(buf, "PASS", 4)) { printf("pass\n"); return(1);