]> arthur.barton.de Git - netatalk.git/commitdiff
changes from HEAD
authordidg <didg>
Wed, 3 Sep 2003 20:40:49 +0000 (20:40 +0000)
committerdidg <didg>
Wed, 3 Sep 2003 20:40:49 +0000 (20:40 +0000)
20 files changed:
bin/adv1tov2/Makefile.am
bin/aecho/Makefile.am
bin/afile/Makefile.am
bin/getzones/Makefile.am
bin/megatron/Makefile.am
bin/megatron/asingle.c
bin/megatron/hqx.c
bin/megatron/nad.h
bin/nbp/Makefile.am
bin/pap/Makefile.am
bin/psorder/Makefile.am
config/Makefile.am
etc/afpd/Makefile.am
etc/papd/queries.c
etc/uams/uams_pam.c
etc/uams/uams_passwd.c
include/atalk/uam.h
macros/config-checks.m4
man/man8/afpd.8.tmpl
sys/solaris/Makefile.kernel.in

index c319b4339c66d3137006a51e3d17e1d104ea925b..1bfc6ca0de2920cdf17b69faa6689036e6a65c76 100644 (file)
@@ -1,5 +1,7 @@
 # Makefile.am for bin/adv1tov2/
 
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys
+
 bin_PROGRAMS = adv1tov2
 
 adv1tov2_SOURCES = adv1tov2.c
index 1ae6025a233293432539e8c69c3a354c5daa3a43..d3e487e9ec93896452fc3e57e9ec64f1c90a2134 100644 (file)
@@ -1,5 +1,7 @@
 # Makefile.am for bin/aecho/
 
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys
+
 bin_PROGRAMS = aecho
 
 aecho_SOURCES = aecho.c
index 8760d9e322a2283896445b24a5cd317139bdecaf..82bc48ccab2156a6b651855819f78073d8b76459 100644 (file)
@@ -1,5 +1,7 @@
 # Makefile.am for bin/afile/
 
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys
+
 bin_PROGRAMS = afile achfile
 bin_SCRIPTS = acleandir.rc
 
index df25b70a767b20bbd1a9f92e6ec01591e93d7bc1..e99d41f79cd8df4b9099b65da504fe5a3c40be70 100644 (file)
@@ -1,8 +1,8 @@
 # Makefile.am for bin/getzones/
 
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys
+
 bin_PROGRAMS = getzones
 
 getzones_SOURCES = getzones.c
 getzones_LDADD = $(top_builddir)/libatalk/libatalk.la
-
-CFLAGS = @CFLAGS@ -I$(top_srcdir)/include -I$(top_srcdir)/sys
index 275b42374632a426a62799b329e437785c6b59d2..1e1ef76233b801879bc85ce9e1a4d33ed5dcd09a 100644 (file)
@@ -1,5 +1,7 @@
 # Makefile.am for bin/megatron/
 
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys
+
 bin_PROGRAMS = megatron
 
 megatron_SOURCES = asingle.c hqx.c macbin.c megatron.c nad.c updcrc.c
index d9e728053d1f40d34ed4b1eec042a7c85801a717..53414b6831a4ff5718992cfe2aa223be0df31b1a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: asingle.c,v 1.8 2002-02-16 17:12:53 srittau Exp $
+ * $Id: asingle.c,v 1.8.6.1 2003-09-03 20:40:50 didg Exp $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -131,7 +131,7 @@ int single_header_read( fh, version )
     u_short            num_entries;
     int                        n;
     int                        readlen;
-    int                        date_entry;
+    int                        date_entry = 0;
     off_t              pos;
 
 /*
@@ -180,17 +180,11 @@ int single_header_read( fh, version )
  */
 
     if ( version == 1 ) {
-       if ( single.entry[ ADEID_FILEI ].ade_len > 0 ) {
+       if ( single.entry[ ADEID_FILEI ].ade_len > 0 )
            date_entry = ADEID_FILEI;
-       } else {
-           date_entry = 0;
-       }
     } else if ( version == 2 ) {
-       if ( single.entry[ ADEID_FILEDATESI ].ade_len > 0 ) {
+       if ( single.entry[ ADEID_FILEDATESI ].ade_len > 0 )
            date_entry = ADEID_FILEDATESI;
-       } else {
-           date_entry = 0;
-       }
     }
 #if DEBUG
     fprintf( stderr, "date_entry = %d\n", date_entry );
index 40187bc243f858029c9c1b35eaff93278ec1aa4b..ebc98d55725f2098356eb625dce6b68e404e946e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: hqx.c,v 1.12 2002-04-29 01:52:49 morgana Exp $
+ * $Id: hqx.c,v 1.12.4.1 2003-09-03 20:40:50 didg Exp $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -28,6 +28,7 @@
 #include <netatalk/endian.h>
 
 #include "megatron.h"
+#include "nad.h"
 #include "hqx.h"
 
 #define HEXOUTPUT      0
index 0e0332dfc99cf771bfe9c5e84cce8db50347cd45..335716be2a8ace176070ee197ea9b47b9ae48fe9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: nad.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ * $Id: nad.h,v 1.2.10.1 2003-09-03 20:40:50 didg Exp $
  */
 
 #ifndef _NAD_H
@@ -15,4 +15,6 @@ int nad_read(int fork, char *forkbuf, int bufc);
 int nad_write(int fork, char *forkbuf, int bufc);
 int nad_close(int status);
 
+void select_charset(int options);
+
 #endif /* _NAD_H */
index 1f82c33087e1c42fe0bf242670ddf2a710cec8f8..c369c1e101bbe9b3fbb1fc0bd778ac9cbe109485 100644 (file)
@@ -1,5 +1,7 @@
 # Makefile.am for bin/nbp/
 
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys
+
 bin_PROGRAMS = nbplkup nbprgstr nbpunrgstr
 
 nbplkup_SOURCES = nbplkup.c
index 671461430eee14877ac8d8ec64d94b1d013fbb3f..344cf72e7a8ad1fb08a997bf30cf378549b37dcd 100644 (file)
@@ -1,5 +1,7 @@
 # Makefile.am for bin/pap/
 
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys
+
 bin_PROGRAMS = pap papstatus
 
 pap_SOURCES = pap.c
index 84b8fb42ee9b59589598c57dcef06ef9b1102948..b54fa36328610da11fcba0e2683344e60549549e 100644 (file)
@@ -1,5 +1,7 @@
 # Makefile.am for bin/psorder
 
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys
+
 bin_PROGRAMS = psorder
 
 psorder_SOURCES = psorder.c pa.c
index c12cc92d03095855db951766087123d56bc0fc9a..8f898a04ee0301bbefa3f981aebbd185a0a85be5 100644 (file)
@@ -51,9 +51,12 @@ pamdir = @PAMDIR@/etc/pam.d
 
 install-data-local: install-config-files $(PAMFILES)
        $(mkinstalldirs) $(DESTDIR)$(pamdir)
-       for f in $(PAMFILES); do                                        \
-               $(INSTALL_DATA) $$f $(DESTDIR)$(pamdir)/netatalk || echo "WARNING: Can't install PAM files";            \
-       done
+       if test "x$(OVERWRITE_CONFIG)" = "xyes" -o ! -f $(DESTDIR)$(pamdir)/netatalk; then \
+           echo "$(INSTALL_DATA) $$f $(DESTDIR)$(pamdir)/netatalk"; \
+           $(INSTALL_DATA) netatalk.pamd $(DESTDIR)$(pamdir)/netatalk || echo "WARNING: Can't install PAM files";              \
+       else \
+           echo "not overwriting $(DESTDIR)$(pamdir)/netatalk"; \
+       fi; 
 
 else
 
index 4e8efd54105e202117bb25dff5e7a806ce2935d2..01b6c2e2b74037bd24418e34eec2804f4693a5bb 100644 (file)
@@ -31,4 +31,5 @@ CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/sys \
         -D_PATH_AFPDUAMPATH=\"$(UAMS_PATH)/\" \
         -D_PATH_AFPDNLSPATH=\"$(nlsdir)/\" \
         -DAFPD_MTAB_FILE=\"$(pkgconfdir)/afpd.mtab\" \
-        -DAPPLCNAME
+        -DAPPLCNAME \
+        -DSERVERTEXT=\"$(SERVERTEXT)/\"
index 63bc56fad34b9fb543cf3fa537f1b70dbb1beecc..e7586d5b44f7c8deb1f942034146356166fe3e50 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: queries.c,v 1.16 2003-02-17 01:35:18 srittau Exp $
+ * $Id: queries.c,v 1.16.2.1 2003-09-03 20:40:50 didg Exp $
  *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -255,7 +255,7 @@ int gq_balance( out )
  * Handler for RBISpoolerID
  */
 
-static const char *spoolerid = "(PAPD Spooler) " VERSION "\n";
+static const char *spoolerid = "(PAPD Spooler) 1.0 (" VERSION ")\n";
 
 int gq_rbispoolerid( out )
     struct papfile     *out;
@@ -673,7 +673,7 @@ int cq_listq( in, out )
  */
 
 static struct uam_obj *papd_uam = NULL;
-/*static const char *rbiloginok = "0\r";*/
+static const char *rbiloginok = "0\r";
 static const char *rbiloginbad = "-1\r";
 static const char *rbiloginerrstr = "%%[Error: SecurityError; \
 SecurityViolation: Unknown user, incorrect password or log on is \
@@ -685,7 +685,7 @@ int cq_rbilogin( in, out )
 {
     char               *start, *stop, *p, *begin;
     int                        linelength, crlflength;
-    char               username[9] = "\0";
+    char               username[UAM_USERNAMELEN + 1] = "\0";
     struct papd_comment        *comment = compeek();
     char               uamtype[20] = "\0";
 
@@ -718,6 +718,8 @@ int cq_rbilogin( in, out )
            } else {
                 if ( (papd_uam->u.uam_printer(p,stop,username,out)) == 0 ) {
                     lp_person( username );
+                   append(out, rbiloginok, strlen( rbiloginok ));
+                   LOG(log_info, logtype_papd, "RBILogin: Logged in '%s'", username);
                 } else {
                     append(out, rbiloginbad, strlen( rbiloginbad));
                     append(out, rbiloginerrstr, strlen(rbiloginerrstr));
index 25b86753796e0bcec0ca9e19d60d72d211bc21f7..5e2ba62608e6c30d13cddf5f4f694009698e4d08 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: uams_pam.c,v 1.15 2003-01-08 22:16:25 didg Exp $
+ * $Id: uams_pam.c,v 1.15.2.1 2003-09-03 20:40:50 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) 
@@ -41,6 +41,11 @@ char *strchr (), *strrchr ();
 
 #define PASSWDLEN 8
 
+#ifndef MIN
+#define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif /* MIN */
+
+
 /* Static variables used to communicate between the conversation function
  * and the server_login function
  */
@@ -331,9 +336,16 @@ int pam_printer(start, stop, username, out)
     char       *data, *p, *q;
     char       password[PASSWDLEN + 1] = "\0";
     static const char *loginok = "0\r";
+    struct passwd *pwd;
+
+    data = (char *)malloc(stop - start + 2);
+    if (!data) {
+       LOG(log_info, logtype_uams,"Bad Login ClearTxtUAM: malloc");
+       return(-1);
+    }
 
-    data = (char *)malloc(stop - start + 1);
     strncpy(data, start, stop - start + 1);
+    data[stop - start + 2] = 0;
 
     /* We are looking for the following format in data:
      * (username) (password)
@@ -348,25 +360,38 @@ int pam_printer(start, stop, username, out)
        return(-1);
     }
     p++;
-    if ((q = strstr(data, ") (" )) == NULL) {
+    if ((q = strstr(p, ") (" )) == NULL) {
        LOG(log_info, logtype_uams,"Bad Login ClearTxtUAM: username not found in string");
        free(data);
        return(-1);
     }
-    strncpy(username, p, q - p);
+    strncpy(username, p, MIN(UAM_USERNAMELEN, q - p) );
+    username[ UAM_USERNAMELEN +1] = '\0';
 
     /* Parse input for password in next () */
     p = q + 3;
-    if ((q = strrchr(data, ')' )) == NULL) {
+    if ((q = strrchr(p, ')' )) == NULL) {
        LOG(log_info, logtype_uams,"Bad Login ClearTxtUAM: password not found in string");
        free(data);
        return(-1);
     }
-    strncpy(password, p, q - p);
+    strncpy(password, p, MIN(PASSWDLEN, (q - p)) );
+    password[ PASSWDLEN + 1] = '\0';
 
     /* Done copying username and password, clean up */
     free(data);
 
+    if (( pwd = uam_getname(username, strlen(username))) == NULL ) {
+        LOG(log_info, logtype_uams, "Bad Login ClearTxtUAM: ( %s ) not found ",
+            username);
+        return(-1);
+    }
+
+    if (uam_checkuser(pwd) < 0) {
+        /* syslog of error happens in uam_checkuser */
+        return(-1);
+    }
+
     PAM_username = username;
     PAM_password = password;
 
index 027d6c856433f8979dd75cf36c05dee32ee112c9..fc0052f473062f37d23b439b813d3fefa2357463 100644 (file)
@@ -1,13 +1,15 @@
 /*
- * $Id: uams_passwd.c,v 1.19 2002-10-17 18:01:55 didg Exp $
+ * $Id: uams_passwd.c,v 1.19.2.1 2003-09-03 20:40:50 didg 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.
  */
 
+#define _XOPEN_SOURCE /* for crypt() */
+
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
 #endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
@@ -50,6 +52,11 @@ char *strchr (), *strrchr ();
 
 #define PASSWDLEN 8
 
+#ifndef MIN
+#define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif /* MIN */
+
+
 #ifdef TRU64
 #include <sia.h>
 #include <siad.h>
@@ -258,8 +265,13 @@ struct papfile     *out;
     static const char *loginok = "0\r";
     int ulen;
 
-    data = (char *)malloc(stop - start + 1);
+    data = (char *)malloc(stop - start + 2);
+    if (!data) {
+       LOG(log_info, logtype_uams,"Bad Login ClearTxtUAM: malloc");
+       return(-1);
+    }
     strncpy(data, start, stop - start + 1);
+    data[stop - start + 2] = 0;
 
     /* We are looking for the following format in data:
      * (username) (password)
@@ -279,7 +291,9 @@ struct papfile      *out;
         free(data);
         return(-1);
     }
-    strncpy(username, p, q - p);
+    strncpy(username, p, MIN( UAM_USERNAMELEN, (q - p)) );
+    username[ UAM_USERNAMELEN+1] = '\0';
+
 
     /* Parse input for password in next () */
     p = q + 3;
@@ -288,7 +302,9 @@ struct papfile      *out;
         free(data);
         return(-1);
     }
-    strncpy(password, p, q - p);
+    strncpy(password, p, MIN(PASSWDLEN, q - p) );
+    password[ PASSWDLEN+1] = '\0';
+
 
     /* Done copying username and password, clean up */
     free(data);
index 29bb542f371fe98a0a695f4dff1b31b5287fea35..948613a8da5ee01fc9250d951b3216bc0cb2ccf0 100644 (file)
@@ -49,6 +49,9 @@
 #define UAM_PASSWD_MAXFAIL      (1 << 2) /* not implemented yet. */
 #define UAM_PASSWD_EXPIRETIME   (1 << 3) /* not implemented yet. */
 
+/* max lenght of username  */
+#define UAM_USERNAMELEN        255
+
 /* i'm doing things this way because os x server's dynamic linker
  * support is braindead. it also allows me to do a little versioning. */
 struct uam_export {
index 47d063a3ce95dfd1b07458323fc36e3f6c844d61..fe399d7615ac7d126546c9d4e745f4d5cda09b76 100644 (file)
@@ -1,4 +1,4 @@
-dnl $Id: config-checks.m4,v 1.3 2002-04-29 06:23:58 morgana Exp $
+dnl $Id: config-checks.m4,v 1.3.4.1 2003-09-03 20:40:51 didg Exp $
 dnl Autoconf macro to set the configuration directories.
 
 AC_DEFUN([NETATALK_CONFIG_DIRS], [
@@ -14,10 +14,10 @@ AC_DEFUN([NETATALK_CONFIG_DIRS], [
                ]
        )
 
-       NLSDIR="${PKGCONFDIR}/nls"
+       NLSDIR="${datadir}/netatalk/nls"
 
        AC_ARG_WITH(nls-dir,
-               [  --with-nls-dir=PATH     path to NLS files [PKGCONF/nls]],
+               [  --with-nls-dir=PATH     path to NLS files [DATA/netatalk/nls]],
                [
                        if test "x$withval" != "x"; then
                                NLSDIR="$withval"
@@ -30,11 +30,10 @@ AC_DEFUN([NETATALK_CONFIG_DIRS], [
        AC_ARG_WITH(message-dir,
                [  --with-message-dir=PATH path to server message files [PKGCONF/msg]],
                [
-                       if test "x$withval" != "x"; then
+                       if test x"$withval" = x"no";  then 
+                               AC_MSG_WARN([*** message-dir is mandatory and cannot be disabled, using default ***])
+                       elif test "x$withval" != "x" && test x"$withval" != x"yes"; then
                                SERVERTEXT="$withval"
-                               cat >> confdefs.h <<EOF
-#define SERVERTEXT "$withval"
-EOF
                        fi
                ]
        )
index 8fb097df4224b6111449fa392a0d4e1ac2e5f9f1..a17e1fa8c0ae959074cf9b8e5e5eb29c42834d8a 100644 (file)
@@ -3,9 +3,9 @@
 .SH NAME
 afpd \- AppleTalk Filing Protocol daemon
 .SH SYNOPSIS
-.B :SBINDIR:/afpd
+.B afpd
 [
-.B -d
+.B -duptDTvI
 ]
 [
 .B -f
@@ -16,9 +16,6 @@ afpd \- AppleTalk Filing Protocol daemon
 .I systemvolumes
 ]
 [
-.B -u
-]
-[
 .B -n
 .I nbpname
 ]
@@ -31,16 +28,28 @@ afpd \- AppleTalk Filing Protocol daemon
 .I guest
 ]
 [
-.B -G
+.B -P
+.I pidfile
+]
+[
+.B -S
+.I port
+]
+[
+.B -L
+.I message
 ]
 [
-.B -K
+.B -F
+.I config
 ]
 [
-.B -C
+.B -U
+.I uams
 ]
 [
-.B -A
+.B -m
+.I umask
 ]
 .SH DESCRIPTION
 .B afpd
@@ -138,20 +147,71 @@ The default is 5.
 .BI \-g " guest"
 Specifies the name of the guest account.  The default is ``nobody''.
 .TP
-.B \-G
+.BI \-P " pidfile"
+Specifies the file in which
+.B afpd
+stores its process id.
 .TP
-.B \-K
+.B \-p
+Prevents clients from saving their passwords. (Equivalent to
+.I \-nosavepasswd
+in
+.BR afpd.conf .)
 .TP
-.B \-C
+.B \-t
+Allows clients to change their passwords. (Equivalent to
+.I \-setpasswd
+in
+.BR afpd.conf .)
 .TP
-.B \-A
-Causes the server to not offer
-.BR NoUserAuthent ,
-.BR "Kerberos IV" ,
-.BR "Cleartxt Passwrd" ,
-and
-.B AFS Kerberos
-logins, respectively.  The default is to enable all available login methods.
+.B \-D
+Use DDP (AppleTalk) as transport protocol. (Equivalent to
+.I \-ddp
+in
+.BR afpd.cond .)
+.TP
+.B \-T
+Use TCP/IP as transport protocol. (Equivalent to
+.I \-tcp
+in
+.BR afpd.conf .)
+.TP
+.BI \-S " port"
+Specifies the port to register with when doing AFPoverTCP. Defaults to
+.IR 548 .
+(Equivalent to
+.I -port
+in
+.BR afpd.conf .)
+.TP
+.BI \-L " message"
+Specifies the login message that will be sent to clients. (Equivalent to
+.I \-loginmsg
+in
+.BR afpd.conf .)
+.TP
+.BI \-F " config"
+Specifies the configuration file to use. (Defaults to
+.IR :ETCDIR:/afpd.conf .)
+.TP
+.BI \-U " uams"
+Comma-separated list of UAMs to use for the authentication process.
+(Equivalent to
+.I -uamlist
+in
+.BR afpd.conf .)
+.TP
+.B \-I
+Use a platform specific icon. (Equivalent to
+.I \-icon
+in
+.BR afpd.conf .)
+.TP
+.BR \-m " umask"
+Use this umask for the creation of folders in Netatalk.
+.TP
+.B \-v
+Print version information and exit.
 .SH AUTHENTICATION
 .B afpd
 currently understands three User Authentication Methods (UAMs):
index 034a59f35f35359e3066b9ee3a732096c68f43bb..560b6cc03689165c41b7ca3d38b90c8e38cfa944 100644 (file)
@@ -1,7 +1,7 @@
 # Solaris specific defines, passed to subdirectories.
 # To use Sun CC, uncomment the CC and KFLAGS variables.
 #
-# $Id: Makefile.kernel.in,v 1.3 2002-04-08 20:47:25 morgana Exp $
+# $Id: Makefile.kernel.in,v 1.3.4.1 2003-09-03 20:40:51 didg Exp $
 
 
 # uncomment for 64-bit sparc kernel
@@ -18,7 +18,8 @@ LD            = ld
 
 # use gcc
 KCFLAGS                = -D_KERNEL -Wall -Wstrict-prototypes ${KGCCFLAGS} # -mcpu=ultrasparc
-OPTOPTS                = -O
+# optimization has been reported to cause problems, leave it off
+OPTOPTS                = 
 CSHAREDFLAGS   = -fPIC
 LDSHARED       = ${CC}
 LDSHAREDFLAGS  = -shared