/*
- * chkpwd.c: a setuid helper program for machines which use shadow passwords
+ * $Id$
+ *
+ * a setuid helper program for machines which use shadow passwords
* by Nathan Bryant, March 1999
*
- * $Id$
*/
#include <pwd.h>
#include "auth.h"
#include "config.h"
+#include "citadel_dirs.h"
#include "citadel.h"
int main(void)
{
uid_t uid;
struct passwd *pw;
- char buf[256];
-
+ char buf[SIZ];
+ int relh=0;
+ int home=0;
+ char relhome[PATH_MAX]="";
+ char ctdldir[PATH_MAX]=CTDLDIR;
+
+ /* TODO: should we be able to calculate relative dirs? */
+ calc_dirs_n_files(relh, home, relhome, ctdldir);
get_config();
uid = getuid();
- if (uid != BBSUID && uid)
+ if (uid != CTDLUID && uid)
{
pw = getpwuid(uid);
openlog("chkpwd", LOG_CONS, LOG_AUTH);
strtok(buf, "\n");
- if (validpw(uid, buf))
+ if (validate_password(uid, buf))
return 0;
return 1;