checkpassword-reply.c revision ac339d4c51420417887bbe1880f9687d8c3b2d4c
2830N/A/* simple checkpassword wrapper to send userdb data back to dovecot-auth */
2830N/A
2830N/A#include "lib.h"
2830N/A#include "str.h"
2830N/A#include "write-full.h"
2830N/A
2830N/A#include <stdlib.h>
2830N/A#include <unistd.h>
2830N/A
2830N/Aint main(void)
2830N/A{
2830N/A string_t *str;
2830N/A
2830N/A lib_init();
2830N/A str = t_str_new(1024);
2830N/A
2830N/A str_printfa(str, "USER=%s\nHOME=%s\nSHELL=%s\nUID=%s\nGID=%s\n\n",
2830N/A getenv("USER"), getenv("HOME"), getenv("SHELL"),
2830N/A dec2str(getuid()), dec2str(getgid()));
2830N/A
2830N/A if (write_full(4, str_data(str), str_len(str)) < 0) {
2830N/A i_error("write_full() failed: %m");
6856N/A exit(111);
2830N/A }
2830N/A return 0;
2830N/A}
2830N/A