]> arthur.barton.de Git - netatalk.git/commitdiff
more Tru64 fixes from Burkhard Schmidt <bs@cpfs.mpg.de>
authorrufustfirefly <rufustfirefly>
Tue, 22 May 2001 19:13:36 +0000 (19:13 +0000)
committerrufustfirefly <rufustfirefly>
Tue, 22 May 2001 19:13:36 +0000 (19:13 +0000)
ChangeLog
bin/megatron/Makefile.am
configure.in
distrib/initscripts/Makefile.am
etc/afpd/main.c
etc/afpd/quota.c
etc/afpd/unix.h
etc/uams/uams_dhx_passwd.c
etc/uams/uams_passwd.c

index a07ddd6cf521d6097b1b78cd3c8260c5f4ac73af..123ef71bea6efe0db7cf7507ded02bf1b832d1b6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,15 @@
-($Id: ChangeLog,v 1.36 2001-05-22 13:35:26 rufustfirefly Exp $)
+($Id: ChangeLog,v 1.37 2001-05-22 19:13:36 rufustfirefly Exp $)
 
 2001-05-22  jeff b  <jeff@univrel.pr.uconn.edu>
        * configure.in, etc/afpd/unix.h: more portability fixes, and
        integration of Tru64 build fix from Edmund Lam <epl@unimelb.edu.au>
 
+       * configure.in, bin/megatron/Makefile.am,
+       distrib/initscripts/Makefile.am, etc/afpd/main.c,
+       etc/afpd/quota.c, etc/afpd/unix.h,
+       etc/uams/uams_dhx_passwd.c, etc/uams/uams_passwd.c: Another
+       round of Tru64 patches from Burkhard Schmidt <bs@cpfs.mpg.de>
+
 2001-05-09  jeff b  <jeff@univrel.pr.uconn.edu>
        * autogen.sh: added automake --include-deps to autogen.sh to
        promote more portable Makefiles (thanks to Christian
index 74c171caa1d9298549a3b3be4ce143160b607844..ef35afb2bef53ae2acf303381ef0b095ff63ded4 100644 (file)
@@ -11,5 +11,6 @@ LINKS = unbin unhex unsingle hqx2bin single2bin macbinary binheader nadheader
 
 install-exec-hook:
        @for LINK in $(LINKS); do \
+               rm -f $(DESTDIR)$(bindir)/$$LINK; \
                $(LN_S) megatron $(DESTDIR)$(bindir)/$$LINK; \
        done
index 9af0795ff7902d5e0f8900b62a7293b5dc919988..866f72a2fcb1654c66624907d93be61794a437a8 100644 (file)
@@ -1,4 +1,4 @@
-dnl $Id: configure.in,v 1.75 2001-05-22 13:35:26 rufustfirefly Exp $
+dnl $Id: configure.in,v 1.76 2001-05-22 19:13:36 rufustfirefly Exp $
 dnl configure.in for netatalk
 
 AC_INIT(bin/adv1tov2/adv1tov2.c)
@@ -85,7 +85,7 @@ dnl Checks for header files.
 AC_HEADER_DIRENT
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(fcntl.h limits.h stdint.h strings.h sys/fcntl.h sys/file.h sys/ioctl.h sys/time.h sys/mnttab.h sys/statvfs.h sys/vfs.h mntent.h syslog.h unistd.h termios.h sys/termios.h netdb.h sgtty.h ufs/quota.h mount.h statfs.h)
+AC_CHECK_HEADERS(fcntl.h limits.h stdint.h strings.h sys/fcntl.h sys/file.h sys/ioctl.h sys/time.h sys/mnttab.h sys/statvfs.h sys/vfs.h mntent.h syslog.h unistd.h termios.h sys/termios.h netdb.h sgtty.h ufs/quota.h mount.h sys/mount.h statfs.h)
 AC_CHECK_HEADER(sys/cdefs.h,,
        AC_MSG_RESULT([enabling generic cdefs.h from tree])
        CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
@@ -533,6 +533,7 @@ if test x"$this_os" = "xtru64"; then
        AC_DEFINE(USE_OLD_RQUOTA)
        dnl AC_DEFINE(USE_UFS_QUOTA_H)
        AC_DEFINE(TRU64)
+       AC_CHECK_LIB(security,set_auth_parameters)
        CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS"
        LDSHAREDFLAGS="-shared -expect_unresolved \*"
        need_dash_r=no
index 0ddfbb1af78234830780d10ae9b0c1bacde71b85..ea24b3953dfcdeab6aba4115d7b9fe5aeddd9815 100644 (file)
@@ -62,7 +62,7 @@ endif
 
 if USE_TRU64
 
-sysvdir        = /etc/rc.d/init.d
+sysvdir        = /sbin/init.d
 sysv_SCRIPTS = atalk
 
 atalk: rc.atalk.tru64
index 603d663f699288b4ca793c46969eaa49b079e32c..0be85f39d01c6e5ee0cba10ec9ba456de2542fca 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: main.c,v 1.5 2001-05-03 13:57:44 rufustfirefly Exp $
+ * $Id: main.c,v 1.6 2001-05-22 19:13:36 rufustfirefly Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
 #include "fork.h"
 #include "uam_auth.h"
 
+#ifdef TRU64
+#include <sys/security.h>
+#include <prot.h>
+#include <sia.h>
+#endif /* TRU64 */
+
 unsigned char  nologin = 0;
 
 struct afp_options default_options;
@@ -128,9 +134,9 @@ int main( ac, av )
     struct sigaction   sv;
     sigset_t            sigs;
 
-#ifdef DIGITAL_UNIX_SECURITY
-       set_auth_parameters( ac, av );
-#endif /* DIGITAL_UNIX_SECURITY */
+#ifdef TRU64
+    set_auth_parameters( ac, av );
+#endif /* TRU64 */
 
     umask( 0 );                /* so inherited file permissions work right */
 
index 1718d33ee7b15dd23676692f1290dac2b5768026..d05c033b96b64360816722db9b5855cf5d948f99 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: quota.c,v 1.5 2001-05-07 20:05:32 rufustfirefly Exp $
+ * $Id: quota.c,v 1.6 2001-05-22 19:13:36 rufustfirefly Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -105,7 +105,7 @@ special( file, nfs )
 }
 
 #else /* ultrix */
-#if defined(HAVE_MOUNT_H) || defined(BSD4_4) || defined(_IBMR2)
+#if defined(HAVE_SYS_MOUNT_H) || defined(BSD4_4) || defined(_IBMR2)
 
 static char *
 special( file, nfs )
index 269fa4a3a26eb0c645906c14e6e0392496ea095b..4a32806cafe1f86a6142516d330988d5b6e3ca9a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: unix.h,v 1.5 2001-05-22 13:35:27 rufustfirefly Exp $
+ * $Id: unix.h,v 1.6 2001-05-22 19:13:36 rufustfirefly Exp $
  */
 
 #ifndef AFPD_UNIX_H
@@ -50,10 +50,10 @@ typedef int mode_t;
 #include <sys/mnttab.h>
 #endif /* __svr4__ || HAVE_SYS_MNTTAB_H */
 
-#if defined(HAVE_MOUNT_H) || defined(BSD4_4) || \
+#if defined(HAVE_SYS_MOUNT_H) || defined(BSD4_4) || \
     defined(linux) || defined(ultrix)
 #include <sys/mount.h>
-#endif /* HAVE_MOUNT_H || BSD4_4 || linux || ultrix */
+#endif /* HAVE_SYS_MOUNT_H || BSD4_4 || linux || ultrix */
 
 #if defined(linux) || defined(HAVE_MNTENT_H)
 #include <mntent.h>
index 98f67a7bcbe7a1cbfe78f5d94d49790fc90666f2..cb2471f701804830166d836149636ebb56da4b64 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: uams_dhx_passwd.c,v 1.7 2001-05-08 18:03:19 rufustfirefly Exp $
+ * $Id: uams_dhx_passwd.c,v 1.8 2001-05-22 19:13:36 rufustfirefly Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) 
@@ -56,11 +56,14 @@ static CAST_KEY castkey;
 static struct passwd *dhxpwd;
 static u_int8_t randbuf[16];
 
-#ifdef DIGITAL_UNIX_SECURITY
+#ifdef TRU64
 #include <sys/types.h>
 #include <sys/security.h>
 #include <prot.h>
-#endif /* DIGITAL_UNIX_SECURITY */
+#include <sia.h>
+
+static int c2security = 0;
+#endif /* TRU64 */
 
 /* dhx passwd */
 static int passwd_login(void *obj, struct passwd **uam_pwd,
@@ -81,9 +84,9 @@ static int passwd_login(void *obj, struct passwd **uam_pwd,
     DH *dh;
 
 #ifdef TRU64
-       static const char rnd_seed[] = "string to make the random number generator think it has entropy";
-       RAND_seed(rnd_seed, sizeof rnd_seed);
-#endif
+    static const char rnd_seed[] = "string to make the random number generator think it has entropy";
+    RAND_seed(rnd_seed, sizeof rnd_seed);
+#endif /* TRU64 */
 
     *rbuflen = 0;
 
@@ -212,11 +215,6 @@ static int passwd_logincont(void *obj, struct passwd **uam_pwd,
     u_int16_t sessid;
     char *p;
 
-#ifdef DIGITAL_UNIX_SECURITY
-       char *bigcrypt();
-       struct pr_passwd *pr;
-#endif /* DIGITAL_UNIX_SECURITY */
-
     *rbuflen = 0;
 
     /* check for session id */
@@ -262,23 +260,32 @@ static int passwd_logincont(void *obj, struct passwd **uam_pwd,
     BN_free(bn3);
 
     rbuf[PASSWDLEN] = '\0';
-#ifdef DIGITAL_UNIX_SECURITY
-       pr = getprpwnam( dhxpwd->pw_name );
+#ifdef TRU64
+    if ( c2security == 1 ) {
+        struct pr_passwd *pr = getprpwnam( dhxpwd->pw_name );
        if ( pr == NULL )
-               return AFPERR_NOTAUTH;
-       if ( strcmp ( bigcrypt ( rbuf, pr->ufld.fd_encrypt ),
-               pr->ufld.fd_encrypt ) == 0 ) {
-               *uam_pwd = dhxpwd;
-               return AFP_OK;
+           return AFPERR_NOTAUTH;
+       if ( strcmp( dispcrypt( rbuf, pr->ufld.fd_encrypt,
+            pr->ufld.fd_oldcrypt ), pr->ufld.fd_encrypt ) == 0 ) {
+            *uam_pwd = dhxpwd;
+            return AFP_OK;
        }
-#else /* DIGITAL_UNIX_SECURITY */
+    } else {
+        p = crypt( rbuf, dhxpwd->pw_passwd );
+        memset(rbuf, 0, PASSWDLEN);
+        if ( strcmp( p, dhxpwd->pw_passwd ) == 0 ) {
+            *uam_pwd = dhxpwd;
+            return AFP_OK;
+        }
+    }
+#else /* TRU64 */
     p = crypt( rbuf, dhxpwd->pw_passwd );
     memset(rbuf, 0, PASSWDLEN);
     if ( strcmp( p, dhxpwd->pw_passwd ) == 0 ) {
       *uam_pwd = dhxpwd;
       return AFP_OK;
     }
-#endif /* DIGITAL_UNIX_SECURITY */
+#endif /* TRU64 */
 
     return AFPERR_NOTAUTH;
 }
@@ -286,6 +293,37 @@ static int passwd_logincont(void *obj, struct passwd **uam_pwd,
 
 static int uam_setup(const char *path)
 {
+#ifdef TRU64
+    FILE *f;
+    char buf[256];
+    char siad[] = "siad_ses_init=";
+
+    if ( access( SIAIGOODFILE, F_OK ) == -1 ) {
+        syslog( LOG_ERR, "dhx uam_setup: %s does not exist",
+            SIAIGOODFILE);
+        return -1;
+    }
+
+    if ( ( f = fopen(MATRIX_CONF, "r" ) ) == NULL ) {
+        syslog( LOG_ERR, "dhx uam_setup: %s is unreadable",
+            MATRIX_CONF );
+        return -1;
+    }
+
+    while ( fgets( buf, sizeof(buf), f ) != NULL ) {
+        if ( strncmp( buf, siad, sizeof(siad) - 1 ) == 0 ) {
+            if ( strstr( buf, "OSFC2" ) != NULL )
+                c2security = 1;
+            break;
+        }
+    }
+
+    fclose(f);
+
+    syslog( LOG_INFO, "dhx uam_setup: security level %s",
+        c2security == 0 ? "BSD" : "OSFC2" );
+#endif /* TRU64 */
+
   if (uam_register(UAM_SERVER_LOGIN, path, "DHCAST128",
                   passwd_login, passwd_logincont, NULL) < 0)
     return -1;
index 55247a53240b953a4f19db6fb678bc2262d81d1c..bb30b3b09edc81ba5beb9868dac5b58575d979d1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: uams_passwd.c,v 1.8 2001-05-07 20:05:34 rufustfirefly Exp $
+ * $Id: uams_passwd.c,v 1.9 2001-05-22 19:13:36 rufustfirefly Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) 
 
 #define PASSWDLEN 8
 
-#ifdef DIGITAL_UNIX_SECURITY
+#ifdef TRU64
 #include <sys/types.h>
 #include <sys/security.h>
 #include <prot.h>
-#endif /* DIGITAL_UNIX_SECURITY */
+#include <sia.h>
+
+static int c2security = 0;
+#endif /* TRU64 */
 
 /* cleartxt login */
 static int passwd_login(void *obj, struct passwd **uam_pwd,
@@ -50,10 +53,6 @@ static int passwd_login(void *obj, struct passwd **uam_pwd,
 #endif /* SHADOWPW */
     char *username, *p;
     int len, ulen;
-#ifdef DIGITAL_UNIX_SECURITY
-       char *bigcrypt();
-       struct pr_passwd *pr;
-#endif /* DIGITAL_UNIX_SECURITY */
 
     *rbuflen = 0;
 
@@ -94,18 +93,27 @@ static int passwd_login(void *obj, struct passwd **uam_pwd,
 
     *uam_pwd = pwd;
 
-#ifdef DIGITAL_UNIX_SECURITY
-       pr = getprpwnam( username );
-       if ( pr == NULL )
-               return AFPERR_NOTAUTH;
-       if ( strcmp ( bigcrypt ( ibuf, pr->ufld.fd_encrypt ),
-               pr->ufld.fd_encrypt ) == 0 )
-      return AFP_OK;
-#else /* DIGITAL_UNIX_SECURITY */
+#ifdef TRU64
+    if ( c2security == 1 ) {
+        struct pr_passwd *pr = getprpwnam( pwd->pw_name );
+        if ( pr == NULL )
+            return AFPERR_NOTAUTH;
+        if ( strcmp( dispcrypt( rbuf, pr->ufld.fd_encrypt,
+            pr->ufld.fd_oldcrypt ), pr->ufld.fd_encrypt ) == 0 ) {
+            return AFP_OK;
+        }
+    } else {
+        p = crypt( rbuf, pwd->pw_passwd );
+        memset(rbuf, 0, PASSWDLEN);
+        if ( strcmp( p, pwd->pw_passwd ) == 0 ) {
+            return AFP_OK;
+        }
+    }
+#else /* TRU64 */
     p = crypt( ibuf, pwd->pw_passwd );
     if ( strcmp( p, pwd->pw_passwd ) == 0 ) 
       return AFP_OK;
-#endif /* DIGITAL_UNIX_SECURITY */
+#endif /* TRU64 */
 
     return AFPERR_NOTAUTH;
 }
@@ -254,6 +262,37 @@ static int passwd_printer(start, stop, username, out)
 
 static int uam_setup(const char *path)
 {
+#ifdef TRU64
+    FILE *f;
+    char buf[256];
+    char siad[] = "siad_ses_init=";
+
+    if ( access( SIAIGOODFILE, F_OK ) == -1 ) {
+        syslog( LOG_ERR, "clrtxt uam_setup: %s does not exist",
+            SIAIGOODFILE);
+        return -1;
+    }
+
+    if ( ( f = fopen(MATRIX_CONF, "r" ) ) == NULL ) {
+        syslog( LOG_ERR, "clrtxt uam_setup: %s is unreadable",
+            MATRIX_CONF );
+        return -1;
+    }
+
+    while ( fgets( buf, sizeof(buf), f ) != NULL ) {
+        if ( strncmp( buf, siad, sizeof(siad) - 1 ) == 0 ) {
+            if ( strstr( buf, "OSFC2" ) != NULL )
+                c2security = 1;
+            break;
+        }
+    }
+
+    fclose(f);
+
+    syslog( LOG_INFO, "clrtxt uam_setup: security level %s",
+        c2security == 0 ? "BSD" : "OSFC2" );
+#endif /* TRU64 */
+
   if (uam_register(UAM_SERVER_LOGIN, path, "Cleartxt Passwrd", 
                passwd_login, NULL, NULL) < 0)
        return -1;