]> arthur.barton.de Git - netatalk.git/commitdiff
Warning fixes.
authorsrittau <srittau>
Mon, 10 Dec 2001 20:16:43 +0000 (20:16 +0000)
committersrittau <srittau>
Mon, 10 Dec 2001 20:16:43 +0000 (20:16 +0000)
22 files changed:
etc/afpd/afp_asp.c
etc/afpd/afp_config.c
etc/afpd/afp_dsi.c
etc/afpd/desktop.c
etc/afpd/directory.c
etc/afpd/enumerate.c
etc/afpd/icon.h
etc/afpd/main.c
etc/afpd/messages.c
etc/afpd/parse_mtab.c
etc/afpd/parse_mtab.h
etc/afpd/quota.c
etc/afpd/status.c
etc/afpd/uam.c
etc/atalkd/aep.c
etc/atalkd/config.c
etc/atalkd/main.c
etc/atalkd/multicast.c
etc/atalkd/nbp.c
etc/atalkd/rtmp.c
etc/atalkd/zip.c
libatalk/netddp/netddp_open.c

index e30a051a36afb09902e1742bf4f3ca4a4ecdb005..7c004f0dcc46971d73416d6750fd23593e15b57c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: afp_asp.c,v 1.7 2001-12-03 05:03:38 jmarcus Exp $
+ * $Id: afp_asp.c,v 1.8 2001-12-10 20:16:53 srittau Exp $
  *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
@@ -19,6 +19,7 @@
 #include <string.h>
 #include <signal.h>
 #include <syslog.h>
+#include <errno.h>
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif /* HAVE_SYS_TIME_H */
@@ -59,7 +60,7 @@ static void afp_asp_die(const int sig)
 
     asp_attention(asp, AFPATTN_SHUTDOWN);
     if ( asp_shutdown( asp ) < 0 ) {
-        syslog( LOG_ERR, "afp_die: asp_shutdown: %m" );
+        syslog( LOG_ERR, "afp_die: asp_shutdown: %s", strerror(errno) );
     }
 
     afp_asp_close(child);
@@ -83,7 +84,7 @@ static void afp_asp_timedown()
     it.it_value.tv_sec = 300;
     it.it_value.tv_usec = 0;
     if ( setitimer( ITIMER_REAL, &it, 0 ) < 0 ) {
-        syslog( LOG_ERR, "afp_timedown: setitimer: %m" );
+        syslog( LOG_ERR, "afp_timedown: setitimer: %s", strerror(errno) );
         afp_asp_die(1);
     }
 
@@ -92,7 +93,7 @@ static void afp_asp_timedown()
     sigemptyset( &sv.sa_mask );
     sv.sa_flags = SA_RESTART;
     if ( sigaction( SIGALRM, &sv, 0 ) < 0 ) {
-        syslog( LOG_ERR, "afp_timedown: sigaction: %m" );
+        syslog( LOG_ERR, "afp_timedown: sigaction: %s", strerror(errno) );
         afp_asp_die(1);
     }
 }
@@ -115,7 +116,7 @@ void afp_over_asp(AFPObj *obj)
     sigemptyset( &action.sa_mask );
     action.sa_flags = SA_RESTART;
     if ( sigaction( SIGHUP, &action, 0 ) < 0 ) {
-        syslog( LOG_ERR, "afp_over_asp: sigaction: %m" );
+        syslog( LOG_ERR, "afp_over_asp: sigaction: %s", strerror(errno) );
         afp_asp_die(1);
     }
 
@@ -123,7 +124,7 @@ void afp_over_asp(AFPObj *obj)
     sigemptyset( &action.sa_mask );
     action.sa_flags = SA_RESTART;
     if ( sigaction( SIGTERM, &action, 0 ) < 0 ) {
-        syslog( LOG_ERR, "afp_over_asp: sigaction: %m" );
+        syslog( LOG_ERR, "afp_over_asp: sigaction: %s", strerror(errno) );
         afp_asp_die(1);
     }
 
@@ -150,10 +151,12 @@ void afp_over_asp(AFPObj *obj)
                     if(unlink(addr_filename) == 0) {
                         syslog(LOG_INFO, "removed %s", addr_filename);
                     } else {
-                        syslog(LOG_INFO, "error removing %s: %m", addr_filename);
+                        syslog(LOG_INFO, "error removing %s: %s",
+                               addr_filename, strerror(errno));
                     }
                 } else {
-                    syslog(LOG_INFO, "error stat'ing %s: %m", addr_filename);
+                    syslog(LOG_INFO, "error stat'ing %s: %s",
+                           addr_filename, strerror(errno));
                 }
             }
 
@@ -202,7 +205,7 @@ void afp_over_asp(AFPObj *obj)
             }
 
             if ( asp_cmdreply( asp, reply ) < 0 ) {
-                syslog( LOG_ERR, "asp_cmdreply: %m" );
+                syslog( LOG_ERR, "asp_cmdreply: %s", strerror(errno) );
                 afp_asp_die(1);
             }
             break;
@@ -228,7 +231,7 @@ void afp_over_asp(AFPObj *obj)
                 bprint( asp->data, asp->datalen );
             }
             if ( asp_wrtreply( asp, reply ) < 0 ) {
-                syslog( LOG_ERR, "asp_wrtreply: %m" );
+                syslog( LOG_ERR, "asp_wrtreply: %s", strerror(errno) );
                 afp_asp_die(1);
             }
             break;
index ed8ae9b26106dc97083fff22a02c2d448be0268a..255803360c01a8c51ad7de854fee94fc235cdb4c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: afp_config.c,v 1.8 2001-12-03 05:03:38 jmarcus Exp $
+ * $Id: afp_config.c,v 1.9 2001-12-10 20:16:53 srittau Exp $
  *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved.  See COPYRIGHT.
@@ -11,6 +11,8 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
+#include <errno.h>
 
 /* STDC check */
 #if STDC_HEADERS
@@ -146,7 +148,7 @@ static int asp_start(AFPConfig *config, AFPConfig *configs,
 
     if (!(asp = asp_getsession(config->obj.handle, server_children,
                                config->obj.options.tickleval))) {
-        syslog( LOG_ERR, "main: asp_getsession: %m" );
+        syslog( LOG_ERR, "main: asp_getsession: %s", strerror(errno) );
         exit( 1 );
     }
 
@@ -167,7 +169,7 @@ static int dsi_start(AFPConfig *config, AFPConfig *configs,
 
     if (!(dsi = dsi_getsession(config->obj.handle, server_children,
                                config->obj.options.tickleval))) {
-        syslog( LOG_ERR, "main: dsi_getsession: %m" );
+        syslog( LOG_ERR, "main: dsi_getsession: %s", strerror(errno) );
         exit( 1 );
     }
 
@@ -194,13 +196,13 @@ static AFPConfig *ASPConfigInit(const struct afp_options *options,
         return NULL;
 
     if ((atp = atp_open(ATADDR_ANYPORT, &options->ddpaddr)) == NULL)  {
-        syslog( LOG_ERR, "main: atp_open: %m");
+        syslog( LOG_ERR, "main: atp_open: %s", strerror(errno) );
         free(config);
         return NULL;
     }
 
     if ((asp = asp_init( atp )) == NULL) {
-        syslog( LOG_ERR, "main: asp_init: %m" );
+        syslog( LOG_ERR, "main: asp_init: %s", strerror(errno) );
         atp_close(atp);
         free(config);
         return NULL;
@@ -281,7 +283,7 @@ static AFPConfig *DSIConfigInit(const struct afp_options *options,
 #endif /* USE_SRVLOC */
 
     if ((config = (AFPConfig *) calloc(1, sizeof(AFPConfig))) == NULL) {
-        syslog( LOG_ERR, "DSIConfigInit: malloc(config): %m" );
+        syslog( LOG_ERR, "DSIConfigInit: malloc(config): %s", strerror(errno) );
         return NULL;
     }
 
@@ -289,7 +291,7 @@ static AFPConfig *DSIConfigInit(const struct afp_options *options,
                         options->ipaddr, options->port,
                         options->flags & OPTION_PROXY,
                         options->server_quantum)) == NULL) {
-        syslog( LOG_ERR, "main: dsi_init: %m" );
+        syslog( LOG_ERR, "main: dsi_init: %s", strerror(errno) );
         free(config);
         return NULL;
     }
@@ -381,7 +383,7 @@ static AFPConfig *AFPConfigInit(const struct afp_options *options,
 
     if ((refcount = (unsigned char *)
                     calloc(1, sizeof(unsigned char))) == NULL) {
-        syslog( LOG_ERR, "AFPConfigInit: calloc(refcount): %m" );
+        syslog( LOG_ERR, "AFPConfigInit: calloc(refcount): %s", strerror(errno) );
         return NULL;
     }
 
index b0b148348048ffe4ad6cec3bee699d1d8c294547..6ae44dc6385bfa02245422a4035d51ad4694c46e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: afp_dsi.c,v 1.10 2001-12-03 05:03:38 jmarcus Exp $
+ * $Id: afp_dsi.c,v 1.11 2001-12-10 20:16:53 srittau Exp $
  *
  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
@@ -226,7 +226,7 @@ void afp_over_dsi(AFPObj *obj)
             function = (u_char) dsi->commands[0];
             if (obj->options.flags & OPTION_DEBUG ) {
                 printf("command: %d\n", function);
-                bprint(dsi->commands, dsi->cmdlen);
+                bprint((char *) dsi->commands, dsi->cmdlen);
             }
 
             /* send off an afp command. in a couple cases, we take advantage
@@ -252,7 +252,7 @@ void afp_over_dsi(AFPObj *obj)
 
             if (obj->options.flags & OPTION_DEBUG ) {
                 printf( "reply: %d, %d\n", err, dsi->clientID);
-                bprint(dsi->data, dsi->datalen);
+                bprint((char *) dsi->data, dsi->datalen);
             }
 
             if (!dsi_cmdreply(dsi, err)) {
@@ -265,7 +265,7 @@ void afp_over_dsi(AFPObj *obj)
             function = (u_char) dsi->commands[0];
             if ( obj->options.flags & OPTION_DEBUG ) {
                 printf("(write) command: %d, %d\n", function, dsi->cmdlen);
-                bprint(dsi->commands, dsi->cmdlen);
+                bprint((char *) dsi->commands, dsi->cmdlen);
             }
 
             if ( afp_switch[ function ] != NULL ) {
@@ -282,7 +282,7 @@ void afp_over_dsi(AFPObj *obj)
 
             if (obj->options.flags & OPTION_DEBUG ) {
                 printf( "(write) reply code: %d, %d\n", err, dsi->clientID);
-                bprint(dsi->data, dsi->datalen);
+                bprint((char *) dsi->data, dsi->datalen);
             }
 
             if (!dsi_wrtreply(dsi, err)) {
index 0f114cb594cf8a1423c1a647266aff6c958361a3..c4e1a9187017b83cc5de2186f888bcc48cd8b887 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: desktop.c,v 1.8 2001-12-03 05:03:38 jmarcus Exp $
+ * $Id: desktop.c,v 1.9 2001-12-10 20:16:54 srittau Exp $
  *
  * See COPYRIGHT.
  */
@@ -603,8 +603,8 @@ char *dtfile(const struct vol *vol, u_char creator[], char *ext )
 
 char *mtoupath(const struct vol *vol, char *mpath)
 {
-    static unsigned char        upath[ MAXPATHLEN + 1];
-    unsigned char      *m, *u;
+    static char  upath[ MAXPATHLEN + 1];
+    char       *m, *u;
     int                 i = 0;
 
     if ( *mpath == '\0' ) {
@@ -625,7 +625,7 @@ char *mtoupath(const struct vol *vol, char *mpath)
 #if 1
         if (vol->v_mtoupage && ((*m & 0x80) ||
                                 vol->v_flags & AFPVOL_MAPASCII)) {
-            *u = vol->v_mtoupage->map[*m].value;
+            *u = vol->v_mtoupage->map[(unsigned char) *m].value;
         } else
 #endif /* 1 */
 #if AD_VERSION == AD_VERSION1
@@ -659,9 +659,9 @@ char *mtoupath(const struct vol *vol, char *mpath)
 
 char *utompath(const struct vol *vol, char *upath)
 {
-    static unsigned char mpath[ MAXPATHLEN + 1];
-    unsigned char              *m, *u;
-    int                         h;
+    static char  mpath[ MAXPATHLEN + 1];
+    char        *m, *u;
+    int          h;
 
     /* do the hex conversion */
     u = upath;
@@ -669,9 +669,9 @@ char *utompath(const struct vol *vol, char *upath)
     while ( *u != '\0' ) {
         /* we have a code page */
 #if 1
-        if (vol->v_utompage && ((*u > 0x7F) ||
+        if (vol->v_utompage && ((*u & 0x80) ||
                                 (vol->v_flags & AFPVOL_MAPASCII))) {
-            *m = vol->v_utompage->map[*u].value;
+            *m = vol->v_utompage->map[(unsigned char) *u].value;
         } else
 #endif /* 1 */
             if ( *u == ':' && *(u+1) != '\0' && islxdigit( *(u+1)) &&
index 53d2c76d185f1010b642b4c8aa145d667587196f..777d82390bbfddd4ef64e2cf12c7b7562f212930 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: directory.c,v 1.20 2001-12-03 05:03:38 jmarcus Exp $
+ * $Id: directory.c,v 1.21 2001-12-10 20:16:54 srittau Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -55,6 +55,7 @@ char *strchr (), *strrchr ();
 #include "volume.h"
 #include "fork.h"
 #include "file.h"
+#include "filedir.h"
 #include "globals.h"
 #include "unix.h"
 
index a8b9c0f5b6e681d7be236b6c2e53d015b5e961c2..4789f4d38f531b42e10ded660c67115fe1a5d22a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: enumerate.c,v 1.10 2001-12-03 05:03:38 jmarcus Exp $
+ * $Id: enumerate.c,v 1.11 2001-12-10 20:16:54 srittau Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -32,6 +32,7 @@
 #include "volume.h"
 #include "globals.h"
 #include "file.h"
+#include "filedir.h"
 
 /* check for mtab DID code */
 #ifdef DID_MTAB
index 2cc2dcd51702283971b135965c0b5fbd07e7b0f6..cfaa563454a0b11758752c8ac6260489262ff573 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: icon.h,v 1.3 2001-12-03 05:03:38 jmarcus Exp $
+ * $Id: icon.h,v 1.4 2001-12-10 20:16:54 srittau Exp $
  *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -82,7 +82,7 @@ const unsigned char apple_tcp_icon[] = { /* default asip icon */
 };
 
 #if defined( ultrix )
-const u_char   icon[] = {      /* declogo */
+const unsigned char icon[] = { /* declogo */
     0x0, 0x80, 0x0, 0x0, 0x1, 0xC0, 0x0, 0x0,
     0x3, 0xE0, 0x0, 0x0, 0x7, 0xF0, 0x0, 0x0,
     0xF, 0xB0, 0x0, 0x0, 0x13, 0x6C, 0x0, 0x0,
@@ -119,7 +119,7 @@ const u_char        icon[] = {      /* declogo */
 
 #else
 #if defined( vax )
-const u_char   icon[] = {      /* daemon */
+const unsigned char icon[] = { /* daemon */
     0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x2, 0x0,
     0x1, 0x80, 0x3, 0x0, 0x2, 0x80, 0x2, 0x80,
     0x2, 0x80, 0x2, 0x80, 0x4, 0x80, 0x2, 0x40,
@@ -156,7 +156,7 @@ const u_char        icon[] = {      /* daemon */
 
 #else
 #if defined( sun )
-const u_char   icon[] = {      /* sunlogo */
+const unsigned char icon[] = { /* sunlogo */
     0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x80, 0x0,
     0x0, 0x2, 0x40, 0x0, 0x0, 0x2, 0x20, 0x0,
     0x0, 0x9, 0x10, 0x0, 0x0, 0x4, 0x88, 0x0,
@@ -193,7 +193,7 @@ const u_char        icon[] = {      /* sunlogo */
 
 #else
 #if defined( _IBMR2 )
-const u_char   icon[] = {      /* hagar */
+const unsigned char icon[] = { /* hagar */
     0x0, 0x0, 0x0, 0x0, 0x18, 0x0, 0x0, 0x18,
     0x24, 0x0, 0x0, 0x24, 0x44, 0x3, 0xC0, 0x22,
     0x44, 0xC, 0x30, 0x22, 0x42, 0x30, 0xC, 0x42,
@@ -229,7 +229,7 @@ const u_char        icon[] = {      /* hagar */
 };
 
 #else
-const u_char   icon[] = {      /* globe */
+const unsigned char icon[] = { /* globe */
     0x0, 0x0, 0x0, 0x0, 0x0, 0xF, 0xF0, 0x0,
     0x0, 0x30, 0xC, 0x0, 0x0, 0xC0, 0x3, 0x0,
     0x1, 0x80, 0x3, 0x80, 0x3, 0xE2, 0x1F, 0xC0,
index 6ed33dfbcafe2039d1fd3a3940fed86ebbea13aa..000f6fe56f70d91a1c8a5990c39bd04e6338a4a2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: main.c,v 1.13 2001-12-03 05:03:38 jmarcus Exp $
+ * $Id: main.c,v 1.14 2001-12-10 20:16:54 srittau Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -63,6 +63,11 @@ static char **argv = NULL;
 
 unsigned char  nologin = 0;
 
+#ifdef DID_MTAB
+/* global mount table; afpd_st_cnid uses this to lookup the right entry.  */
+static struct afpd_mount_table *afpd_mount_table = NULL;
+#endif /* DID_MTAB */
+
 struct afp_options default_options;
 static AFPConfig *configs;
 static server_child *server_children;
index 1f0766d57e109be85b85422711306e63b08bcc84..5b1a338750d878f5e307eefde03689820bc87a25 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: messages.c,v 1.10 2001-12-03 05:03:38 jmarcus Exp $
+ * $Id: messages.c,v 1.11 2001-12-10 20:16:54 srittau Exp $
  *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved.  See COPYRIGHT.
@@ -40,7 +40,7 @@ void readmessage(void)
     uid_t euid;
 
     i=0;
-    // Construct file name SERVERTEXT/message.[pid]
+    /* Construct file name SERVERTEXT/message.[pid] */
     filename=malloc(sizeof(SERVERTEXT)+15);
     sprintf(filename, "%s/message.%d", SERVERTEXT, getpid());
 
index 74e318bd23bd76bad33dabeeb0df735b676995e6..6a8920f29c39d1390046e94116ce85c878a746a1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: parse_mtab.c,v 1.5 2001-12-03 05:03:38 jmarcus Exp $
+ * $Id: parse_mtab.c,v 1.6 2001-12-10 20:16:54 srittau Exp $
  *
  * afpd_mtab_parse & support.  -- rgr, 9-Apr-01.
  */
@@ -40,6 +40,9 @@ char *strchr (), *strrchr ();
          (lval) = malloc(1+strlen(str)), strcpy((lval), (str))
 #endif /* COPY_STRING */
 
+/* global mount table; afpd_st_cnid uses this to lookup the right entry.  */
+static struct afpd_mount_table *afpd_mount_table;
+       
 static int
 ceil_log_2 __P((int n))
 /* Return the number of bits required to represent n.  Only works for
index 27c3b0082ab26c4932f93db0ba49c3e710fb4649..ff57f68e76960a4db72fb03e9d929038eb9cb816 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: parse_mtab.h,v 1.4 2001-12-03 05:03:38 jmarcus Exp $
+ * $Id: parse_mtab.h,v 1.5 2001-12-10 20:16:54 srittau Exp $
  *
  * header for afpd_mtab_parse, afpd_st_cnid
  */
@@ -31,9 +31,6 @@ struct afpd_mount_table {
                           entries may be null */
 };
 
-/* global mount table; afpd_st_cnid uses this to lookup the right entry.  */
-static struct afpd_mount_table *afpd_mount_table = NULL;
-
 extern
     unsigned int
     afpd_st_cnid __P((struct stat *st));
index d51b4bc317f980c34664e35c33e5ac38a4127a05..714dee7152943e79fe3944afa5044a63a5bda44a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: quota.c,v 1.12 2001-12-03 05:03:38 jmarcus Exp $
+ * $Id: quota.c,v 1.13 2001-12-10 20:16:54 srittau Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -11,6 +11,8 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
+#include <errno.h>
 
 /* STDC check */
 #if STDC_HEADERS
@@ -330,7 +332,7 @@ const u_int32_t     bsize;
         }
 
         if (( vol->v_gvs = (char *)malloc( strlen( p ) + 1 )) == NULL ) {
-            syslog( LOG_ERR, "getquota: malloc: %m" );
+            syslog( LOG_ERR, "getquota: malloc: %s", strerror(errno) );
             return AFPERR_MISC;
         }
         strcpy( vol->v_gvs, p );
@@ -355,7 +357,7 @@ struct dqblk        *dqblk;
     }
 #else /* ultrix */
     if ( gettimeofday( &tv, 0 ) < 0 ) {
-        syslog( LOG_ERR, "overquota: gettimeofday: %m" );
+        syslog( LOG_ERR, "overquota: gettimeofday: %s", strerror(errno) );
         return( AFPERR_PARAM );
     }
     if ( !dqblk->dqb_btimelimit || dqblk->dqb_btimelimit > tv.tv_sec ) {
index eb23c739404e733dba841163a251d1d8e47bb0ed..07ef932bc1f74561db887e8531342e4a7242a514 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: status.c,v 1.5 2001-12-03 05:03:38 jmarcus Exp $
+ * $Id: status.c,v 1.6 2001-12-10 20:16:54 srittau Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -251,7 +251,7 @@ static int status_netaddress(char *data, const int servoffset,
 }
 
 /* returns actual offset to signature */
-static void status_icon(char *data, const char *icondata,
+static void status_icon(char *data, const unsigned char *icondata,
                         const int iconlen, const int sigoffset)
 {
     char                *start = data;
index e0bd33f550812df3e6b27d42d1847e470a567133..682fa885f8d5351369b93b44ccefa6b2328a5127 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: uam.c,v 1.16 2001-12-03 05:03:38 jmarcus Exp $
+ * $Id: uam.c,v 1.17 2001-12-10 20:16:54 srittau Exp $
  *
  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved.  See COPYRIGHT.
@@ -36,14 +36,14 @@ char *strchr (), *strrchr ();
 #include <ctype.h>
 #include <syslog.h>
 #include <sys/param.h>
+#include <sys/socket.h>
 #include <sys/time.h>
 #ifdef HAVE_DLFCN_H
 #include <dlfcn.h>
 #endif /* HAVE_DLFCN_H */
 
-#ifdef SHADOWPW
-#include <shadow.h>
-#endif /* SHADOWPW */
+#include <netinet/in.h>
+#include <arpa/inet.h>
 
 #include <netatalk/endian.h>
 #include <atalk/asp.h>
@@ -58,7 +58,6 @@ char *strchr (), *strrchr ();
 
 #ifdef TRU64
 #include <netdb.h>
-#include <arpa/inet.h>
 #endif /* TRU64 */
 
 /* --- server uam functions -- */
index d3fff8f5d1f89eaf06713fa42a4254f20bbac7fa..1b681548fbd455c9887fabcbe9a00f3327e2d434 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: aep.c,v 1.4 2001-06-25 20:13:45 rufustfirefly Exp $
+ * $Id: aep.c,v 1.5 2001-12-10 20:16:54 srittau Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
@@ -9,6 +9,9 @@
 #include "config.h"
 #endif /* HAVE_CONFIG_H */
 
+#include <string.h>
+#include <errno.h>
+
 #include <sys/syslog.h>
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -36,7 +39,7 @@ int aep_packet( ap, from, data, len )
     *( data + 1 ) = AEPOP_REPLY;
     if ( sendto( ap->ap_fd, data, len, 0, (struct sockaddr *)from,
            sizeof( struct sockaddr_at )) < 0 ) {
-       syslog( LOG_ERR, "aep sendto: %m" );
+       syslog( LOG_ERR, "aep sendto: %s", strerror(errno) );
        return 1;
     }
 
index aa706e42f858ce9b179a7a889141d1bc3faf5c76..d5588bcbbd376ae48e1914cf14f75bda1c52cdfc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: config.c,v 1.6 2001-09-06 20:00:59 rufustfirefly Exp $
+ * $Id: config.c,v 1.7 2001-12-10 20:16:55 srittau Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
@@ -26,6 +26,9 @@
 #include <atalk/util.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <ctype.h>
 
 /* STDC check */
 #if STDC_HEADERS
@@ -42,11 +45,9 @@ char *strchr (), *strrchr ();
 #endif /* ! HAVE_MEMCPY */
 #endif /* STDC_HEADERS */
 
-#include <ctype.h>
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
 #endif /* HAVE_FCNTL_H */
-#include <errno.h>
 
 #ifdef __svr4__
 #include <sys/sockio.h>
@@ -160,16 +161,16 @@ int writeconf( cf )
        sprintf( newpath, "%.*s/%s", (int)(p - path), path, _PATH_ATALKDTMP );
     }
     if (( fd = open( newpath, O_WRONLY|O_CREAT|O_TRUNC, mode )) < 0 ) {
-       syslog( LOG_ERR, "%s: %m", newpath );
+       syslog( LOG_ERR, "%s: %s", newpath, strerror(errno) );
        return( -1 );
     }
     if (( newconf = fdopen( fd, "w" )) == NULL ) {
-       syslog( LOG_ERR, "fdreopen %s: %m", newpath );
+       syslog( LOG_ERR, "fdreopen %s: %s", newpath, strerror(errno) );
        return( -1 );
     }
 
     if (( conf = fopen( path, "r" )) == NULL && cf ) {
-       syslog( LOG_ERR, "%s: %m", path );
+       syslog( LOG_ERR, "%s: %s", path, strerror(errno) );
        return( -1 );
     }
 
@@ -178,7 +179,7 @@ int writeconf( cf )
     while ( conf == NULL || fgets( line, sizeof( line ), conf ) != NULL ) {
        if ( conf != NULL && ( argv = parseline( line )) == NULL ) {
            if ( fputs( line, newconf ) == EOF ) {
-               syslog( LOG_ERR, "fputs: %m" );
+               syslog( LOG_ERR, "fputs: %s", strerror(errno) );
                return( -1 );
            }
            continue;
@@ -224,7 +225,7 @@ int writeconf( cf )
     fclose( newconf );
 
     if ( rename( newpath, path ) < 0 ) {
-       syslog( LOG_ERR, "rename %s to %s: %m", newpath, path );
+       syslog( LOG_ERR, "rename %s to %s: %s", newpath, path, strerror(errno) );
        return( -1 );
     }
     return( 0 );
index 4683c1ae26cf78730df60a4df9e25b98c54e937b..7fe4f45b843ef1a52763fb24492ff46129c99010 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: main.c,v 1.10 2001-09-12 19:13:17 uhees Exp $
+ * $Id: main.c,v 1.11 2001-12-10 20:16:55 srittau Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
@@ -147,9 +147,9 @@ static void atalkd_exit(const int i)
        continue;
 #endif /* SIOCDIFADDR != SIOCATALKDIFADDR */
 #endif /* SIOCATALKIFADDR */
-      syslog( LOG_ERR, "difaddr(%u.%u): %m", 
+      syslog( LOG_ERR, "difaddr(%u.%u): %s", 
              ntohs(iface->i_addr.sat_addr.s_net), 
-             iface->i_addr.sat_addr.s_node);
+             iface->i_addr.sat_addr.s_node, strerror(errno));
     }
   }
 #endif /* SOPCDOFADDR */
@@ -196,13 +196,13 @@ as_timer()
            if ( iface->i_time < 3 ) {
                if ( iface->i_flags & IFACE_PHASE1 ) {
                  if (rtmp_request( iface ) < 0) {
-                     syslog(LOG_ERR, "rtmp_request: %m");
+                     syslog(LOG_ERR, "rtmp_request: %s", strerror(errno));
                      atalkd_exit(1);
                  }
                    newrtmpdata = 1;
                } else {
                  if (zip_getnetinfo( iface ) < 0) {
-                   syslog(LOG_ERR, "zip_getnetinfo: %m");
+                   syslog(LOG_ERR, "zip_getnetinfo: %s", strerror(errno));
                    atalkd_exit(1);
                  }
                  sentzipq = 1;
@@ -232,7 +232,7 @@ as_timer()
                        for ( zt = iface->i_czt; zt; zt = zt->zt_next ) {
                            if (addzone( iface->i_rt, zt->zt_len, 
                                         zt->zt_name) < 0) {
-                             syslog(LOG_ERR, "addzone: %m");
+                             syslog(LOG_ERR, "addzone: %s", strerror(errno));
                              atalkd_exit(1);
                            }
                        }
@@ -257,9 +257,10 @@ as_timer()
 
                        if ( looproute( iface, RTMP_ADD )) { /* -1 or 1 */
                            syslog( LOG_ERR,
-                                   "as_timer: can't route %u.%u to loop: %m",
+                                   "as_timer: can't route %u.%u to loop: %s",
                                    ntohs( iface->i_addr.sat_addr.s_net ),
-                                   iface->i_addr.sat_addr.s_node );
+                                   iface->i_addr.sat_addr.s_node,
+                                   strerror(errno) );
                            atalkd_exit( 1 );
                        }
                        if ( iface == ciface ) {
@@ -284,9 +285,10 @@ as_timer()
                    }
                    if ( looproute( iface, RTMP_ADD ) ) { /* -1 or 1 */
                        syslog( LOG_ERR,
-                               "as_timer: can't route %u.%u to loopback: %m",
+                               "as_timer: can't route %u.%u to loopback: %s",
                                ntohs( iface->i_addr.sat_addr.s_net ),
-                               iface->i_addr.sat_addr.s_node );
+                               iface->i_addr.sat_addr.s_node,
+                               strerror(errno) );
                        atalkd_exit( 1 );
                    }
 
@@ -329,7 +331,7 @@ as_timer()
                    } else {
                        rtmp->rt_hops = RTMPHOPS_POISON;
                        if ((cc = rtmp_replace( rtmp )) < 0) {
-                         syslog(LOG_ERR, "rtmp_replace: %m");
+                         syslog(LOG_ERR, "rtmp_replace: %s", strerror(errno));
                          atalkd_exit(1);
                        }
                        if (cc) {
@@ -425,7 +427,7 @@ as_timer()
                        } else {
                            rtmp->rt_hops = RTMPHOPS_POISON;
                            if ((cc = rtmp_replace( rtmp )) < 0) {
-                               syslog(LOG_ERR, "rtmp_replace: %m");
+                               syslog(LOG_ERR, "rtmp_replace: %s", strerror(errno));
                                atalkd_exit(1);
                            }
                            if (cc)
@@ -453,7 +455,7 @@ as_timer()
                        if ( sendto( zap->ap_fd, packet, cc, 0,
                                (struct sockaddr *)&sat,
                                sizeof( struct sockaddr_at )) < 0 ) {
-                           syslog( LOG_ERR, "as_timer sendto: %m" );
+                           syslog( LOG_ERR, "as_timer sendto: %s", strerror(errno) );
                        }
                        sentzipq = 1;
 
@@ -502,7 +504,7 @@ as_timer()
 
                if ( sendto( zap->ap_fd, packet, cc, 0, (struct sockaddr *)&sat,
                        sizeof( struct sockaddr_at )) < 0 ) {
-                   syslog( LOG_ERR, "as_timer sendto: %m" );
+                   syslog( LOG_ERR, "as_timer sendto: %s", strerror(errno) );
                }
            }
        }
@@ -581,10 +583,11 @@ as_timer()
                        if ( sendto( rap->ap_fd, packet, data - packet, 0,
                                (struct sockaddr *)&sat,
                                sizeof( struct sockaddr_at )) < 0 ) {
-                           syslog( LOG_ERR, "as_timer sendto %u.%u (%u): %m",
+                           syslog( LOG_ERR, "as_timer sendto %u.%u (%u): %s",
                                    ntohs( sat.sat_addr.s_net ),
                                    sat.sat_addr.s_node,
-                                   ntohs( iface->i_rt->rt_firstnet ));
+                                   ntohs( iface->i_rt->rt_firstnet ),
+                                   strerror(errno) );
                        }
 
                        if ( iface->i_flags & IFACE_PHASE2 ) {
@@ -620,10 +623,11 @@ as_timer()
                if ( sendto( rap->ap_fd, packet, data - packet, 0,
                        (struct sockaddr *)&sat,
                        sizeof( struct sockaddr_at )) < 0 ) {
-                   syslog( LOG_ERR, "as_timer sendto %u.%u (%u): %m",
+                   syslog( LOG_ERR, "as_timer sendto %u.%u (%u): %s",
                            ntohs( sat.sat_addr.s_net ),
                            sat.sat_addr.s_node,
-                           ntohs( iface->i_rt->rt_firstnet ));
+                           ntohs( iface->i_rt->rt_firstnet ),
+                           strerror(errno) );
                }
            }
        }
@@ -718,7 +722,7 @@ as_debug()
     FILE               *rtmpdebug;
 
     if (( rtmpdebug = fopen( _PATH_ATALKDEBUG, "w" )) == NULL ) {
-       syslog( LOG_ERR, "rtmp: %m" );
+       syslog( LOG_ERR, "rtmp: %s", strerror(errno) );
     }
 
     for ( iface = interfaces; iface; iface = iface->i_next ) {
@@ -823,18 +827,20 @@ as_down()
            for ( rt = gate->g_rt; rt; rt = rt->rt_next ) {
                if ( rt->rt_iprev ) {
                    if ( gateroute( RTMP_DEL, rt ) < 0 ) {
-                       syslog( LOG_ERR, "as_down remove %u-%u failed: %m",
+                       syslog( LOG_ERR, "as_down remove %u-%u failed: %s",
                                ntohs( rt->rt_firstnet ),
-                               ntohs( rt->rt_lastnet ));
+                               ntohs( rt->rt_lastnet ),
+                               strerror(errno) );
                    }
                }
            }
        }
        if ( iface->i_flags & IFACE_LOOP ) {
          if (looproute( iface, RTMP_DEL )) {
-           syslog( LOG_ERR, "as_down remove %s %u.%u failed: %m",
+           syslog( LOG_ERR, "as_down remove %s %u.%u failed: %s",
                    iface->i_name, ntohs( iface->i_addr.sat_addr.s_net ),
-                   iface->i_addr.sat_addr.s_node );
+                   iface->i_addr.sat_addr.s_node,
+                   strerror(errno) );
          }
        }
     }
@@ -1086,16 +1092,16 @@ int main( ac, av )
      */
 #ifdef BSD4_4
     if (( rtfd = socket( PF_ROUTE, SOCK_RAW, AF_APPLETALK )) < 0 ) {
-       syslog( LOG_ERR, "route socket: %m" );
+       syslog( LOG_ERR, "route socket: %s", strerror(errno) );
        atalkd_exit( 1 );
     }
     if ( shutdown( rtfd, 0 ) < 0 ) {
-       syslog( LOG_ERR, "route shutdown: %m" );
+       syslog( LOG_ERR, "route shutdown: %s", strerror(errno) );
        atalkd_exit( 1 );
     }
 #else /* BSD4_4 */
     if (( rtfd = socket( AF_APPLETALK, SOCK_DGRAM, 0 )) < 0 ) {
-       syslog( LOG_ERR, "route socket: %m" );
+       syslog( LOG_ERR, "route socket: %s", strerror(errno) );
        atalkd_exit( 1 );
     }
 #endif /* BSD4_4 */
@@ -1108,7 +1114,7 @@ int main( ac, av )
     sigaddset( &sv.sa_mask, SIGTERM );
     sv.sa_flags = SA_RESTART;
     if ( sigaction( SIGTERM, &sv, NULL) < 0 ) {
-       syslog( LOG_ERR, "sigterm: %m" );
+       syslog( LOG_ERR, "sigterm: %s", strerror(errno) );
        atalkd_exit( 1 );
     }
 
@@ -1119,7 +1125,7 @@ int main( ac, av )
     sigaddset( &sv.sa_mask, SIGTERM );
     sv.sa_flags = SA_RESTART;
     if ( sigaction( SIGUSR1, &sv, NULL) < 0 ) {
-       syslog( LOG_ERR, "sigusr1: %m" );
+       syslog( LOG_ERR, "sigusr1: %s", strerror(errno) );
        atalkd_exit( 1 );
     }
 
@@ -1130,7 +1136,7 @@ int main( ac, av )
     sigaddset( &sv.sa_mask, SIGTERM );
     sv.sa_flags = SA_RESTART;
     if ( sigaction( SIGALRM, &sv, NULL) < 0 ) {
-       syslog( LOG_ERR, "sigalrm: %m" );
+       syslog( LOG_ERR, "sigalrm: %s", strerror(errno) );
        atalkd_exit( 1 );
     }
 
@@ -1139,7 +1145,7 @@ int main( ac, av )
     it.it_value.tv_sec = 10L;
     it.it_value.tv_usec = 0L;
     if ( setitimer( ITIMER_REAL, &it, NULL) < 0 ) {
-       syslog( LOG_ERR, "setitimer: %m" );
+       syslog( LOG_ERR, "setitimer: %s", strerror(errno) );
        atalkd_exit( 1 );
     }
 
@@ -1152,7 +1158,7 @@ int main( ac, av )
                errno = 0;
                continue;
            } else {
-               syslog( LOG_ERR, "select: %m" );
+               syslog( LOG_ERR, "select: %s", strerror(errno) );
                atalkd_exit( 1 );
            }
        }
@@ -1164,7 +1170,7 @@ int main( ac, av )
                        fromlen = sizeof( struct sockaddr_at );
                        if (( c = recvfrom( ap->ap_fd, Packet, sizeof( Packet ),
                                0, (struct sockaddr *)&sat, &fromlen )) < 0 ) {
-                           syslog( LOG_ERR, "recvfrom: %m" );
+                           syslog( LOG_ERR, "recvfrom: %s", strerror(errno) );
                            continue;
                        }
 #ifdef DEBUG
@@ -1178,7 +1184,7 @@ int main( ac, av )
 #endif /* DEBUG */
 #ifdef __svr4__
                        if ( sighold( SIGALRM ) || sighold( SIGUSR1 )) {
-                           syslog( LOG_ERR, "sighold: %m" );
+                           syslog( LOG_ERR, "sighold: %s", strerror(errno) );
                            atalkd_exit( 1 );
                        }
 #else /* __svr4__ */
@@ -1186,7 +1192,7 @@ int main( ac, av )
                                sigmask( SIGUSR1 ));
 #endif /* __svr4__ */
                        if (( *ap->ap_packet )( ap, &sat, Packet, c ) < 0) {
-                         syslog(LOG_ERR, "ap->ap_packet: %m");
+                         syslog(LOG_ERR, "ap->ap_packet: %s", strerror(errno));
                          atalkd_exit(1);
                        }
 
@@ -1195,7 +1201,7 @@ int main( ac, av )
 #endif /* DEBUG */
 #ifdef __svr4__
                        if ( sigrelse( SIGUSR1 ) || sigrelse( SIGALRM )) {
-                           syslog( LOG_ERR, "sigrelse: %m" );
+                           syslog( LOG_ERR, "sigrelse: %s", strerror(errno) );
                            atalkd_exit( 1 );
                        }
 #else /* __svr4__ */
@@ -1238,7 +1244,7 @@ void bootaddr( iface )
            }
 
        } else if (rtmp_request( iface ) < 0) {
-         syslog(LOG_ERR, "bootaddr (rtmp_request): %m");
+         syslog(LOG_ERR, "bootaddr (rtmp_request): %s", strerror(errno));
          atalkd_exit(1);
        }
 
@@ -1255,7 +1261,7 @@ void bootaddr( iface )
            }
            
        } else if (zip_getnetinfo( iface ) < 0) {
-         syslog(LOG_ERR, "bootaddr (zip_getnetinfo): %m");
+         syslog(LOG_ERR, "bootaddr (zip_getnetinfo): %s", strerror(errno));
          atalkd_exit(1);
        }
     }
@@ -1269,12 +1275,9 @@ void bootaddr( iface )
  * Change setaddr()
  * to manage the i_ports field and the fds for select().
  */
-void setaddr( iface, phase, net, node, first, last )
-    struct interface   *iface;
-    u_int8_t           phase;
-    u_int16_t          net;
-    u_int8_t           node;
-    u_int16_t          first, last;
+void setaddr(struct interface *iface,
+             u_int8_t  phase, u_int16_t net, u_int8_t node,
+            u_int16_t first, u_int16_t last)
 {
     int                        i;
     struct atserv      *as;
@@ -1292,7 +1295,7 @@ void setaddr( iface, phase, net, node, first, last )
            }
            if (( ap = (struct atport *)malloc( sizeof( struct atport ))) ==
                    NULL ) {
-               syslog( LOG_ERR, "malloc: %m" );
+               syslog( LOG_ERR, "malloc: %s", strerror(errno) );
                atalkd_exit( 1 );
            }
            ap->ap_fd = 0;
@@ -1322,12 +1325,12 @@ void setaddr( iface, phase, net, node, first, last )
     memcpy( iface->i_addr.sat_zero, &nr, sizeof( struct netrange ));
 
     if ( ifconfig( iface->i_name, SIOCSIFADDR, &iface->i_addr )) {
-      syslog( LOG_ERR, "setifaddr: %s (%u-%u): %m. try specifying a \
-smaller net range.", iface->i_name, ntohs(first), ntohs(last));
+      syslog( LOG_ERR, "setifaddr: %s (%u-%u): %s. try specifying a \
+smaller net range.", iface->i_name, ntohs(first), ntohs(last), strerror(errno));
        atalkd_exit( 1 );
     }
     if ( ifconfig( iface->i_name, SIOCGIFADDR, &iface->i_addr )) {
-       syslog( LOG_ERR, "getifaddr: %s: %m", iface->i_name );
+       syslog( LOG_ERR, "getifaddr: %s: %s", iface->i_name, strerror(errno) );
        atalkd_exit( 1 );
     }
 
@@ -1338,7 +1341,7 @@ smaller net range.", iface->i_name, ntohs(first), ntohs(last));
 #endif /* __svr4__ */
     for ( ap = iface->i_ports; ap; ap = ap->ap_next ) {
        if (( ap->ap_fd = socket( AF_APPLETALK, SOCK_DGRAM, 0 )) < 0 ) {
-           syslog( LOG_ERR, "socket: %m" );
+           syslog( LOG_ERR, "socket: %s", strerror(errno) );
            atalkd_exit( 1 );
        }
 #ifndef __svr4__
@@ -1356,9 +1359,9 @@ smaller net range.", iface->i_name, ntohs(first), ntohs(last));
 
        if ( bind( ap->ap_fd, (struct sockaddr *)&sat,
                sizeof( struct sockaddr_at )) < 0 ) {
-           syslog( LOG_ERR, "bind %u.%u:%u: %m",
+           syslog( LOG_ERR, "bind %u.%u:%u: %s",
                    ntohs( sat.sat_addr.s_net ),
-                   sat.sat_addr.s_node, sat.sat_port );
+                   sat.sat_addr.s_node, sat.sat_port, strerror(errno) );
 #ifdef SIOCDIFADDR
            /* remove all interfaces if we have a problem with bind */
            for (iface = interfaces; iface; iface = iface->i_next) {
index 002a90a4ebedf64479091918ed643791c9cd35bd..3f956c4acff3e278eccfed1a149b1fdc2a13516f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: multicast.c,v 1.7 2001-08-15 01:39:39 srittau Exp $
+ * $Id: multicast.c,v 1.8 2001-12-10 20:16:55 srittau Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
@@ -11,6 +11,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <errno.h>
 #include <sys/param.h>
 #include <sys/types.h>
 #include <sys/ioctl.h>
@@ -393,7 +394,7 @@ zone_bcast( zt )
 
     if (!zt->zt_bcast &&
        (zt->zt_bcast = (u_char *) malloc(sizeof( ethermulti ))) == NULL) {
-       syslog( LOG_ERR, "zone_bcast malloc: %m" );
+       syslog( LOG_ERR, "zone_bcast malloc: %s", strerror(errno) );
        return -1;
      }
 
index 28ab7faef127c5d746fdf8cb4e471daf7f971797..442ba0cd1b40c171aa1a494163470ade1fcc3de2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: nbp.c,v 1.5 2001-08-15 01:39:39 srittau Exp $
+ * $Id: nbp.c,v 1.6 2001-12-10 20:16:55 srittau Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
@@ -11,6 +11,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <errno.h>
 #include <sys/syslog.h>
 #include <sys/types.h>
 #include <sys/param.h>
@@ -63,7 +64,7 @@ void nbp_ack( fd, nh_op, nh_id, to )
     data += SZ_NBPHDR;
     if ( sendto( fd, packet, data - packet, 0, (struct sockaddr *)to,
            sizeof( struct sockaddr_at )) < 0 ) {
-       syslog( LOG_ERR, "sendto: %m" );
+       syslog( LOG_ERR, "sendto: %s", strerror(errno) );
     }
 }
 
@@ -217,7 +218,8 @@ int nbp_packet( ap, from, data, len )
                    if ( zt == (struct ziptab *)l->l_data ) {
                        /* add multicast */
                        if (addmulti(iface->i_name, zt->zt_bcast) < 0) {
-                           syslog( LOG_ERR, "nbp_packet: addmulti: %m" );
+                           syslog( LOG_ERR, "nbp_packet: addmulti: %s",
+                                   strerror(errno) );
                            return -1;
                        }
                    }
@@ -227,7 +229,7 @@ int nbp_packet( ap, from, data, len )
 
        if (( ntab = (struct nbptab *)malloc( sizeof( struct nbptab )))
                == 0 ) {
-           syslog( LOG_ERR, "nbp_packet: malloc: %m" );
+           syslog( LOG_ERR, "nbp_packet: malloc: %s", strerror(errno) );
            return -1;
        }
        memcpy( &ntab->nt_nve, &nn, sizeof( struct nbpnve ));
@@ -402,7 +404,7 @@ int nbp_packet( ap, from, data, len )
 
            if ( sendto( ap->ap_fd, data - len, len, 0, (struct sockaddr *)&sat,
                    sizeof( struct sockaddr_at )) < 0 ) {
-               syslog( LOG_ERR, "nbp brrq sendto: %m" );
+               syslog( LOG_ERR, "nbp brrq sendto: %s", strerror(errno) );
            }
 
            locallkup = 1;
@@ -468,8 +470,9 @@ Can't find route's interface!" );
                if ( sendto( ap->ap_fd, data - len, len, 0,
                        (struct sockaddr *)&sat,
                        sizeof( struct sockaddr_at )) < 0 ) {
-                   syslog( LOG_ERR, "nbp brrq sendto %u.%u: %m",
-                           ntohs( sat.sat_addr.s_net ), sat.sat_addr.s_node );
+                   syslog( LOG_ERR, "nbp brrq sendto %u.%u: %s",
+                           ntohs( sat.sat_addr.s_net ), sat.sat_addr.s_node,
+                           strerror(errno) );
                    continue;
                }
            }
@@ -489,8 +492,9 @@ Can't find route's interface!" );
            from->sat_addr.s_node = ATADDR_BCAST;
            if ( sendto( ap->ap_fd, data - len, len, 0, (struct sockaddr *)from,
                    sizeof( struct sockaddr_at )) < 0 ) {
-               syslog( LOG_ERR, "nbp fwd sendto %u.%u: %m",
-                       ntohs( from->sat_addr.s_net ), from->sat_addr.s_node );
+               syslog( LOG_ERR, "nbp fwd sendto %u.%u: %s",
+                       ntohs( from->sat_addr.s_net ), from->sat_addr.s_node,
+                       strerror(errno) );
                return 0;
            }
        }
@@ -564,9 +568,10 @@ Can't find route's interface!" );
                if ( sendto( ap->ap_fd, packet, cc, 0,
                        (struct sockaddr *)&nn.nn_sat,
                        sizeof( struct sockaddr_at )) < 0 ) {
-                   syslog( LOG_ERR, "nbp lkup sendto %u.%u: %m",
+                   syslog( LOG_ERR, "nbp lkup sendto %u.%u: %s",
                            ntohs( nn.nn_sat.sat_addr.s_net ),
-                           nn.nn_sat.sat_addr.s_node );
+                           nn.nn_sat.sat_addr.s_node,
+                           strerror(errno) );
                    return 0;
                }
 
@@ -626,9 +631,10 @@ Can't find route's interface!" );
            if ( sendto( ap->ap_fd, packet, cc, 0,
                    (struct sockaddr *)&nn.nn_sat,
                    sizeof( struct sockaddr_at )) < 0 ) {
-               syslog( LOG_ERR, "nbp lkup sendto %u.%u: %m",
+               syslog( LOG_ERR, "nbp lkup sendto %u.%u: %s",
                        ntohs( nn.nn_sat.sat_addr.s_net ),
-                       nn.nn_sat.sat_addr.s_node );
+                       nn.nn_sat.sat_addr.s_node,
+                       strerror(errno) );
                return 0;
            }
        }
index 723a7021bb5f9b71d4ab1de48437a8275eb41611..0af04c344068a6e4d4a405171434c66dff6e7af4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: rtmp.c,v 1.8 2001-08-15 01:39:39 srittau Exp $
+ * $Id: rtmp.c,v 1.9 2001-12-10 20:16:55 srittau Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
@@ -11,6 +11,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <errno.h>
 #include <sys/syslog.h>
 #include <sys/types.h>
 #include <sys/param.h>
@@ -141,9 +142,10 @@ static int rtmp_config( rh, iface )
       return -1;
 
     if (cc) {
-       syslog( LOG_ERR, "rtmp_config: can't route %u.%u to loopback: %m",
+       syslog( LOG_ERR, "rtmp_config: can't route %u.%u to loopback: %s",
                ntohs( iface->i_addr.sat_addr.s_net ),
-               iface->i_addr.sat_addr.s_node );
+               iface->i_addr.sat_addr.s_node,
+               strerror(errno) );
     }
 
     syslog( LOG_INFO, "rtmp_config configured %s", iface->i_name );
@@ -463,7 +465,8 @@ int rtmp_packet( ap, from, data, len )
                } 
 
                if (cc)
-                 syslog( LOG_ERR, "rtmp_packet: can't remove loopback: %m" );
+                 syslog( LOG_ERR, "rtmp_packet: can't remove loopback: %s",
+                         strerror(errno) );
 
                iface->i_flags &= ~IFACE_NOROUTER;
                iface->i_time = 0;
@@ -562,7 +565,7 @@ int rtmp_packet( ap, from, data, len )
        }
        if ( !gate ) {  /* new gateway */
            if (( gate = (struct gate *)malloc( sizeof( struct gate ))) == 0 ) {
-               syslog( LOG_ERR, "rtmp_packet: malloc: %m" );
+               syslog( LOG_ERR, "rtmp_packet: malloc: %s", strerror(errno) );
                return -1;
            }
            gate->g_next = iface->i_gate;
@@ -701,7 +704,7 @@ int rtmp_packet( ap, from, data, len )
                        ntohs( rt.rt_net ));
            } else {            /* new for router */
                if (( rtmp = newrt(iface)) == NULL ) {
-                   syslog( LOG_ERR, "rtmp_packet: newrt: %m" );
+                   syslog( LOG_ERR, "rtmp_packet: newrt: %s", strerror(errno) );
                    return -1;
                }
                rtmp->rt_firstnet = rt.rt_net;
@@ -788,7 +791,7 @@ int rtmp_packet( ap, from, data, len )
            if ( sendto( ap->ap_fd, packet, data - packet, 0,
                    (struct sockaddr *)from,
                    sizeof( struct sockaddr_at )) < 0 ) {
-               syslog( LOG_ERR, "as_timer sendto: %m" );
+               syslog( LOG_ERR, "as_timer sendto: %s", strerror(errno) );
            }
        } else if ( *data == 2 || *data == 3 ) {
 #ifdef DEBUG
@@ -847,7 +850,7 @@ int rtmp_request( iface )
     sat.sat_port = ap->ap_port;
     if ( sendto( ap->ap_fd, packet, data - packet, 0, (struct sockaddr *)&sat,
            sizeof( struct sockaddr_at )) < 0 ) {
-       syslog( LOG_ERR, "rtmp_request sendto: %m" );
+       syslog( LOG_ERR, "rtmp_request sendto: %s", strerror(errno) );
        return -1;
     }
     return 0;
@@ -955,8 +958,9 @@ int gateroute( command, rtmp )
                    (struct sockaddr *) &dst,
                    (struct sockaddr *) &gate,
                    RTF_UP | RTF_GATEWAY )) {
-           syslog( LOG_ERR, "route: %u -> %u.%u: %m", net,
-                   ntohs( gate.sat_addr.s_net ), gate.sat_addr.s_node );
+           syslog( LOG_ERR, "route: %u -> %u.%u: %s", net,
+                   ntohs( gate.sat_addr.s_net ), gate.sat_addr.s_node,
+                   strerror(errno) );
            continue;
        }
 #else /* ! BSD4_4 */
index 4d71b01101600970cd7f2aa0f83642ffac2c3a63..14e6d01db510f1b14f1164254c6d7267b3d7b099 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: zip.c,v 1.7 2001-08-15 01:39:39 srittau Exp $
+ * $Id: zip.c,v 1.8 2001-12-10 20:16:55 srittau Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
@@ -11,6 +11,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <errno.h>
 #include <sys/param.h>
 #include <sys/types.h>
 #include <sys/syslog.h>
@@ -181,7 +182,8 @@ int zip_packet( ap, from, data, len )
                        if ( sendto( ap->ap_fd, packet, reply - packet, 0,
                                (struct sockaddr *)from,
                                sizeof( struct sockaddr_at )) < 0 ) {
-                           syslog( LOG_ERR, "zip reply sendto: %m" );
+                           syslog( LOG_ERR, "zip reply sendto: %s",
+                                   strerror(errno) );
                        }
 
                        reply = packet + 3;
@@ -200,7 +202,8 @@ int zip_packet( ap, from, data, len )
                                if ( sendto( ap->ap_fd, packet, reply - packet,
                                        0, (struct sockaddr *)from,
                                        sizeof( struct sockaddr_at )) < 0 ) {
-                                   syslog( LOG_ERR, "zip reply sendto: %m" );
+                                   syslog( LOG_ERR, "zip reply sendto: %s",
+                                           strerror(errno) );
                                }
 
                                reply = packet + 3;
@@ -221,7 +224,8 @@ int zip_packet( ap, from, data, len )
                            if ( sendto( ap->ap_fd, packet, reply - packet, 0,
                                    (struct sockaddr *)from,
                                    sizeof( struct sockaddr_at )) < 0 ) {
-                               syslog( LOG_ERR, "zip reply sendto: %m" );
+                               syslog( LOG_ERR, "zip reply sendto: %s",
+                                       strerror(errno) );
                            }
 
                            reply = packet + 3;
@@ -248,7 +252,8 @@ int zip_packet( ap, from, data, len )
                if ( sendto( ap->ap_fd, packet, reply - packet, 0,
                        (struct sockaddr *)from,
                        sizeof( struct sockaddr_at )) < 0 ) {
-                   syslog( LOG_ERR, "zip reply sendto: %m" );
+                   syslog( LOG_ERR, "zip reply sendto: %s",
+                           strerror(errno) );
                }
            }
            break;
@@ -598,8 +603,9 @@ int zip_packet( ap, from, data, len )
            if ( sendto( ap->ap_fd, packet, data - packet, 0,
                    (struct sockaddr *)from,
                    sizeof( struct sockaddr_at )) < 0 ) {
-               syslog( LOG_ERR, "zip gni sendto %u.%u: %m",
-                       ntohs( from->sat_addr.s_net ), from->sat_addr.s_node );
+               syslog( LOG_ERR, "zip gni sendto %u.%u: %s",
+                       ntohs( from->sat_addr.s_net ), from->sat_addr.s_node,
+                       strerror(errno) );
                return 1;
            }
            break;
@@ -722,9 +728,10 @@ int zip_packet( ap, from, data, len )
            /* add addr to loopback route */
            if ( looproute( iface, RTMP_ADD )) { /* -1 or 1 */
                syslog( LOG_ERR,
-                       "zip_packet: can't route %u.%u to loopback: %m",
+                       "zip_packet: can't route %u.%u to loopback: %s",
                        ntohs( iface->i_addr.sat_addr.s_net ),
-                       iface->i_addr.sat_addr.s_node );
+                       iface->i_addr.sat_addr.s_node,
+                       strerror(errno) );
                return -1;
            }
 
@@ -874,8 +881,9 @@ int zip_packet( ap, from, data, len )
            if ( sendto( ap->ap_fd, packet, data - packet, 0,
                    (struct sockaddr *)from,
                    sizeof( struct sockaddr_at )) < 0 ) {
-               syslog( LOG_ERR, "zip atp sendto %u.%u: %m",
-                       ntohs( from->sat_addr.s_net ), from->sat_addr.s_node );
+               syslog( LOG_ERR, "zip atp sendto %u.%u: %s",
+                       ntohs( from->sat_addr.s_net ), from->sat_addr.s_node,
+                       strerror(errno) );
                return 1;
            }
        }
@@ -941,7 +949,7 @@ int zip_getnetinfo( iface )
 
     if ( sendto( ap->ap_fd, packet, data - packet, 0, (struct sockaddr *)&sat,
            sizeof( struct sockaddr_at )) < 0 ) {
-       syslog( LOG_ERR, "zip_getnetinfo sendto: %m" );
+       syslog( LOG_ERR, "zip_getnetinfo sendto: %s", strerror(errno) );
        return -1;
     }
     return 0;
@@ -985,7 +993,7 @@ static int add_list( head, data )
        }
     }
     if (( l = (struct list *)malloc( sizeof( struct list ))) == NULL ) {
-       syslog( LOG_ERR, "add_list malloc: %m" );
+       syslog( LOG_ERR, "add_list malloc: %s", strerror(errno) );
        return -1;
     }
 
@@ -1020,7 +1028,7 @@ int addzone( rt, len, zone )
     }
     if ( zt == NULL ) {
        if (( zt = newzt( len, zone )) == NULL ) {
-           syslog( LOG_ERR, "addzone newzt: %m" );
+           syslog( LOG_ERR, "addzone newzt: %s", strerror(errno) );
            return -1;
        }
        if ( ziptab == NULL ) {
index aedf75570f5eb7629c8d3183c4657f4564fb844e..dc035d7ce7b0341051645fec55f8cd383cddc05d 100644 (file)
@@ -1,5 +1,5 @@
 /* 
- * $Id: netddp_open.c,v 1.4 2001-11-25 21:55:10 srittau Exp $
+ * $Id: netddp_open.c,v 1.5 2001-12-10 20:16:43 srittau Exp $
  *
  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
@@ -56,7 +56,7 @@ int netddp_open(struct sockaddr_at *addr, struct sockaddr_at *bridge)
       bridge->sat_port = baddress.socket;
     }
 #else /* MACOSX_SERVER */
-    int len;
+    socklen_t len;
 
     if ((s = socket( AF_APPLETALK, SOCK_DGRAM, 0 )) < 0) 
        return -1;