binary protocol. sizeof uid_t is now used, since it will
always be on the same host anyway.
- 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);
write(chkpwd_write_pipe[1], pass, 256);
read(chkpwd_read_pipe[0], buf, 4);
char buf[SIZ];
while (1) {
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)) {
read(0, buf, 256); /* password */
if (validate_password(uid, buf)) {
#include "config.h"
#include "control.h"
#include "database.h"
#include "config.h"
#include "control.h"
#include "database.h"
#include "housekeeping.h"
#include "tools.h"
#include "citadel_dirs.c"
#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);
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);
write(chkpwd_write_pipe[1], pass, 256);
read(chkpwd_read_pipe[0], buf, 4);
end_critical_section(S_CHKPWD);