You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Chris Tengi <te...@CS.Princeton.EDU> on 1997/09/11 19:30:01 UTC

mod_auth-any/1117: Using NIS passwd.byname dbm files with AuthDBMUserFile

>Number:         1117
>Category:       mod_auth-any
>Synopsis:       Using NIS passwd.byname dbm files with AuthDBMUserFile
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache (Apache HTTP Project)
>State:          open
>Class:          change-request
>Submitter-Id:   apache
>Arrival-Date:   Thu Sep 11 10:30:01 1997
>Originator:     tengi@CS.Princeton.EDU
>Organization:
apache
>Release:        1.2.4
>Environment:
SunOS cs 5.5.1 Generic_103640-06 sun4u sparc SUNW,Ultra-1
gcc version 2.7.2
>Description:
I have a situation where it is convenient to use the NIS passwd.byname DBM as
the AuthDBMUserFIle.  As the first field in the data returned from the DBM is
the username, this needed to be stripped, and the password extracted from the
2nd field.  A patch is included below.
>How-To-Repeat:

>Fix:
*** mod_auth_dbm.c      1997/09/11 14:56:22     1.1
--- mod_auth_dbm.c      1997/09/11 16:58:42
***************
*** 197,202 ****
--- 197,208 ----
      /* Password is up to first : if exists */
      colon_pw = strchr(real_pw,':');
      if (colon_pw) *colon_pw='\0';   
+     if (strcmp(real_pw,c->user) == 0) {		/* If DBM file is NIS passwd map, first token is username */
+ 	colon_pw++;
+ 	real_pw = colon_pw;
+ 	colon_pw = strchr(real_pw,':');
+ 	if (colon_pw) *colon_pw='\0';
+     }
      /* anyone know where the prototype for crypt is? */
      if(strcmp(real_pw,(char *)crypt(sent_pw,real_pw))) {
          ap_snprintf(errstr, sizeof(errstr), 
%0
>Audit-Trail:
>Unformatted: