]> code.citadel.org Git - citadel.git/blobdiff - citadel/chkpwd.c
Renamed validpw() in auth.c to validate_password()
[citadel.git] / citadel / chkpwd.c
index 76f6c9bb1e5426315417c467bda1e1574eed14a4..bb15e7a1ecc8d3f38ba622e1044bb78fea82c66f 100644 (file)
@@ -1,8 +1,9 @@
 /*
- * 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);
@@ -47,7 +55,7 @@ int main(void)
 
   strtok(buf, "\n");
 
-  if (validpw(uid, buf))
+  if (validate_password(uid, buf))
     return 0;
 
   return 1;