passwd-file.c revision 7c424aa51c956c628e3512055841aa2f9eef4833
/* Copyright (C) 2002-2003 Timo Sirainen */
#include "config.h"
#if defined (USERDB_PASSWD_FILE) || defined(PASSDB_PASSWD_FILE)
#include "common.h"
#include "userdb.h"
#include "passwd-file.h"
#include "buffer.h"
#include "istream.h"
#include "hash.h"
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
{
/* args = uid, gid, user info, home dir, shell, mail, chroot */
struct passwd_user *pu;
const char *p;
i_error("User %s already exists in password file %s",
return;
}
if (p == NULL) {
} else {
/* password[type] - we're being libpam-pwdfile compatible
here. it uses 13 = DES and 34 = MD5. We add
56 = Digest-MD5. */
if (p[1] == '3' && p[2] == '4') {
} else if (p[1] == '5' && p[2] == '6') {
i_error("User %s has invalid password in "
return;
}
} else {
}
}
i_error("User %s has UID 0 in password file %s",
return;
}
args++;
}
i_error("User %s has GID 0 in password file %s",
return;
}
args++;
}
/* user info */
args++;
/* home */
args++;
}
/* shell */
args++;
/* mail storage */
args++;
}
/* chroot */
}
{
const char *const *args;
const char *line;
int fd;
if (fd == -1)
for (;;) {
if (i_stream_read(input) <= 0)
break;
continue;
}
continue; /* no username */
t_push();
/* at least two fields */
}
t_pop();
}
}
{
i_error("close(passwd_file) failed: %m");
}
}
}
}
{
struct passwd_file *pw;
return pw;
}
{
}
}
{
}
}
struct passwd_user *
{
struct passwd_user *pu;
if (verbose)
}
return pu;
}
#endif