Why doesn't the validate program receive all the input from the pipe?
if (r > 0) {
        // Parent process
        // Close read end of pipe
        if ((close(fd[0])) == -1) {
            perror("close");
        }

        // Write user_id and password to pipe
        int w_user = write(fd[1], user_id, MAXLINE);
        int w_pass = write(fd[1], password, MAXLINE);
        if (w_user == -1 || w_pass == -1) {
            perror("write");
        }

        // Close write end of pipe
        if ((close(fd[1])) == -1) {
            perror("close");
        }

        // Get status of child process
        int status;
        wait(&status);
        if (WIFEXITED(status)) {
            int exit_status = WEXITSTATUS(status);
            printf("Status: %d\n", exit_status);
            // Print message corresponding to status
            if (exit_status == 0) {
                printf("%s\n", SUCCESS);
            } else if (exit_status == 1) {
                perror("Child error");
            } else if (exit_status == 2) {
                printf("%s\n", INVALID);
            } else {
                printf("%s\n", NO_USER);
            }
        } else {
            perror("exit");
        }

    } else if (r == 0) {
        // Child process
        // Close write end of pipe
        if ((close(fd[1])) == -1) {
            perror("close");
        }

        // Read stdin from pipe
        if ((dup2(fd[0], fileno(stdin))) == -1) {
            perror("dup2");
        }

        // Run validate
        execl("./validate", "validate", NULL);
        perror("execl");
    }