You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Di...@jrc.it on 1997/01/03 18:40:37 UTC

Comment fields in htpasswd

I am not quite sure if this was what that bug-report was after;
I cannot find it in my bin anymore; but this is what we used
to run here when the tcl/tk tools from CERN where still in 
use. Should be quite safe to add; I really cannot imagine
any system crypt allowing colons in the passwd. 

But although this would work for mod_auth.c; one would need
to do mod_auth_dmb/sql/... as well.

If this is considered good; I'll do that; i.e update the
docs and those three modules too.

Any ideas ? Anyone ?

Dw.



Index: mod_auth.c
===================================================================
RCS file: /home/cvs/apache/src/mod_auth.c,v
retrieving revision 1.1.1.2
diff -c -3 -r1.1.1.2 mod_auth.c
*** mod_auth.c  1997/01/03 17:15:09     1.1.1.2
--- mod_auth.c  1997/01/03 17:33:45
***************
*** 125,132 ****
          if((l[0] == '#') || (!l[0])) continue;
        rpw = l;
          w = getword(r->pool, &rpw, ':');
! 
!         if(!strcmp(user,w)) {
            pfclose(r->pool, f);
              return pstrdup (r->pool, rpw);
        }
--- 125,153 ----
          if((l[0] == '#') || (!l[0])) continue;
        rpw = l;
          w = getword(r->pool, &rpw, ':');
!         
! #ifndef COLONS_IN_HTPASSWD
!       /* Most passwd(5) like files allow for (extra) colon
!        * separated fields; and most crypt() functions on most
!        * platforms use a base64 kind of encoding; which ensures
!        * there are no colons in the password itself; hence
!        * the next little shortcut; which allows seasoned admins 
!        * to make use of extra fields for their own purposes..
!        *
!        * dirkx:agf87346ask: That guy in building 27
!        * smith:3247hjdaskd: For the the ISIS project; on ext 9549 
!        *
!        * As a little aside; you can then also use the nice
!        * CERN-httpd tcl/tk tools which do a userid:passwd:expirydate
!  	 * kind of lines.
!        *
!        */
!       { int pos=ind(rpw,':');
!       if (pos >=0) 
!               rpw[pos]='\0'; /* just zap the rest of the line; 
!			        * we are in pool space anyway. But
!			        * this might make other modules unhappy
!			 	* if they need that third/extra field
!				*/
!       }
! #endif
!       if(!strcmp(user,w)) {
            pfclose(r->pool, f);
              return pstrdup (r->pool, rpw);
        }
dirkx.twirke:src $