Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Nov 2002 18:37:03 -0500
From:      Jeff Ito <jeffi@rcn.com>
To:        ports@freebsd.org
Cc:        andreas_and_joe@tao.org.uk
Subject:   [PATCH] net/tac_plus4
Message-ID:  <20021103233703.GG26082@rcn.com>

next in thread | raw e-mail | index | archive | help
Can someone who uses tac_plus/skey please test this to verify it works.
It compiles cleanly.  But I am not certain that the apis are quite as
interchangable as it appears.

these deprecate files/patch-aa and files/patch-ab

files/patch-ah
--- skey_fn.c.orig      Sun Jun 18 13:26:54 2000
+++ skey_fn.c   Sun Nov  3 17:34:25 2002
@@ -27,10 +27,10 @@
 #define STATE_AUTHEN_GETUSER 1 /* username has been requested */
 #define STATE_AUTHEN_GETPASS 2 /* password has been requested */

-#include <skey.h>
+#include <opie.h>

 struct private_data {
-    struct skey skey;
+    struct opie skey;
     char password[MAX_PASSWD_LEN + 1];
     int state;
 };
@@ -44,14 +44,14 @@
 struct authen_data *data;
 {
     struct private_data *p = data->method_data;
-    struct skey *skeyp = &p->skey;
+    struct opie *skeyp = &p->skey;

     data->status = TAC_PLUS_AUTHEN_STATUS_FAIL;

-    if (skeyverify(skeyp, passwd) == 0) {
+    if (opieverify(skeyp, passwd) == 0) {
        /* S/Key authentication succeeded */
        data->status = TAC_PLUS_AUTHEN_STATUS_PASS;
-       if (skeyp->n < 5) {
+       if (skeyp->opie_n < 5) {
            data->server_msg = tac_strdup("Password will expire soon");
            return (1);
        }
@@ -167,10 +167,15 @@
                return(1);
            }

-           if (skeychallenge(&p->skey, name, skeyprompt) == 0) {
+           if (opiechallenge(&p->skey, name, skeyprompt) == 0) {
                char buf[256];
                sprintf(buf, "%s\nPassword: ", skeyprompt);
                data->server_msg = tac_strdup(buf);
+
+               /* We try to make it in accordance of standard FreeBSD
+                * behaviour in order to avoid surprises for user */
+               data->flags = TAC_PLUS_AUTHEN_FLAG_NOECHO;
+
                data->status = TAC_PLUS_AUTHEN_STATUS_GETPASS;
                p->state = STATE_AUTHEN_GETPASS;
                return (0);



files/patch-ag
--- Makefile.orig       Sun Jun 18 13:26:54 2000
+++ Makefile    Sun Nov  3 17:34:20 2002
@@ -19,7 +19,7 @@
 # LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 # FOR A PARTICULAR PURPOSE.

-CC = gcc
+# CC = gcc

 # For AIX
 # See /usr/lpp/bos/bsdport on your system for details of how to define bsdcc
@@ -33,13 +33,13 @@
 # OS=-DMIPS

 # For Solaris (SUNOS 5.3, 5.4, 5.5, 5.6) uncomment the following two lines
-OS=-DSOLARIS
-OSLIBS=-lsocket -lnsl
+# OS=-DSOLARIS
+# OSLIBS=-lsocket -lnsl

 # For FreeBSD
-# OS=-DFREEBSD
+OS=-DFREEBSD
 # You may also need to add:
-# OSLIBS=-lcrypt
+OSLIBS=-lcrypt
 # NOTE: If you want your password encryption to be compatible with
 # e.g. SunOS, you may need to instead use:
 # OSLIBS=-ldescrypt
@@ -64,12 +64,12 @@
 # FLAGS   = -DTAC_PLUS_USERID=$(USERID) -DTAC_PLUS_GROUPID=$(GROUPID)

 # Definitions for SKEY functionality
-# DEFINES = -DSKEY
-# LIBS = ../crimelab/skey/src/libskey.a
+DEFINES = -DSKEY
+LIBS = -lopie -lmd
 # INCLUDES = -I../crimelab/skey/src

 # Debugging flags
-DEBUG = -g
+# DEBUG = -g

 # Enforce a limit on maximum sessions per user. See the user's guide
 # for more information.
@@ -85,13 +85,13 @@
 # possible), containing its process id. Uncomment and modify the
 # following line to change this filename

-# PIDFILE = -DTAC_PLUS_PIDFILE=\"/var/run/tac_plus.pid\"
+PIDFILE = -DTAC_PLUS_PIDFILE=\"/var/run/tac_plus.pid\"

 #
 # End of customisable section of Makefile
 #

-CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) $(FLAGS) $(OS) $(PIDFILE) $(MAXSESS)
+CFLAGS += $(DEBUG) $(DEFINES) $(INCLUDES) $(FLAGS) $(OS) $(PIDFILE) $(MAXSESS)

 HFILES = expire.h parse.h regmagic.h md5.h regexp.h tac_plus.h

@@ -130,8 +130,8 @@
        -rm -f *.o *~ *.BAK tac_plus generate_passwd

 install:
-       cp tac_plus /usr/local/bin
-       cp tac_plus.1 /usr/man/manl/tac_plus.1
+       cp tac_plus $(PREFIX)/sbin
+       cp tac_plus.1 $(PREFIX)/man1/tac_plus.1

 depend:
        makedepend $(CFLAGS) $(SRCS)



...

feedback appreciated

thank you
Jeff

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021103233703.GG26082>