-($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
install-exec-hook:
@for LINK in $(LINKS); do \
+ rm -f $(DESTDIR)$(bindir)/$$LINK; \
$(LN_S) megatron $(DESTDIR)$(bindir)/$$LINK; \
done
-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)
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"
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
if USE_TRU64
-sysvdir = /etc/rc.d/init.d
+sysvdir = /sbin/init.d
sysv_SCRIPTS = atalk
atalk: rc.atalk.tru64
/*
- * $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;
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 */
/*
- * $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.
}
#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 )
/*
- * $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
#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>
/*
- * $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)
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,
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;
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 */
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;
}
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;
/*
- * $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,
#endif /* SHADOWPW */
char *username, *p;
int len, ulen;
-#ifdef DIGITAL_UNIX_SECURITY
- char *bigcrypt();
- struct pr_passwd *pr;
-#endif /* DIGITAL_UNIX_SECURITY */
*rbuflen = 0;
*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;
}
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;