]> arthur.barton.de Git - netatalk.git/commitdiff
uams CVS Id tag addition, uams_dhx_pam auth module works again, new spec file for...
authorrufustfirefly <rufustfirefly>
Tue, 27 Feb 2001 17:07:42 +0000 (17:07 +0000)
committerrufustfirefly <rufustfirefly>
Tue, 27 Feb 2001 17:07:42 +0000 (17:07 +0000)
ChangeLog
distrib/initscripts/.cvsignore
distrib/rpm/netatalk-redhat.spec [new file with mode: 0644]
etc/uams/uams_dhx_pam.c
etc/uams/uams_dhx_passwd.c
etc/uams/uams_guest.c
etc/uams/uams_pam.c
etc/uams/uams_passwd.c
etc/uams/uams_pgp.c
etc/uams/uams_randnum.c

index 40b2dd4125baf12a133f55b5e8d8ba62a5e1b25e..99cc15a3e0c1da9f49803c2c50926760a59a5b7c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,17 @@
        * README: updated 1.5+ install instructions to include list of
        required and recommended packages
 
+       * etc/uams/uam_*.c: cleanups, addition of CVS Id tag to C source
+
+       * configure.in, acconfig.h: change USE_AFS to AFS to be the same as
+       all of the defines in the codebase
+
+       * etc/uams/uam_dhx_pam.c: fixed DHX login using this module (last
+       patch made with syslog()'s didn't include any brackets) 
+       (Bug #233756)
+
+       * distrib/initscripts/.cvsignore: removed pulling of atalk
+
 2001-02-26  jeff b  <jeff@univrel.pr.uconn.edu>  
 
        * configure.in: added /usr/local/ssl to list of SSL paths to check, to
index 47e431c68fc9029a8762cbd70da44458e3013315..d5580be185a7acebdabb198c5635deb772f7619a 100644 (file)
@@ -4,3 +4,4 @@ rc.atalk.cobalt
 rc.atalk.redhat
 rc.atalk.suse
 rc.atalk.tru64
+atalk
diff --git a/distrib/rpm/netatalk-redhat.spec b/distrib/rpm/netatalk-redhat.spec
new file mode 100644 (file)
index 0000000..2b1d99d
--- /dev/null
@@ -0,0 +1,183 @@
+#################################################### VERSIONING INFORMATION
+%define name    netatalk
+%define version 1.5pre5
+%define release 0
+
+################################################# BASIC PACKAGE INFORMATION
+Summary: Appletalk and Appleshare/IP services for Linux
+Name: %{name}
+Version: %{version}
+Release: %{release}
+Copyright: BSD
+Group: Networking/Daemons
+Source0: %{name}-%{version}.tar.gz
+URL: http://netatalk.sourceforge.net/
+Packager: rufus t firefly <rufus.t.firefly@linux-mandrake.com>
+Obsoletes: netatalk-1.4b2+asun netatalk-1.4.99
+
+############################################################## REQUIREMENTS
+Requires: cracklib, openssl, tcp_wrappers, pam
+BuildRequires: openssl-devel
+
+Prefix:    %{_prefix}
+BuildRoot: /var/tmp/%{name}-buildroot
+
+%description
+netatalk is an implementation of the AppleTalk Protocol Suite for Unix/Linux
+systems. The current release contains support for Ethertalk Phase I and II,
+DDP, RTMP, NBP, ZIP, AEP, ATP, PAP, ASP, and AFP. It provides Appletalk file
+printing and routing services on Solaris 2.5, Linux, FreeBSD, SunOS 4.1 and
+Ultrix 4. It also supports AFP 2.1 and 2.2 (Appleshare IP).
+
+%package devel
+Group: Development/Networking
+Summary: Appletalk and Appleshare/IP services for Linux development files
+%description devel
+netatalk is an implementation of the AppleTalk Protocol Suite for Unix/Linux
+systems. The current release contains support for Ethertalk Phase I and II,
+DDP, RTMP, NBP, ZIP, AEP, ATP, PAP, ASP, and AFP. It provides Appletalk file
+printing and routing services on Solaris 2.5, Linux, FreeBSD, SunOS 4.1 and
+Ultrix 4. It also supports AFP 2.1 and 2.2 (Appleshare IP).
+
+This package is required for developing appletalk-based applications.
+
+%changelog
+
+* Fri Feb 23 2001 rufus t firefly <rufus.t.firefly@linux-mandrake.com>
+  - v1.5pre5-0
+  - pre-release 5 for sourceforge (prebuild)
+
+* Tue Feb 20 2001 rufus t firefly <rufus.t.firefly@linux-mandrake.com>
+  - v1.5pre4-1
+  - pre-release 4 for sourceforge
+  - modified/split mandrake spec for redhat 7 build
+
+* Mon Dec 18 2000 rufus t firefly <rufus.t.firefly@linux-mandrake.com>
+  - v1.5pre3-1mdk
+  - pre-release 3 for sourceforge
+  - moved away from 1.4.99 ... 
+
+* Wed Nov 08 2000 rufus t firefly <rufus.t.firefly@linux-mandrake.com>
+  - v1.4.99-0.20001108mdk
+  - pre-release 2 for sourceforge
+
+* Wed Sep 27 2000 rufus t firefly <rufus.t.firefly@linux-mandrake.com>
+  - v1.4.99-0.20000927mdk
+  - pre-release 1 for sourceforge
+
+%prep
+%setup -q -n %{name}/
+
+%build
+./autogen.sh
+CFLAGS="$RPM_OPT_FLAGS -fomit-frame-pointer -fsigned-char" ./configure \
+       --prefix=%{prefix} \
+       --enable-lastdid \
+       --enable-redhat \
+       --with-cracklib \
+       --with-pam \
+       --with-shadow \
+       --with-tcp-wrappers \
+       --with-ssl
+# --with-flock-locks
+make all
+
+%install
+### INSTALL (USING "make install") ###
+mkdir -p $RPM_BUILD_ROOT%{prefix}
+make DESTDIR=$RPM_BUILD_ROOT install-strip
+
+# bzip2 man pages
+#for i in 1 3 4 5 8; do
+#      bzip2 -v $RPM_BUILD_ROOT/usr/man/man$i/*.$i
+#done
+
+# install pam file
+#mkdir -p $RPM_BUILD_ROOT/etc/pam.d/
+#install -m 644 -o 0 -g 0  config/netatalk.pamd \
+#  $RPM_BUILD_ROOT/etc/pam.d/netatalk
+
+%post
+### RUN CHKCONFIG ###
+/sbin/chkconfig --add atalk
+/sbin/ldconfig
+# after the first install only
+if [ "$1" = 1 ]; then
+       # add the ddp lines to /etc/services
+       if (grep '[0-9][0-9]*/ddp' /etc/services >/dev/null); then
+               cat <<'_EOD1_' >&2
+warning: The DDP services appear to be present in /etc/services.
+warning: Please check them against services.atalk in the documentation.
+_EOD1_
+               true
+       else
+               cat <<'_EOD2_' >>/etc/services
+# start of DDP services
+#
+# Everything between the 'start of DDP services' and 'end of DDP services'
+# lines will be automatically deleted when the netatalk package is removed.
+#
+rtmp           1/ddp           # Routing Table Maintenance Protocol
+nbp            2/ddp           # Name Binding Protocol
+echo           4/ddp           # AppleTalk Echo Protocol
+zip            6/ddp           # Zone Information Protocol
+
+afpovertcp     548/tcp         # AFP over TCP
+afpovertcp     548/udp
+# end of DDP services
+_EOD2_
+       fi
+fi
+
+%preun
+### RUN CHKCONFIG ###
+/sbin/chkconfig --del atalk
+
+%postun
+# do only for the last un-install
+if [ "$1" = 0 ]; then
+       # remove the ddp lines from /etc/services
+       if (grep '^# start of DDP services$' /etc/services >/dev/null && \
+           grep '^# end of DDP services$'   /etc/services >/dev/null ); then
+         sed -e '/^# start of DDP services$/,/^# end of DDP services$/d' \
+           </etc/services >/tmp/services.tmp$$
+         cat /tmp/services.tmp$$ >/etc/services
+         rm /tmp/services.tmp$$
+       else
+         cat <<'_EOD3_' >&2
+warning: Unable to find the lines `# start of DDP services` and
+warning: `# end of DDP services` in the file /etc/services.
+warning: You should remove the DDP services from /etc/services manually.
+_EOD3_
+       fi
+fi
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+rm -rf $RPM_BUILD_DIR/%{name}/
+
+%files
+%defattr(-,root,root)
+%doc AUTHORS BUGS CHANGES CONTRIBUTORS COPYRIGHT ChangeLog NEWS README* TODO
+%doc VERSION doc/
+%config /etc/atalk/Apple*
+%config /etc/atalk/*.conf
+%config /etc/pam.d/netatalk
+/etc/atalk/nls/*
+/etc/atalk/uams/*.so
+/etc/rc.d/init.d/atalk
+%dir /etc/atalk
+%dir /etc/atalk/nls
+%dir /etc/atalk/uams
+%{prefix}/bin/*
+%{prefix}/sbin/*
+%{prefix}/man/man*/*
+
+%files devel
+%defattr(-,root,root)
+%{prefix}/lib/*.a
+%dir %{prefix}/include/atalk
+%{prefix}/include/atalk/*.h
+%dir %{prefix}/include/netatalk
+%{prefix}/include/netatalk/*.h
+%{prefix}/share/aclocal/netatalk.m4
index 0461b16f63a61e5fa730ca38786918159c4b223a..62969d66b357277684e80f00843f39dc427a504b 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: uams_dhx_pam.c,v 1.13 2001-02-27 17:07:43 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) 
  * All Rights Reserved.  See COPYRIGHT.
 #include <string.h>
 #include <syslog.h>
 
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
 #include <security/pam_appl.h>
 
 #ifdef OPENSSL_DHX
@@ -72,38 +78,42 @@ static int PAM_conv (int num_msg,
   
 #define COPY_STRING(s) (s) ? strdup(s) : NULL
   
-  if (num_msg < 1)
+  if (num_msg < 1) {
     /* Log Entry */
            syslog(LOG_INFO, "uams_dhx_pam.c :PAM DHX Conversation Err -- %m");
     /* Log Entry */
     return PAM_CONV_ERR;
+  }
 
   reply = (struct pam_response *) 
     calloc(num_msg, sizeof(struct pam_response));
 
-  if (!reply)
+  if (!reply) {
     /* Log Entry */
            syslog(LOG_INFO, "uams_dhx_pam.c :PAM DHX Conversation Err -- %m");
     /* Log Entry */
     return PAM_CONV_ERR;
+  }
 
   for (count = 0; count < num_msg; count++) {
     char *string = NULL;
 
     switch (msg[count]->msg_style) {
     case PAM_PROMPT_ECHO_ON:
-      if (!(string = COPY_STRING(PAM_username)))
+      if (!(string = COPY_STRING(PAM_username))) {
     /* Log Entry */
            syslog(LOG_INFO, "uams_dhx_pam.c :PAM: username failure -- %m");
     /* Log Entry */
        goto pam_fail_conv;
+      }
       break;
     case PAM_PROMPT_ECHO_OFF:
-      if (!(string = COPY_STRING(PAM_password)))
+      if (!(string = COPY_STRING(PAM_password))) {
     /* Log Entry */
            syslog(LOG_INFO, "uams_dhx_pam.c :PAM: passwd failure: --: %m");
     /* Log Entry */
        goto pam_fail_conv;
+      }
       break;
     case PAM_TEXT_INFO:
 #ifdef PAM_BINARY_PROMPT
@@ -165,11 +175,12 @@ static int dhx_setup(void *obj, char *ibuf, int ibuflen,
     DH *dh;
 
     /* get the client's public key */
-    if (!(bn = BN_bin2bn(ibuf, KEYSIZE, NULL)))
+    if (!(bn = BN_bin2bn(ibuf, KEYSIZE, NULL))) {
     /* Log Entry */
            syslog(LOG_INFO, "uams_dhx_pam.c :PAM No Public Key -- %m");
     /* Log Entry */
       return AFPERR_PARAM;
+    }
 
     /* get our primes */
     if (!(gbn = BN_bin2bn(&g, sizeof(g), NULL))) {
@@ -285,11 +296,12 @@ static int pam_login(void *obj, struct passwd **uam_pwd,
 
     /* grab some of the options */
     if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, (void *) &buf,
-                            &i) < 0)
+                            &i) < 0) {
     /* Log Entry */
            syslog(LOG_INFO, "uams_dhx_pam.c :PAM: uam_afpserver_option didn't meet uam_option_username  -- %m");
     /* Log Entry */
       return AFPERR_PARAM;
+    }
 
     len = (unsigned char) *ibuf++;
     if ( len > i ) {
@@ -331,11 +343,12 @@ static int pam_logincont(void *obj, struct passwd **uam_pwd,
 
     /* check for session id */
     memcpy(&sessid, ibuf, sizeof(sessid));
-    if (sessid != dhxhash(obj))
+    if (sessid != dhxhash(obj)) {
     /* Log Entry */
            syslog(LOG_INFO, "uams_dhx_pam.c :PAM Session ID - DHXHash Mismatch -- %m");
     /* Log Entry */
       return AFPERR_PARAM;
+    }
     ibuf += sizeof(sessid);
     
     if (uam_afpserver_option(obj, UAM_OPTION_HOSTNAME,
@@ -385,11 +398,12 @@ static int pam_logincont(void *obj, struct passwd **uam_pwd,
     err = AFPERR_NOTAUTH;
     PAM_error = pam_start("netatalk", PAM_username, &PAM_conversation,
                          &pamh);
-    if (PAM_error != PAM_SUCCESS)
+    if (PAM_error != PAM_SUCCESS) {
     /* Log Entry */
-           syslog(LOG_INFO, "uams_dhx_pam.c :PAM: PAM_Error: %s -- %m", PAM_error);
+           syslog(LOG_INFO, "uams_dhx_pam.c :PAM: PAM_Error: %s -- %m", pam_strerror(pamh,PAM_error));
     /* Log Entry */
       goto logincont_err;
+    }
 
     /* solaris craps out if PAM_TTY and PAM_RHOST aren't set. */
     pam_set_item(pamh, PAM_TTY, "afpd");
@@ -399,7 +413,7 @@ static int pam_logincont(void *obj, struct passwd **uam_pwd,
       if (PAM_error == PAM_MAXTRIES) 
        err = AFPERR_PWDEXPR;
     /* Log Entry */
-           syslog(LOG_INFO, "uams_dhx_pam.c :PAM: PAM_Error: %s -- %m", PAM_error);
+           syslog(LOG_INFO, "uams_dhx_pam.c :PAM: PAM_Error: %s -- %m", pam_strerror(pamh, PAM_error));
     /* Log Entry */
       goto logincont_err;
     }      
@@ -413,7 +427,7 @@ static int pam_logincont(void *obj, struct passwd **uam_pwd,
        err = AFPERR_PWDCHNG;
 #endif
     /* Log Entry */
-           syslog(LOG_INFO, "uams_dhx_pam.c :PAM: PAM_Error: %s -- %m", PAM_error);
+           syslog(LOG_INFO, "uams_dhx_pam.c :PAM: PAM_Error: %s -- %m", pam_strerror(pamh, PAM_error));
     /* Log Entry */
       goto logincont_err;
     }
@@ -422,18 +436,20 @@ static int pam_logincont(void *obj, struct passwd **uam_pwd,
 #define PAM_CRED_ESTABLISH PAM_ESTABLISH_CRED
 #endif
     PAM_error = pam_setcred(pamh, PAM_CRED_ESTABLISH);
-    if (PAM_error != PAM_SUCCESS)
+    if (PAM_error != PAM_SUCCESS) {
     /* Log Entry */
-           syslog(LOG_INFO, "uams_dhx_pam.c :PAM: PAM_Error: %s -- %m", PAM_error);
+           syslog(LOG_INFO, "uams_dhx_pam.c :PAM: PAM_Error: %s -- %m", pam_strerror(pamh, PAM_error));
     /* Log Entry */
       goto logincont_err;
+    }
 
     PAM_error = pam_open_session(pamh, 0);
-    if (PAM_error != PAM_SUCCESS)
+    if (PAM_error != PAM_SUCCESS) {
     /* Log Entry */
-           syslog(LOG_INFO, "uams_dhx_pam.c :PAM: PAM_Error: %s -- %m", PAM_error);
+           syslog(LOG_INFO, "uams_dhx_pam.c :PAM: PAM_Error: %s -- %m", pam_strerror(pamh, PAM_error));
     /* Log Entry */
       goto logincont_err;
+    }
 
     memset(rbuf, 0, PASSWDLEN); /* zero out the password */
     *uam_pwd = dhxpwd;
@@ -485,19 +501,21 @@ static int pam_changepw(void *obj, char *username,
     /* otherwise, it's like logincont but different. */
 
     /* check out the session id */
-    if (sessid != dhxhash(obj))
+    if (sessid != dhxhash(obj)) {
     /* Log Entry */
            syslog(LOG_INFO, "uams_dhx_pam.c :PAM: Session ID not Equal to DHX Hash -- %m");
     /* Log Entry */
       return AFPERR_PARAM;
+    }
 
     /* we need this for pam */
     if (uam_afpserver_option(obj, UAM_OPTION_HOSTNAME,
-                            (void *) &hostname, NULL) < 0)
+                            (void *) &hostname, NULL) < 0) {
     /* Log Entry */
            syslog(LOG_INFO, "uams_dhx_pam.c :PAM: Hostname Null?? -- %m");
     /* Log Entry */
       return AFPERR_MISC;
+    }
 
     /* grab the client's nonce, old password, and new password. */
     CAST_cbc_encrypt(ibuf, ibuf, CHANGEPWBUFLEN, &castkey,
@@ -506,11 +524,12 @@ static int pam_changepw(void *obj, char *username,
 
     /* check to make sure that the random number is the same. we
      * get sent back an incremented random number. */
-    if (!(bn1 = BN_bin2bn(ibuf, KEYSIZE, NULL)))
+    if (!(bn1 = BN_bin2bn(ibuf, KEYSIZE, NULL))) {
     /* Log Entry */
            syslog(LOG_INFO, "uams_dhx_pam.c :PAM: Random Number Not the same or not incremented-- %m");
     /* Log Entry */
       return AFPERR_PARAM;
+    }
 
     if (!(bn2 = BN_bin2bn(randbuf, sizeof(randbuf), NULL))) {
       BN_free(bn1);
@@ -557,11 +576,12 @@ static int pam_changepw(void *obj, char *username,
 
     PAM_error = pam_start("netatalk", username, &PAM_conversation,
                          &lpamh);
-    if (PAM_error != PAM_SUCCESS)
+    if (PAM_error != PAM_SUCCESS) {
     /* Log Entry */
            syslog(LOG_INFO, "uams_dhx_pam.c :PAM: Needless to say, PAM_error is != to PAM_SUCCESS -- %m");
     /* Log Entry */
       return AFPERR_PARAM;
+    }
     pam_set_item(lpamh, PAM_TTY, "afpd");
     pam_set_item(lpamh, PAM_RHOST, hostname);
 
index 9dc173499f8cf31b019fa15409684cb26f471303..b8076cfb8b82a14963eb89350755563c965a6616 100644 (file)
@@ -1,4 +1,7 @@
-/* Copyright (c) 1990,1993 Regents of The University of Michigan.
+/*
+ * $Id: uams_dhx_passwd.c,v 1.6 2001-02-27 17:07:43 rufustfirefly Exp $
+ *
+ * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) 
  * All Rights Reserved.  See COPYRIGHT.
  */
@@ -24,7 +27,7 @@
 
 #ifdef SHADOWPW
 #include <shadow.h>
-#endif SHADOWPW
+#endif /* SHADOWPW */
 
 #ifdef OPENSSL_DHX
 #include <openssl/bn.h>
@@ -34,7 +37,7 @@
 #include <bn.h>
 #include <dh.h>
 #include <cast.h>
-#endif
+#endif /* OPENSSL_DHX */
 
 #include <atalk/afp.h>
 #include <atalk/uam.h>
index 1a6c906085edc75038ebd8303fa3e4bbf8d00a75..e580f858338b2faf55f4e8a6cdedc9a79e23f59f 100644 (file)
@@ -1,3 +1,9 @@
+/*
+ * $Id: uams_guest.c,v 1.4 2001-02-27 17:07:43 rufustfirefly Exp $
+ *
+ * (c) 2001 (see COPYING)
+ */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
index 473e5e5c6e1ea6a6822e5b9f9823cb7abf8d13a4..bb65bec1c293374039393d17fd6fe9d7c72d849e 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: uams_pam.c,v 1.6 2001-02-27 17:07:43 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) 
  * All Rights Reserved.  See COPYRIGHT.
index 8afc1247520416ee9e7c849c91d92c5b0fa6dae8..83cf7d1b7cbb4b4f68e675cae1265e3bba61574f 100644 (file)
@@ -1,4 +1,7 @@
-/* Copyright (c) 1990,1993 Regents of The University of Michigan.
+/*
+ * $Id: uams_passwd.c,v 1.6 2001-02-27 17:07:43 rufustfirefly Exp $
+ *
+ * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) 
  * All Rights Reserved.  See COPYRIGHT.
  */
index 66efa87332285e92c9b407d9839bd5e65b50a3c0..6be6f308b0e9bd88ae980630947cd7e0313dfcea 100644 (file)
@@ -1,4 +1,7 @@
-/* Copyright (c) 1990,1993 Regents of The University of Michigan.
+/*
+ * $Id: uams_pgp.c,v 1.4 2001-02-27 17:07:43 rufustfirefly Exp $
+ *
+ * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) 
  * All Rights Reserved.  See COPYRIGHT.
  */
@@ -23,7 +26,7 @@
 #include <bn.h>
 #include <dh.h>
 #include <cast.h>
-#endif
+#endif /* OPENSSL_DHX */
 
 #include <atalk/afp.h>
 #include <atalk/uam.h>
@@ -183,4 +186,5 @@ UAM_MODULE_EXPORT struct uam_export uams_pgp = {
   UAM_MODULE_VERSION,
   uam_setup, uam_cleanup
 };
+
 #endif
index fd9e48816ab0afa92d8dc31940ddbb23c7499327..30ddc7cf847871b64d58f09092281864a493c19b 100644 (file)
@@ -1,4 +1,6 @@
 /* 
+ * $Id: uams_randnum.c,v 1.4 2001-02-27 17:07:43 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) 
  * All Rights Reserved.  See COPYRIGHT.