]> code.citadel.org Git - citadel.git/blobdiff - citadel/utils/chkpw.c
Began setting up a second server socket that will be used exclusively for admin utilities
[citadel.git] / citadel / utils / chkpw.c
index 9adabaca500586db5243e8883d2a7ae5e0afd4af..766d50fa9731f15b7749234bc8bad13b41bb65c3 100644 (file)
@@ -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);
@@ -110,7 +122,7 @@ int main(int argc, char **argv) {
        struct passwd *p;
        int uid;
        char ctdldir[PATH_MAX]=CTDLDIR;
-       char *ptr;
+       char *ptr = NULL;
        
        calc_dirs_n_files(0,0,"", ctdldir, 0);