{
char buf[256];
- snprintf(buf, sizeof buf, "%016d", uid);
- write(chkpwd_write_pipe[1], buf, 16);
+ write(chkpwd_write_pipe[1], &uid, sizeof(uid_t));
write(chkpwd_write_pipe[1], pass, 256);
read(chkpwd_read_pipe[0], buf, 4);
char buf[SIZ];
while (1) {
- read(0, buf, 16); /* uid */
- uid = atoi(buf);
+ read(0, &uid, sizeof(uid_t)); /* uid */
read(0, buf, 256); /* password */
if (validate_password(uid, buf)) {
#include "config.h"
#include "control.h"
#include "database.h"
+#include "user_ops.h"
#include "housekeeping.h"
#include "tools.h"
#include "citadel_dirs.c"
lprintf(CTDL_DEBUG, "Validating password for uid=%d using chkpwd...\n", uid);
begin_critical_section(S_CHKPWD);
- snprintf(buf, sizeof buf, "%016d", uid);
- write(chkpwd_write_pipe[1], buf, 16);
+ write(chkpwd_write_pipe[1], &uid, sizeof(uid_t));
write(chkpwd_write_pipe[1], pass, 256);
read(chkpwd_read_pipe[0], buf, 4);
end_critical_section(S_CHKPWD);