tags 304737 + patch
quit

On Wed, May 11, 2005 at 05:15:09PM +0400, Olleg Samoylov wrote:
> Gerrit Pape wrote:
> >Hi Olleg, how about using an environment variable to optionally override
> >the default name of the Maildir?  Do you feel like updating the man
> >page, and maybe even suggest a patch for checkpw and checkapoppw?
> 
> Now I use checkpassword from package fgetty. It's good enough for me.
> If you think the checkpw is already useful, you may close this feature 
> request. And instead add fgetty to "recommends" packages in package 
> bincimap. (You are maintainer of that package too.)

Hi Olleg, I think the feature in checkpw would be useful, here's a patch
I suggest.

Regards, Gerrit.
Index: checkapoppw.c
===================================================================
RCS file: /var/lib/cvs/checkpw/checkapoppw.c,v
retrieving revision 1.3
diff -u -r1.3 checkapoppw.c
--- checkapoppw.c       4 Mar 2003 15:05:30 -0000       1.3
+++ checkapoppw.c       15 Sep 2005 14:09:02 -0000
@@ -43,6 +43,7 @@
   char *dash;
   char *ext;
   char *password;
+  char *maildir;
   char *timestamp;
   struct stat st;
   int r;
@@ -55,7 +56,9 @@
  
   if (!argv[1]) _exit(2);
   dash = env_get("DASH");
- 
+  maildir = env_get("MAILDIR");
+  if (!maildir) maildir = auto_maildir;
+
   uplen = 0;
   for (;;) {
     do
@@ -94,7 +97,7 @@
   }
   if (chdir(pw->pw_dir) == -1) die(111);
 
-  if (!stralloc_copys(&pwfile, auto_maildir)) die(111);
+  if (!stralloc_copys(&pwfile, maildir)) die(111);
   if (dash && *ext) {
     if (!stralloc_cats(&pwfile, dash)) die(111);
     if (!stralloc_cats(&pwfile, ext)) die(111);
Index: checkpw.c
===================================================================
RCS file: /var/lib/cvs/checkpw/checkpw.c,v
retrieving revision 1.3
diff -u -r1.3 checkpw.c
--- checkpw.c   4 Mar 2003 15:05:30 -0000       1.3
+++ checkpw.c   15 Sep 2005 14:09:02 -0000
@@ -38,13 +38,16 @@
   char *dash;
   char *ext;
   char *password;
+  char *maildir;
   struct stat st;
   int r;
   int i;
  
   if (!argv[1]) _exit(2);
   dash = env_get("DASH");
- 
+  maildir = env_get("MAILDIR");
+  if (!maildir) maildir = auto_maildir;
+
   uplen = 0;
   for (;;) {
     do
@@ -80,7 +83,7 @@
   }
   if (chdir(pw->pw_dir) == -1) die(111);
 
-  if (!stralloc_copys(&pwfile, auto_maildir)) die(111);
+  if (!stralloc_copys(&pwfile, maildir)) die(111);
   if (dash && *ext) {
     if (!stralloc_cats(&pwfile, dash)) die(111);
     if (!stralloc_cats(&pwfile, ext)) die(111);
Index: debian/checkapoppw.8
===================================================================
RCS file: /var/lib/cvs/checkpw/debian/checkapoppw.8,v
retrieving revision 1.3
diff -u -r1.3 checkapoppw.8
--- debian/checkapoppw.8        4 Mar 2003 15:05:30 -0000       1.3
+++ debian/checkapoppw.8        15 Sep 2005 14:09:03 -0000
@@ -1,7 +1,7 @@
 .TH checkapoppw 8
 .SH NAME
 checkapoppw - checks APOP password against the file
-.I ~Maildir/.password
+.I ~/Maildir/.password
 .SH SYNOPSIS
 .B checkapoppw
 .I prog
@@ -56,6 +56,9 @@
 (not encrypted)
 in the user's home directory corresponding to the login name.
 
+.I Maildir
+may be overidden through the environment variable
+.IR $MAILDIR .
 .SH Process-state changes
 Before invoking 
 .IR prog ,
Index: debian/checkpw.8
===================================================================
RCS file: /var/lib/cvs/checkpw/debian/checkpw.8,v
retrieving revision 1.3
diff -u -r1.3 checkpw.8
--- debian/checkpw.8    4 Mar 2003 15:05:30 -0000       1.3
+++ debian/checkpw.8    15 Sep 2005 14:09:03 -0000
@@ -1,7 +1,7 @@
 .TH checkpw 8
 .SH NAME
 checkpw - checks password against the file
-.I ~Maildir/.password
+.I ~/Maildir/.password
 .SH SYNOPSIS
 .B checkpw
 .I prog
@@ -55,6 +55,9 @@
 .I Maildir/.password
 in the user's home directory corresponding to the login name.
 
+.I Maildir
+may be overidden through the environment variable
+.IR $MAILDIR .
 .SH Process-state changes
 Before invoking 
 .IR prog ,

Reply via email to