Subject: User database question

From: Georg Wittig <[email-masked]>
Date: Mon, 20 Nov 2000 13:58:39 +0100

[To be removed from this list send the message "unsubscribe fwtk-users" in the
BODY of a mail message to [email-masked].]

Hi,

I'm running fwtk-2.1 under RedHat-6.2. For authenitication of my users
I use authsrv together with opie-2.32.

How can I establish and initialize users that are in my fw-authdb, but
*not* in the /etc/passwd file? Authsrv can establish such users, but
when I try to initialize those users in the opie system, then
opiepasswd insists that those users can be found in /etc/passwd.

In case this problem can be solved easier with s/key instead of opie:
Where can I get an s/key version which handles md5 and can work
together with fwtk?

The fwtk documentation doesn't seem to cover my problem, nor does the
fwtk mailing list archive, nor do deja.com and altavista.

Thanks for your help,

-- 
Georg Wittig, GMD				[email-masked]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Spiders keep both flies and alligators away. I've never found an
alligator in my garage, and there are lots of spiders in there.

---

From: Chris Wakelin <[email-masked]>
Date: Mon, 20 Nov 2000 14:36:51 +0000 (GMT Standard Time)

This is what I did:

"cd opie-2.32"
"./configure --prefix=/opt/local/fwtk" (or wherever)
"make client" (don't make install or you'll overwrite your system files!)

Apply the opie.patch from fwtk.org (you don't need to uncomment the SKEY 
lines in auth.h).

I found I needed to modify auth/opie.c (patch attached) to make it work 
properly - it was always warning about running out of passwords.

Hope this helps,
Chris

> opiepasswd insists that those users can be found in /etc/passwd.

--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+--
Christopher Wakelin,                                [email-masked]
IT Services Centre, The University of Reading,       Tel: +44 (0)118 931 6630
Whiteknights, Reading, RG6 2AF, UK                   Fax: +44 (0)118 975 3094

*** opie.c	Wed Dec  1 18:05:04 1999
--- opie.c.orig	Mon Nov 20 14:27:01 2000
***************
*** 6,16 ****
   *
   */
  
- /*
-  * Modified by Chris Wakelin, IT Services, The University of Reading 
-  * to fix bug in test for running out of passwords
- */
- 
  #include	<stdio.h>
  #include	<sys/types.h>
  #include	<time.h>
--- 6,11 ----
***************
*** 48,63 ****
  Auth	*ap;
  char	*rbuf;
  {
- 	int i;
  	strcpy(rbuf,"Permission Denied.");
  	if(!challenged)
  		return(1);
  	challenged = 0;
- 	i = opiegetsequence(&kbuf); 	/* save password sequence number */
- 					/* since opieverify zeros kbuf */
  	if(opieverify(&kbuf,pass) == 0) {
  		strcpy(rbuf,"ok");
! 		if(i < 5)
  			strcat(rbuf,"Warning -- Change password soon!");
  		return(0);
  	}
--- 43,55 ----
  Auth	*ap;
  char	*rbuf;
  {
  	strcpy(rbuf,"Permission Denied.");
  	if(!challenged)
  		return(1);
  	challenged = 0;
  	if(opieverify(&kbuf,pass) == 0) {
  		strcpy(rbuf,"ok");
! 		if(kbuf.opie_n < 5)
  			strcat(rbuf,"Warning -- Change password soon!");
  		return(0);
  	}
***************
*** 84,93 ****
  
    switch (rval) {
    case 0:
!     printf("Updating %s:\n", user);
      break;
    case 1:
!     printf("Adding %s:\n", user);
      break;
    case 2:
      strcpy(rbuf, "Error: Can't update key database.\n");
--- 76,85 ----
  
    switch (rval) {
    case 0:
!     /* printf("Updating %s:\n", user); */
      break;
    case 1:
!     /* printf("Adding %s:\n", user); */
      break;
    case 2:
      strcpy(rbuf, "Error: Can't update key database.\n");
***************
*** 120,144 ****
  	goto bad_finish;
    }
  
- /* Added by CDW to fix problem with report giving meaningless data */
- /* Gets opie settings for newly created/updated user */
-   rval = opielookup(&opie, user);
-   switch (rval) {
-   case 0:
-     break;
-   case 1:
-     strcpy(rbuf, "Error: Key database wasn't updated for some reason.\n");
-     return(1);
-   case 2:
-     strcpy(rbuf, "Error (2) reading key database.\n");
-     return(1);
-   default:
-     strcpy(rbuf, "Error (other) reading key database.\n");
-     return(1);
-   }
- 
- /* End CDW addition */
- 
    sprintf(rbuf, "ID %s OTP key is %d %s", opie.opie_principal,
      opie.opie_n, opie.opie_seed);
  
--- 112,117 ----