]> arthur.barton.de Git - netatalk.git/commitdiff
commenting changes, more autoconf support in afpd, etc
authorrufustfirefly <rufustfirefly>
Wed, 20 Jun 2001 18:33:03 +0000 (18:33 +0000)
committerrufustfirefly <rufustfirefly>
Wed, 20 Jun 2001 18:33:03 +0000 (18:33 +0000)
46 files changed:
ChangeLog
configure.in
etc/afpd/afp_asp.c
etc/afpd/afp_config.c
etc/afpd/afp_config.h
etc/afpd/afp_dsi.c
etc/afpd/afp_options.c
etc/afpd/afs.c
etc/afpd/appl.c
etc/afpd/auth.c
etc/afpd/auth.h
etc/afpd/codepage.c
etc/afpd/codepage.h
etc/afpd/desktop.c
etc/afpd/desktop.h
etc/afpd/directory.c
etc/afpd/directory.h
etc/afpd/enumerate.c
etc/afpd/file.c
etc/afpd/file.h
etc/afpd/filedir.c
etc/afpd/filedir.h
etc/afpd/fork.c
etc/afpd/fork.h
etc/afpd/gettok.c
etc/afpd/globals.h
etc/afpd/icon.h
etc/afpd/main.c
etc/afpd/messages.c
etc/afpd/misc.h
etc/afpd/nfsquota.c
etc/afpd/ofork.c
etc/afpd/passwd.c
etc/afpd/quota.c
etc/afpd/status.c
etc/afpd/status.h
etc/afpd/switch.c
etc/afpd/switch.h
etc/afpd/uam.c
etc/afpd/uam_auth.h
etc/afpd/uid.c
etc/afpd/unix.h
etc/afpd/volume.c
etc/afpd/volume.h
include/atalk/util.h
libatalk/util/module.c

index 423d865f159082a1b1a126bfc96dd295522797b1..c5d265d360a3d8abf2321caee2274fddd5331bf4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,4 @@
-($Id: ChangeLog,v 1.50 2001-06-20 14:51:12 rufustfirefly Exp $)
+($Id: ChangeLog,v 1.51 2001-06-20 18:33:03 rufustfirefly Exp $)
 
 2001-06-20  jeff b  <jeff@univrel.pr.uconn.edu>
        * configure.in: check for linux/quota.h before enabling
@@ -8,6 +8,9 @@
        libatalk/util/module.c: removed NO_DLFCN_H in favor of
        ifndef HAVE_DLFCN_H (Jeff)
 
+       * configure.in, etc/afpd/*.{c,h}, include/atalk/util.h:
+       major autoconf fixes for afpd, nicer commenting, etc (Jeff)
+
 2001-06-19  jeff b  <jeff@univrel.pr.uconn.edu>
        * etc/afpd/file.c, etc/afpd/parse_mtab.c, etc/afpd/parse_mtab.h,
        etc/atalkd/route.h, etc/atalkd/rtmp.c, etc/papd/headers.c,
index 431bca331da8f1c6d51c7054a2ffe391b9ee2744..6a332041a2f2ff46066ada600229c65c48323137 100644 (file)
@@ -1,4 +1,4 @@
-dnl $Id: configure.in,v 1.91 2001-06-20 14:51:12 rufustfirefly Exp $
+dnl $Id: configure.in,v 1.92 2001-06-20 18:33:03 rufustfirefly Exp $
 dnl configure.in for netatalk
 
 AC_INIT(bin/adv1tov2/adv1tov2.c)
@@ -85,7 +85,7 @@ dnl Checks for header files.
 AC_HEADER_DIRENT
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(fcntl.h limits.h stdint.h strings.h sys/fcntl.h sys/file.h sys/ioctl.h sys/time.h sys/mnttab.h sys/statvfs.h sys/stat.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 sys/types.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/stat.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 sys/types.h dlfcn.h)
 AC_CHECK_HEADER(sys/cdefs.h,,
        AC_MSG_RESULT([enabling generic cdefs.h from tree])
        CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
@@ -140,7 +140,7 @@ dnl --------------------------------------------------------------------------
 AC_DEFINE(ADMIN_GRP, 1)
 
 AC_ARG_WITH(admin-group,
-       [  --disable-admin-group  disable admin group],
+       [  --disable-admin-group   disable admin group],
         if test "$enableval" = "no"; then
                AC_DEFINE(ADMIN_GRP, 0)
                AC_MSG_RESULT([disabling administrative group support])
@@ -148,7 +148,7 @@ AC_ARG_WITH(admin-group,
  )
 
 AC_ARG_ENABLE(afs,
-       [  --enable-afs           enable AFS support],
+       [  --enable-afs            enable AFS support],
        if test "$enableval" = "yes"; then
                AC_DEFINE(AFS, 1)
                AC_MSG_RESULT([enabling AFS support])
@@ -162,7 +162,8 @@ AC_ARG_WITH(config-dir,
 )
 
 AC_ARG_WITH(pkgconfdir,
-       [  --with-pkgconfdir=DIR   package specific configuration in DIR [default=SYSCONF/netatalk]],
+       [  --with-pkgconfdir=DIR   package specific configuration in DIR
+                          [default=SYSCONF/netatalk]],
                PKGCONFDIR="$withval",
                PKGCONFDIR="${sysconfdir}/netatalk"
 )
@@ -233,7 +234,7 @@ AC_ARG_ENABLE(force-uidgid,
 )
 
 AC_ARG_WITH(did,
-       [  --with-did=[scheme]      set DID scheme (last,mtab)],
+       [  --with-did=[scheme]     set DID scheme (last,mtab)],
        if test "x$withval" != "xno" ; then
                if test "$withval" = "last"; then 
                        AC_DEFINE(USE_LASTDID, 1)
@@ -455,19 +456,11 @@ if test x"$this_os" = "xlinux"; then
        LDSHAREDFLAGS="-shared"
 
        dnl ----- check if we need the quotactl wrapper
-       AC_CHECK_HEADER(sys/quota.h,
-               sys_quota=yes,
-               sys_quota=no
-       )
-       AC_CHECK_HEADER(linux/quota.h,
-               linux_quota=yes,
-               linux_quota=no
-       )
-
-       if test "x$linux_quota" = "xno" -a "x$sys_quota" = "xno"; then
-               AC_MSG_RESULT([enabling quotactl wrapper])
+       AC_CHECK_HEADERS(sys/quota.h linux/quota.h)
+       AC_CHECK_FUNC(quotactl,,
                AC_DEFINE(NEED_QUOTACTL_WRAPPER)
-       fi
+               AC_MSG_RESULT([enabling quotactl wrapper])
+       )
 
        dnl ----- as far as I can tell, dbtob always does the wrong thing
        dnl ----- on every single version of linux I've ever played with.
index b2ef07e333eb6f08f35649fb854d3b6ab124f0cd..316ec0bf913f28b64a91b66a46210d34dec73166 100644 (file)
@@ -1,4 +1,6 @@
 /* 
+ * $Id: afp_asp.c,v 1.5 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -8,7 +10,7 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #ifndef NO_DDP
 
 #include <string.h>
 #include <signal.h>
 #include <syslog.h>
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
+#endif /* HAVE_SYS_TIME_H */
+#ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>
+#endif /* HAVE_SYS_STAT_H */
 
 #include <netatalk/endian.h>
 #include <atalk/atp.h>
@@ -238,7 +244,7 @@ void afp_over_asp(AFPObj *obj)
       if ( obj->options.flags & OPTION_DEBUG ) {
 #ifdef notdef
        pdesc( stdout );
-#endif notdef
+#endif /* notdef */
        of_pforkdesc( stdout );
        fflush( stdout );
       }
index 0096eb5775fce890b2974523a0e8de544ac8de3c..27e4b0df90c49415211334ef5b4b8bc7db053516 100644 (file)
@@ -1,16 +1,20 @@
 /* 
+ * $Id: afp_config.c,v 1.3 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved.  See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include <ctype.h>
 #include <syslog.h>
 
@@ -277,7 +281,7 @@ static AFPConfig *AFPConfigInit(const struct afp_options *options,
   if ((options->transports & AFPTRANS_DDP) && 
       (config = ASPConfigInit(options, refcount)))
     config->defoptions = defoptions;
-#endif
+#endif /* NO_DDP */
 
   /* handle dsi transports and dsi proxies. we only proxy
    * for DSI connections. */
index 74c494061592f85b63c961e4226b26aec24aefd6..20e629a7b25d0db780c1ba9bf4e76623074fa3c2 100644 (file)
@@ -1,7 +1,14 @@
+/*
+ * $Id: afp_config.h,v 1.2 2001-06-20 18:33:04 rufustfirefly Exp $
+ */
+
 #ifndef AFPD_CONFIG_H
 #define AFPD_CONFIG_H 1
 
+#ifdef HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
+#endif /* HAVE_SYS_CDEFS_H */
+
 #include <atalk/server_child.h>
 #include <atalk/atp.h>
 #include "globals.h"
@@ -20,4 +27,5 @@ typedef struct AFPConfig {
 
 extern AFPConfig *configinit __P((struct afp_options *));
 extern void configfree __P((AFPConfig *, const AFPConfig *));
+
 #endif
index 43bd8e3de738b63bed97066e38e6145c471f9106..3a68866fd0626c7741bc0341c100ca40566880c2 100644 (file)
@@ -1,4 +1,6 @@
 /* 
+ * $Id: afp_dsi.c,v 1.8 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <signal.h>
 #include <string.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include <sys/socket.h>
 #include <sys/time.h>
+#ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>
+#endif /* HAVE_SYS_STAT_H */
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <syslog.h>
@@ -111,7 +117,7 @@ static void afp_dsi_getmesg (int sig)
       readmessage();
       dsi_attention(child.obj->handle, AFPATTN_MESG | AFPATTN_TIME(5));
 }
-#endif
+#endif /* SERVERTEXT */
 
 static void alarm_handler()
 {
@@ -172,7 +178,7 @@ void afp_over_dsi(AFPObj *obj)
     syslog( LOG_ERR, "afp_over_dsi: sigaction: %m" );
     afp_dsi_die(1);
   }
-#endif
+#endif /* SERVERTEXT */
 
   /* tickle handler */
   action.sa_handler = alarm_handler;
@@ -214,7 +220,7 @@ void afp_over_dsi(AFPObj *obj)
        }
        writtenfork = NULL;
       }
-#endif AFS
+#endif /* AFS */
 
       function = (u_char) dsi->commands[0];
       if (obj->options.flags & OPTION_DEBUG ) {
@@ -301,7 +307,7 @@ void afp_over_dsi(AFPObj *obj)
     if ( obj->options.flags & OPTION_DEBUG ) {
 #ifdef notdef
       pdesc( stdout );
-#endif notdef
+#endif /* notdef */
       of_pforkdesc( stdout );
       fflush( stdout );
     }
index 99e308b57da815a81531aa006dad9a4864cfdbc6..199d09f6e14cd1c415dc549beb0fb4f570347c3f 100644 (file)
@@ -1,4 +1,6 @@
 /* 
+ * $Id: afp_options.c,v 1.7 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include <sys/param.h>
 #include <sys/socket.h>
 #include <syslog.h>
 
 #include <netinet/in.h>
 #include <arpa/inet.h>
+#ifdef HAVE_NETDB_H
 #include <netdb.h>
+#endif /* HAVE_NETDB_H */
 
 #include <atalk/paths.h>
 #include <atalk/util.h>
 #ifdef ADMIN_GRP
 #include <grp.h>
 #include <sys/types.h>
-#endif
+#endif /* ADMIN_GRP */
 
 #ifndef MIN
 #define MIN(a, b)  ((a) < (b) ? (a) : (b))
-#endif
+#endif /* MIN */
 
 #define OPTIONS "dn:f:s:uc:g:P:ptDS:TL:F:U:I"
 #define LENGTH 512
@@ -123,7 +129,7 @@ void afp_options_init(struct afp_options *options)
   options->authprintdir = NULL;
 #ifdef ADMIN_GRP
   options->admingid = 0;
-#endif ADMIN_GRP
+#endif /* ADMIN_GRP */
 }
 
 /* parse an afpd.conf line. i'm doing it this way because it's
@@ -215,7 +221,7 @@ int afp_options_parseline(char *buf, struct afp_options *options)
       options->admingid = gr->gr_gid;
     }
   } 
-#endif
+#endif /* ADMIN_GRP */
 
   if ((c = getoption(buf, "-authprintdir")) && (opt = strdup(c)))
     options->authprintdir = opt;
@@ -349,9 +355,9 @@ int afp_options_parse(int ac, char **av, struct afp_options *options)
 
 #ifdef ultrix
     openlog( p, LOG_PID );
-#else ultrix
+#else /* ultrix */
     openlog( p, LOG_NDELAY|LOG_PID, LOG_DAEMON);
-#endif ultrix
+#endif /* ultrix */
 
     return 1;
 }
index cb2082c60db296ad599c899f690655e9414267bd..169804f1cdbd370f701ab9caee2a9fc865bac2b6 100644 (file)
@@ -1,11 +1,12 @@
 /*
+ * $Id: afs.c,v 1.4 2001-06-20 18:33:04 rufustfirefly Exp $
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #ifdef AFS
 
@@ -17,7 +18,9 @@
 #include <afs/venus.h>
 #include <afs/afsint.h>
 #include <atalk/afp.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 
 #include "globals.h"
 #include "directory.h"
@@ -318,5 +321,5 @@ afp_afschangepw(obj, ibuf, ibuflen, rbuf, rbuflen )
     return( AFP_OK );
 }
 
-#endif UAM_AFSKRB
-#endif AFS
+#endif /* UAM_AFSKRB */
+#endif /* AFS */
index c5d9ea06c817d360daa367ee133a68c6354a5950..d14935bbbb23f75e20f6aa22a13cbd10feb52215 100644 (file)
@@ -1,18 +1,24 @@
 /*
+ * $Id: appl.c,v 1.3 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/param.h>
@@ -418,7 +424,7 @@ int afp_getappl(obj, ibuf, ibuflen, rbuf, rbuflen )
            len--;
        }
     }
-#endif APPLCNAME
+#endif /* APPLCNAME */
 
     /* fake up a cname */
     cbuf = obj->newtmp;
@@ -453,4 +459,3 @@ int afp_getappl(obj, ibuf, ibuflen, rbuf, rbuflen )
     return( AFP_OK );
 }
 
-
index 1b8f1f60ea99e5b758c4205a1c52d34c7915e57f..083120f49583acb206fc928ce3326671fbf05703 100644 (file)
@@ -1,15 +1,19 @@
 /*
+ * $Id: auth.c,v 1.15 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/stat.h>
@@ -23,7 +27,7 @@
 
 #ifdef SHADOWPW
 #include <shadow.h>
-#endif
+#endif /* SHADOWPW */
 
 #include <pwd.h>
 #include <grp.h>
@@ -190,10 +194,10 @@ static int login(AFPObj *obj, struct passwd *pwd, void (*logout)(void))
     if (initgroups( pwd->pw_name, pwd->pw_gid ) < 0) {
 #ifdef RUN_AS_USER
       syslog(LOG_INFO, "running with uid %d", geteuid());
-#else
+#else /* RUN_AS_USER */
       syslog(LOG_ERR, "login: %m");
       return AFPERR_BADUAM;
-#endif
+#endif /* RUN_AS_USER */
 
     }
 
@@ -206,7 +210,7 @@ static int login(AFPObj *obj, struct passwd *pwd, void (*logout)(void))
 #ifdef ADMIN_GRP
 #ifdef DEBUG
     syslog(LOG_INFO, "obj->options.admingid == %d", obj->options.admingid);
-#endif DEBUG
+#endif /* DEBUG */
     if (obj->options.admingid != 0) {
        int i;
        for (i = 0; i < ngroups; i++) {
@@ -215,7 +219,7 @@ static int login(AFPObj *obj, struct passwd *pwd, void (*logout)(void))
     }
     if (admin) syslog( LOG_INFO, "admin login -- %s", pwd->pw_name );
     if (!admin)
-#endif
+#endif /* DEBUG */
        if (setegid( pwd->pw_gid ) < 0 || seteuid( pwd->pw_uid ) < 0) {
            syslog( LOG_ERR, "login: %m" );
            return AFPERR_BADUAM;
@@ -227,7 +231,7 @@ static int login(AFPObj *obj, struct passwd *pwd, void (*logout)(void))
 #ifdef ADMIN_GRP
     if (admin) uuid = 0;
     else
-#endif ADMIN_GRP
+#endif /* ADMIN_GRP */
     uuid = pwd->pw_uid;
 
     afp_switch = postauth_switch;
index 4a5894b7c7a80183840a67c6c91b28e3cb825dfc..1b8764a84bd7ade1380721a2c6e2e50d245fd1e8 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: auth.h,v 1.2 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
@@ -6,8 +8,14 @@
 #ifndef AFPD_AUTH_H
 #define AFPD_AUTH_H 1
 
+#ifdef HAVE_LIMITS_H
 #include <limits.h>
+#endif /* HAVE_LIMITS_H */
+
+#ifdef HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
+#endif /* HAVE_SYS_CDEFS_H */
+
 #include "globals.h"
 
 struct afp_versions {
@@ -37,4 +45,5 @@ extern int    afp_logincont __P((AFPObj *, char *, int, char *, int *));
 extern int     afp_changepw __P((AFPObj *, char *, int, char *, int *));
 extern int     afp_logout __P((AFPObj *, char *, int, char *, int *));
 extern int      afp_getuserinfo __P((AFPObj *, char *, int, char *, int *));
+
 #endif /* auth.h */
index eb6013cdd00ef6a82e55cf59aea79d93cffb5225..c8b7eb119a647b90cbd03a433baa6fd9eaf2e9b8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: codepage.c,v 1.4 2001-05-31 18:48:32 srittau Exp $
+ * $Id: codepage.c,v 1.5 2001-06-20 18:33:04 rufustfirefly Exp $
  *
  * Copyright (c) 2000 Adrian Sun
  * All Rights Reserved. See COPYRIGHT.
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include <syslog.h>
 
 #include <netatalk/endian.h>
@@ -66,7 +70,7 @@ static int add_code(struct codepage *page, unsigned char *from,
 {
 #if 0
   union codepage_val *ptr;
-#endif
+#endif /* 0 */
 
   if (page->quantum < 1) /* no quantum given. don't do anything */
     return 1;
@@ -90,7 +94,7 @@ static int add_code(struct codepage *page, unsigned char *from,
     
     map[*from].hash
   }
-#endif
+#endif /* 0 */
   return 0;
 }
 
index 130e0ceab031949d7ab13b8be8e914cfe053ba4d..598623a82968385b23015232ed67f16edc1f4fd3 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * $Id: codepage.h,v 1.2 2001-06-20 18:33:04 rufustfirefly Exp $
+ */
+
 #ifndef AFPD_CODEPAGE_H
 #define AFPD_CODEPAGE_H 1
 
@@ -44,4 +48,5 @@
 #define CODEPAGE_BADCHAR_SET      (1 << 0) 
 #define CODEPAGE_BADCHAR_ANYWHERE (1 << 1)  
 #define CODEPAGE_BADCHAR_QUANTUM  (1 << 2) 
+
 #endif
index e1dbf1890207b37a99b1581dd707bf654bc0e413..acfe6197e00f1dd5ab74bb05bff3f7b5c68aac46 100644 (file)
@@ -1,11 +1,12 @@
 /*
- * $Id: desktop.c,v 1.4 2001-05-31 18:48:32 srittau Exp $
+ * $Id: desktop.c,v 1.5 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
  * See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <sys/syslog.h>
 #include <errno.h>
 #include <atalk/adouble.h>
 #include <atalk/util.h>
 #include <dirent.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
+#ifdef HAVE_FCNTL_H
 #include <unistd.h>
+#endif /* HAVE_FCNTL_H */
 
 #include "volume.h"
 #include "directory.h"
@@ -513,16 +518,16 @@ int afp_geticon(obj, ibuf, ibuflen, rbuf, rbuflen )
 #ifdef SENDFILE_FLAVOR_LINUX
          if (sendfile(dsi->socket, si.sdt_fd, &offset, dsi->datasize) < 0)
            goto geticon_exit;
-#endif
+#endif /* SENDFILE_FLAVOR_LINUX */
          
 #ifdef SENDFILE_FLAVOR_BSD
          if (sendfile(si.sdt_fd, dsi->socket, offset, rc, NULL, NULL, 0) < 0)
            goto geticon_exit;
-#endif
+#endif /* SENDFILE_FLAVOR_BSD */
          
          goto geticon_done;
        }
-#endif
+#endif /* SENDFILE_FLAVOR_LINUX || SENDFILE_FLAVOR_BSD */
 
        buflen = read(si.sdt_fd, rbuf, *rbuflen);
        if (buflen < 0) 
@@ -622,18 +627,18 @@ char *mtoupath(const struct vol *vol, char *mpath)
                                vol->v_flags & AFPVOL_MAPASCII)) {
            *u = vol->v_mtoupage->map[*m].value;
        } else
-#endif
+#endif /* 1 */
 #if AD_VERSION == AD_VERSION1
          if ((((vol->v_flags & AFPVOL_NOHEX) == 0) && 
                   (!isascii(*m) || *m == '/')) || 
                   (((vol->v_flags & AFPVOL_USEDOTS) == 0) &&
                    ( i == 0 && (*m == '.' )))) {
-#else
+#else /* AD_VERSION == AD_VERSION1 */
           if ((((vol->v_flags & AFPVOL_NOHEX) == 0) && 
                   (!isprint(*m) || *m == '/')) || 
                   (((vol->v_flags & AFPVOL_USEDOTS) == 0) &&
                    ( i == 0 && (*m == '.' )))) {
-#endif
+#endif /* AD_VERSION == AD_VERSION1 */
            /* do hex conversion. */ 
            *u++ = ':';
            *u++ = hexdig[ ( *m & 0xf0 ) >> 4 ];
@@ -668,7 +673,7 @@ char *utompath(const struct vol *vol, char *upath)
                                (vol->v_flags & AFPVOL_MAPASCII))) {
            *m = vol->v_utompage->map[*u].value;
        } else 
-#endif
+#endif /* 1 */
          if ( *u == ':' && *(u+1) != '\0' && islxdigit( *(u+1)) &&
                  *(u+2) != '\0' && islxdigit( *(u+2))) {
            ++u;
index 0427a181889a6374accbddd9bc09ffcd7ebd280d..1f636272b83b98964b9068ca5aa027ef5c6f74e9 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: desktop.h,v 1.2 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  *
@@ -64,4 +66,5 @@ extern int      afp_closedt __P((AFPObj *, char *, int, char *, int *));
 extern int     afp_addicon __P((AFPObj *, char *, int, char *, int *));
 extern int     afp_geticoninfo __P((AFPObj *, char *, int, char *, int *));
 extern int     afp_geticon __P((AFPObj *, char *, int, char *, int *));
+
 #endif
index 61de52058d5a80b02ee8c99d8e57ac33486cf597..818e60f5434e0e95a4b52e3aa188c6576ff73000 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: directory.c,v 1.11 2001-06-06 13:36:36 rufustfirefly Exp $
+ * $Id: directory.c,v 1.12 2001-06-20 18:33:04 rufustfirefly Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -10,7 +10,7 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <sys/syslog.h>
 #include <sys/types.h>
@@ -27,7 +27,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <dirent.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 #include <grp.h>
 #include <pwd.h>
 #include <string.h>
@@ -42,7 +44,7 @@
 
 #ifdef FORCE_UIDGID
 #include "uid.h"
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
 
 struct dir     *curdir;
 
@@ -233,7 +235,7 @@ static struct dir *dir_rmrecolor(vol, dir)
 
   return dir;
 }
-#endif
+#endif /* 0 */
 
 
 /* remove the node from the tree. this is just like insertion, but
@@ -246,7 +248,7 @@ static void dir_remove( vol, dir )
 #ifdef REMOVE_NODES
     struct ofork *of, *last;
     struct dir *node, *leaf;
-#endif
+#endif /* REMOVE_NODES */
 
     if (!dir || (dir == SENTINEL))
         return;
@@ -255,7 +257,7 @@ static void dir_remove( vol, dir )
 #ifndef REMOVE_NODES 
     free(dir->d_name);
     dir->d_name = NULL;
-#else
+#else /* ! REMOVE_NODES */
 
     /* go searching for a node with at most one child */
     if ((dir->d_left == SENTINEL) || (dir->d_right == SENTINEL)) {
@@ -335,7 +337,7 @@ static void dir_remove( vol, dir )
       dir_rmrecolor(vol, leaf);
     free(node->d_name);
     free(node);
-#endif
+#endif /* ! REMOVE_NODES */
 }
 
 
@@ -721,7 +723,7 @@ cname( vol, dir, cpath )
            data++;
            len--;
        }
-#endif notdef
+#endif /* notdef */
        *p = '\0';
 
        if ( p != path ) { /* we got something */
@@ -820,14 +822,14 @@ int getdirparams(vol, bitmap, upath, dir, st, buf, buflen )
     u_int16_t          ashort;
 #ifdef FORCE_UIDGID
        uidgidset               *uidgid;
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
 
     memset(&ad, 0, sizeof(ad));
 
 #ifdef FORCE_UIDGID
        save_uidgid ( uidgid );
        set_uidgid ( vol );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
 
     if ( ad_open( upath, ADFLAGS_HF|ADFLAGS_DIR, O_RDONLY, 
                  DIRBITS | 0777, &ad) < 0 ) {
@@ -965,11 +967,11 @@ int getdirparams(vol, bitmap, upath, dir, st, buf, buflen )
 #ifndef SENDFILE_FLAVOR_LINUX /* ignore this section if it's linux */
 #ifdef HAVE_ACCESS
            accessmode( upath, &ma, dir );
-#endif HAVE_ACCESS
-#endif SENDFILE_FLAVOR_LINUX
+#endif /* HAVE_ACCESS */
+#endif /* SENDFILE_FLAVOR_LINUX */
 #ifdef AFS     /* If only AFS defined, access() works only for AFS filesystems */ 
            afsmode( upath, &ma, dir );
-#endif AFS
+#endif /* AFS */
            *data++ = ma.ma_user;
            *data++ = ma.ma_world;
            *data++ = ma.ma_group;
@@ -995,7 +997,7 @@ int getdirparams(vol, bitmap, upath, dir, st, buf, buflen )
            }
 #ifdef FORCE_UIDGID
                restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
            return( AFPERR_BITMAP );
        }
        bitmap = bitmap>>1;
@@ -1085,13 +1087,13 @@ int setdirparams(vol, path, bitmap, buf )
     int                 err = AFP_OK;
 #ifdef FORCE_UIDGID
        uidgidset               *uidgid;
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
 
     upath = mtoupath(vol, path);
     memset(&ad, 0, sizeof(ad));
 #ifdef FORCE_UIDGID
        save_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
     if (ad_open( upath, vol_noadouble(vol)|ADFLAGS_HF|ADFLAGS_DIR, 
                 O_RDWR|O_CREAT, 0666, &ad) < 0) {
        /*
@@ -1107,7 +1109,7 @@ int setdirparams(vol, path, bitmap, buf )
                  (1<<DIRPBIT_MDATE)|(1<<DIRPBIT_PDINFO)))) {
 #ifdef FORCE_UIDGID
          restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
          return AFPERR_ACCESS;
        }
 
@@ -1256,7 +1258,7 @@ int setdirparams(vol, path, bitmap, buf )
                    }
                    break;
                }
-#endif
+#endif /* 0 */
 
            if ( setdirowner( -1, ntohl(aint), vol_noadouble(vol) ) < 0 ) {
                switch ( errno ) {
@@ -1300,7 +1302,7 @@ int setdirparams(vol, path, bitmap, buf )
                    goto setdirparam_done;
                }
            }
-#endif
+#endif /* 0 */
 
            if ( setdirmode( mtoumode( &ma ), vol_noadouble(vol),
                              (vol->v_flags & AFPVOL_DROPBOX)) < 0 ) {
@@ -1346,7 +1348,7 @@ setdirparam_done:
 
 #ifdef FORCE_UIDGID
        restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
     return err;
 }
 
@@ -1364,7 +1366,10 @@ int afp_createdir(obj, ibuf, ibuflen, rbuf, rbuflen )
     u_int16_t          vid;
 #ifdef FORCE_UIDGID
        uidgidset               *uidgid;
-#endif FORCE_UIDGID
+
+       /* allocate memory */
+       uidgidset = malloc(sizeof(uidgidset));
+#endif /* FORCE_UIDGID */
 
     *rbuflen = 0;
     ibuf += 2;
@@ -1404,12 +1409,12 @@ int afp_createdir(obj, ibuf, ibuflen, rbuf, rbuflen )
 #ifdef FORCE_UIDGID
        save_uidgid ( uidgid );
        set_uidgid  ( vol );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
 
     if ( ad_mkdir( upath, DIRBITS | 0777 ) < 0 ) {
 #ifdef FORCE_UIDGID
        restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
        switch ( errno ) {
        case ENOENT :
            return( AFPERR_NOOBJ );
@@ -1430,7 +1435,7 @@ int afp_createdir(obj, ibuf, ibuflen, rbuf, rbuflen )
     if (stat(upath, &st) < 0) {
 #ifdef FORCE_UIDGID
          restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
       return AFPERR_MISC;
        }
 
@@ -1438,14 +1443,14 @@ int afp_createdir(obj, ibuf, ibuflen, rbuf, rbuflen )
                       strlen(upath), &st)) == NULL) {
 #ifdef FORCE_UIDGID
          restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
       return AFPERR_MISC;
        }
 
     if ( movecwd( vol, dir ) < 0 ) {
 #ifdef FORCE_UIDGID
          restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
        return( AFPERR_PARAM );
     }
 
@@ -1456,7 +1461,7 @@ int afp_createdir(obj, ibuf, ibuflen, rbuf, rbuflen )
          goto createdir_done;
 #ifdef FORCE_UIDGID
          restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
       return( AFPERR_ACCESS );
     }
     
@@ -1472,7 +1477,7 @@ createdir_done:
     setvoltime(obj, vol );
 #ifdef FORCE_UIDGID
        restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
     return( AFP_OK );
 }
 
@@ -1570,7 +1575,9 @@ int deletecurdir( vol, path, pathlen )
     DIR *dp;
 #ifdef FORCE_UIDGID
        uidgidset               *uidgid;
-#endif FORCE_UIDGID
+
+       uidgid = malloc(sizeof(uidgidset));
+#endif /* FORCE_UIDGID */
 
     if ( curdir->d_parent == NULL ) {
        return( AFPERR_ACCESS );
@@ -1585,7 +1592,7 @@ int deletecurdir( vol, path, pathlen )
 #ifdef FORCE_UIDGID
        save_uidgid ( uidgid );
        set_uidgid  ( vol );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
 
     /* delete stray .AppleDouble files. this happens to get .Parent files
        as well. */
@@ -1602,7 +1609,7 @@ int deletecurdir( vol, path, pathlen )
          closedir(dp);
 #ifdef FORCE_UIDGID
        restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
          return AFPERR_DIRNEMPT;
        }
 
@@ -1614,19 +1621,19 @@ int deletecurdir( vol, path, pathlen )
          case EACCES :
 #ifdef FORCE_UIDGID
                restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
            return( AFPERR_ACCESS );
          case EROFS:
 #ifdef FORCE_UIDGID
                restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
            return AFPERR_VLOCK;
          case ENOENT :
            continue;
          default :
 #ifdef FORCE_UIDGID
                restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
            return( AFPERR_PARAM );
          }
        }
@@ -1641,23 +1648,23 @@ int deletecurdir( vol, path, pathlen )
        case ENOTEMPTY :
 #ifdef FORCE_UIDGID
                restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
            return( AFPERR_DIRNEMPT );
        case EROFS:
 #ifdef FORCE_UIDGID
                restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
            return AFPERR_VLOCK;
        case EPERM:
        case EACCES :
 #ifdef FORCE_UIDGID
                restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
            return( AFPERR_ACCESS );
        default :
 #ifdef FORCE_UIDGID
                restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
            return( AFPERR_PARAM );
        }
     }
@@ -1673,7 +1680,7 @@ int deletecurdir( vol, path, pathlen )
        if ((lstat(de->d_name, &st) == 0) && !S_ISLNK(st.st_mode)) {
 #ifdef FORCE_UIDGID
                restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
          return AFPERR_DIRNEMPT;
        }
 
@@ -1683,19 +1690,19 @@ int deletecurdir( vol, path, pathlen )
          case EACCES :
 #ifdef FORCE_UIDGID
                restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
            return( AFPERR_ACCESS );
          case EROFS:
 #ifdef FORCE_UIDGID
                restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
            return AFPERR_VLOCK;
          case ENOENT :
            continue;
          default :
 #ifdef FORCE_UIDGID
                restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
            return( AFPERR_PARAM );
          }
        }
@@ -1706,7 +1713,7 @@ int deletecurdir( vol, path, pathlen )
     if ( movecwd( vol, curdir->d_parent ) < 0 ) {
 #ifdef FORCE_UIDGID
                restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
        return( AFPERR_NOOBJ );
     }
 
@@ -1715,28 +1722,28 @@ int deletecurdir( vol, path, pathlen )
        case ENOENT :
 #ifdef FORCE_UIDGID
                restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
            return( AFPERR_NOOBJ );
        case ENOTEMPTY :
 #ifdef FORCE_UIDGID
                restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
            return( AFPERR_DIRNEMPT );
        case EPERM:
        case EACCES :
 #ifdef FORCE_UIDGID
                restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
            return( AFPERR_ACCESS );
        case EROFS:
 #ifdef FORCE_UIDGID
                restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
            return AFPERR_VLOCK;
        default : 
 #ifdef FORCE_UIDGID
                restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
            return( AFPERR_PARAM );
        }
     }
@@ -1744,12 +1751,12 @@ int deletecurdir( vol, path, pathlen )
     dirchildremove(curdir, fdir);
 #if AD_VERSION > AD_VERSION1
     cnid_delete(vol->v_db, fdir->d_did);
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
     dir_remove( vol, fdir );
 
 #ifdef FORCE_UIDGID
        restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
     return( AFP_OK );
 }
 
@@ -1862,7 +1869,7 @@ int afp_closedir(obj, ibuf, ibuflen, rbuf, rbuflen )
     struct dir   *dir;
     u_int16_t    vid;
     u_int32_t    did;
-#endif
+#endif /* 0 */
 
    *rbuflen = 0;
 
@@ -1883,7 +1890,7 @@ int afp_closedir(obj, ibuf, ibuflen, rbuf, rbuflen )
     }
 
     /* dir_remove -- deletedid */
-#endif
+#endif /* 0 */
 
     return AFP_OK;
 }
@@ -1902,6 +1909,8 @@ int afp_opendir(obj, ibuf, ibuflen, rbuf, rbuflen )
     u_int16_t          vid;
 #ifdef FORCE_UIDGID
        uidgidset               *uidgid;
+
+       uidgid = malloc(sizeof(uidgidset));
 #endif /* FORCE_UIDGID */
 
     *rbuflen = 0;
index 87acca8fd77ae4662ba91171c4bb26b7ed19fb8f..6de12ababceb6be9b2b7a16f41622dcd15368594 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: directory.h,v 1.2 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  *
@@ -77,7 +79,7 @@ struct dir {
 /* setgid directories */
 #ifndef DIRBITS
 #define DIRBITS S_ISGID
-#endif
+#endif /* DIRBITS */
 
 #define DIRF_FSMASK    (3<<0)
 #define DIRF_NOFS      (0<<0)
@@ -124,9 +126,9 @@ struct dir {
                                       & 0x00ffffff)
 #define CNID_FILE(a)  (((a) & 0x1) << 31)
 #define CNID(a,b)     (CNID_DEV(a) | CNID_INODE(a) | CNID_FILE(b))
-#else
+#else /* AFS */
 #define CNID(a,b)     (((a)->st_ino & 0x7fffffff) | CNID_FILE(b))
-#endif
+#endif /* AFS */
 
 
 struct maccess {
index 94c0d61d45519a9635b673a1e0d397301cc1c16f..d67627e8e0cde591dc766b59749cfd27bffd298f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: enumerate.c,v 1.4 2001-06-06 13:36:36 rufustfirefly Exp $
+ * $Id: enumerate.c,v 1.5 2001-06-20 18:33:04 rufustfirefly Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -7,7 +7,7 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -48,7 +48,7 @@ adddir( vol, dir, name, namlen, upath, upathlen, st )
     struct dir *cdir, *edir;
 #if AD_VERSION > AD_VERSION1
     struct adouble ad;
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
 
 #ifndef USE_LASTDID
     struct stat lst, *lstp;
index 0ad5cf8a568a0228a8be60b464d4fef268e714b9..898f89e053432d88e95afb18436b9927ff0e6257 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: file.c,v 1.21 2001-06-19 18:04:39 rufustfirefly Exp $
+ * $Id: file.c,v 1.22 2001-06-20 18:33:04 rufustfirefly Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
 
 #include <stdio.h>
 #include <stdlib.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include <string.h>
 #include <utime.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 #include <dirent.h>
 #include <sys/mman.h>
 #include <errno.h>
@@ -558,6 +562,8 @@ int setfilparams(vol, path, bitmap, buf )
 
 #ifdef FORCE_UIDGID
        uidgidset               *uidgid;
+
+       uidgid = malloc(sizeof(uidgidset));
 #endif /* FORCE_UIDGID */
 
 #ifdef DEBUG
index 4848b5069e1338a79fe85e4a1c0556ccbc2c845d..4e7e77c7bd8666c85989dc521827db951a89f481 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: file.h,v 1.2 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  *
@@ -89,10 +91,10 @@ extern int  afp_createfile __P((AFPObj *, char *, int, char *, int *));
 extern int      afp_createid __P((AFPObj *, char *, int, char *, int *));
 extern int      afp_resolveid __P((AFPObj *, char *, int, char *, int *));
 extern int      afp_deleteid __P((AFPObj *, char *, int, char *, int *));
-#else
+#else /* AD_VERSION > AD_VERSION1 */
 #define afp_createid      afp_null
 #define afp_resolveid     afp_null
 #define afp_deleteid      afp_null
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
 
 #endif
index 4c000fcfc76838e75c73bd5a14c7d6a8a2b9e92d..a53a1eb3a949cfc357e0cd8b999984d373d80b45 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: filedir.c,v 1.9 2001-06-06 19:04:25 rufustfirefly Exp $
+ * $Id: filedir.c,v 1.10 2001-06-20 18:33:04 rufustfirefly Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
 #include <atalk/cnid.h>
 #include <stdio.h>
 #include <stdlib.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 #include <dirent.h>
 #include <string.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 
 #include "directory.h"
 #include "desktop.h"
@@ -290,7 +294,7 @@ int afp_rename(obj, ibuf, ibuflen, rbuf, rbuflen )
     u_int16_t          vid;
 #if AD_VERSION > AD_VERSION1
     cnid_t              id;
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
 
 #ifdef DEBUG
     syslog(LOG_INFO, "begin afp_rename:");
@@ -373,7 +377,7 @@ int afp_rename(obj, ibuf, ibuflen, rbuf, rbuflen )
 
 #if AD_VERSION > AD_VERSION1
     id = cnid_get(vol->v_db, curdir->d_did, upath, strlen(upath));
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
 
     if ( rename( upath, newpath ) < 0 ) {
        switch ( errno ) {
@@ -390,7 +394,7 @@ int afp_rename(obj, ibuf, ibuflen, rbuf, rbuflen )
     if (stat(newpath, &st) < 0) /* this shouldn't fail */
       return AFPERR_MISC;
     cnid_update(vol->v_db, id, &st, curdir->d_did, newpath, strlen(newpath));
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
 
     if ( !odir ) {
         newadpath = obj->newtmp;
@@ -499,7 +503,7 @@ int afp_delete(obj, ibuf, ibuflen, rbuf, rbuflen )
 #if AD_VERSION > AD_VERSION1 /* get rid of entry */
         cnid_t id = cnid_get(vol->v_db, curdir->d_did, upath, strlen(upath));
        cnid_delete(vol->v_db, id);
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
     }
     if ( rc == AFP_OK ) {
        setvoltime(obj, vol );
@@ -559,7 +563,7 @@ int afp_moveandrename(obj, ibuf, ibuflen, rbuf, rbuflen )
     u_int16_t  vid;
 #if AD_VERSION > AD_VERSION1
     cnid_t      id;
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
 #ifdef DROPKLUDGE
     int                retvalue;
 #endif /* DROPKLUDGE */
@@ -605,7 +609,7 @@ int afp_moveandrename(obj, ibuf, ibuflen, rbuf, rbuflen )
 #if AD_VERSION > AD_VERSION1
        p = mtoupath(vol, path);
        id = cnid_get(vol->v_db, sdir->d_did, p, strlen(p));
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
        p = ctoupath( vol, sdir, newname );
     } else {
        odir = curdir;
@@ -614,7 +618,7 @@ int afp_moveandrename(obj, ibuf, ibuflen, rbuf, rbuflen )
        p = ctoupath( vol, odir->d_parent, newname );
 #if AD_VERSION > AD_VERSION1
        id = curdir->d_did; /* we already have the CNID */
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
     }
     /*
      * p now points to the full pathname of the source fs object.
@@ -694,7 +698,7 @@ int afp_moveandrename(obj, ibuf, ibuflen, rbuf, rbuflen )
        
        /* fix up the catalog entry */
        cnid_update(vol->v_db, id, &st, curdir->d_did, upath, strlen(upath));
-#endif      
+#endif /* AD_VERSION > AD_VERSION1 */
        setvoltime(obj, vol );
     }
 
index 23dcf2bf2a42d4eece708e22e2595264be71e1ad..4f73b90b2a0b6b80b8e2586ee2e379d6b20c84bb 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * $Id: filedir.h,v 1.3 2001-06-20 18:33:04 rufustfirefly Exp $
+ */
+
 #ifndef AFPD_FILEDIR_H
 #define AFPD_FILEDIR_H 1
 
@@ -18,4 +22,5 @@ extern int    afp_getfildirparams __P((AFPObj *, char *, int, char *,
                                         int *));
 extern int     afp_setfildirparams __P((AFPObj *, char *, int, char *, 
                                         int *));
+
 #endif
index 9a05b6c2f0f3160568c6830ec419753f0dcb008f..bd9d0a4ef002170a2d4781c71f9942e0de1db79d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: fork.c,v 1.4 2001-06-04 19:06:15 rufustfirefly Exp $
+ * $Id: fork.c,v 1.5 2001-06-20 18:33:04 rufustfirefly Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -7,11 +7,15 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 #include <dirent.h>
 #include <string.h>
 #include <errno.h>
@@ -182,15 +186,15 @@ static int getforkparams(ofork, bitmap, buf, buflen, attrbits )
            if (!(aint = cnid_add(ofork->of_vol->v_db, &st, 
                                  ofork->of_dir->d_did, 
                                  upath, strlen(upath), aint))) {
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
 #ifdef AFS
              aint = st.st_ino;
-#else AFS
+#else /* AFS */
              aint = ( st.st_dev << 16 ) | ( st.st_ino & 0x0000ffff );
-#endif AFS
+#endif /* AFS */
 #if AD_VERSION > AD_VERSION1
            }
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
            memcpy(data, &aint, sizeof( aint ));
            data += sizeof( aint );
            break;
@@ -525,7 +529,7 @@ int afp_setforkparams(obj, ibuf, ibuflen, rbuf, rbuflen )
     if ( flushfork( ofork ) < 0 ) {
        syslog( LOG_ERR, "afp_setforkparams: flushfork: %m" );
     }
-#endif AFS
+#endif /* AFS */
 
     return( AFP_OK );
 
@@ -847,7 +851,7 @@ int afp_read(obj, ibuf, ibuflen, rbuf, rbuflen)
       }
 
 afp_read_loop:
-#endif
+#endif /* HAVE_SENDFILE_READ */
 
       /* fill up our buffer. */
       while (*rbuflen > 0) {
@@ -1120,7 +1124,7 @@ int afp_write(obj, ibuf, ibuflen, rbuf, rbuflen)
 
 #ifdef AFS
     writtenfork = ofork;
-#endif AFS
+#endif /* AFS */
 
     if ( ofork->of_flags & AFPFORK_DATA) {
        eid = ADEID_DFORK;
@@ -1226,7 +1230,7 @@ int afp_write(obj, ibuf, ibuflen, rbuf, rbuflen)
          offset += cc;
          goto afp_write_done;
        }
-#endif
+#endif /* 0, was HAVE_SENDFILE_WRITE */
 
        /* loop until everything gets written. currently
          * dsi_write handles the end case by itself. */
@@ -1258,9 +1262,9 @@ afp_write_done:
     offset = htonl( offset );
 #if defined(__GNUC__) && defined(HAVE_GCC_MEMCPY_BUG)
     bcopy(&offset, rbuf, sizeof(offset));
-#else
+#else /* __GNUC__ && HAVE_GCC_MEMCPY_BUG */
     memcpy(rbuf, &offset, sizeof(offset));
-#endif
+#endif /* __GNUC__ && HAVE_GCC_MEMCPY_BUG */
     *rbuflen = sizeof(offset);
     return( AFP_OK );
 
index 78f07ccef78115c8ac8272e6c277535010c515c0..f1cfca517a263b77e839ed0db5558c402434a881 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: fork.h,v 1.2 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
@@ -69,4 +71,5 @@ extern int    afp_write __P((AFPObj *, char *, int, char *, int *));
 extern int     afp_flushfork __P((AFPObj *, char *, int, char *, int *));
 extern int     afp_flush __P((AFPObj *, char *, int, char *, int *));
 extern int     afp_closefork __P((AFPObj *, char *, int, char *, int *));
+
 #endif
index 88aed59fe2a5c291211adf582ebae9a584a621e4..7d3e5b488cf041c31fbe3f27fe194c55fc5919bc 100644 (file)
@@ -1,11 +1,13 @@
 /*
+ * $Id: gettok.c,v 1.3 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <sys/param.h>
 #include <string.h>
@@ -163,4 +165,4 @@ void parseline( token, user )
     }
     return;
 }
-#endif notdef
+#endif /* notdef */
index 1022b392978c64855539d969b943e81ddee3ec9f..48b161e5d57a3211370fc3f81d46e2fb83084b21 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: globals.h,v 1.5 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
 #ifdef ADMIN_GRP
 #include <grp.h>
 #include <sys/types.h>
-#endif
+#endif /* ADMIN_GRP */
 
+#ifdef HAVE_NETDB_H
 #include <netdb.h>  /* this isn't header-protected under ultrix */
+#endif /* HAVE_NETDB_H */
+
 #include <netatalk/at.h>
 #include <atalk/afp.h>
 #include <atalk/compat.h>
@@ -26,7 +31,6 @@
 
 #define MACFILELEN 31
 
-
 #define OPTION_DEBUG         (1 << 0)
 #define OPTION_USERVOLFIRST  (1 << 1)
 #define OPTION_NOUSERVOL     (1 << 2)
@@ -48,7 +52,7 @@ struct afp_options {
   char *authprintdir;
 #ifdef ADMIN_GRP
   gid_t admingid;
-#endif ADMIN_GRP
+#endif /* ADMIN_GRP */
 };
 
 #define AFPOBJ_TMPSIZ (MAXPATHLEN)
@@ -87,7 +91,7 @@ extern int  parseline  __P((int, char *));
 
 #ifndef NO_DDP
 extern void afp_over_asp __P((AFPObj *));
-#endif
+#endif /* NO_DDP */
 extern void afp_over_dsi __P((AFPObj *));
 
 #endif /* globals.h */
index 03839805b341e8fb8c232f7fe3a6a026eca8e2b9..d7d01ba0d13c21fe06bfda3919aaf78586ff03c2 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: icon.h,v 1.2 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
@@ -265,4 +267,5 @@ const u_char        icon[] = {      /* globe */
 #endif /*sun*/
 #endif /*vax*/
 #endif /*ultrix*/
+
 #endif
index 8442d2a7fbf33fd06e00324ff9a39d014cb97097..ca408aca1d34ef6b9fd6d1a5b3cd7bfdfb424c75 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: main.c,v 1.8 2001-06-07 17:18:26 rufustfirefly Exp $
+ * $Id: main.c,v 1.9 2001-06-20 18:33:04 rufustfirefly Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -7,13 +7,17 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 #include <signal.h>
 
 #include <sys/types.h>
@@ -71,7 +75,7 @@ static void afp_goaway(int sig)
 {
 #ifndef NO_DDP
     asp_kill(sig);
-#endif
+#endif /* ! NO_DDP */
     dsi_kill(sig);
     switch( sig ) {
     case SIGTERM :
index 837c3b5e72dfd0ddf7eb72a9872fe308c25848c9..9f84b76d73043c5b386513a459ff4365c2efcada 100644 (file)
@@ -1,17 +1,21 @@
 /* 
+ * $Id: messages.c,v 1.9 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved.  See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <string.h>
 #include <atalk/afp.h>
 #include <syslog.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include "globals.h"
 #include "misc.h"
 
@@ -42,7 +46,7 @@ void readmessage(void)
 
 #ifdef DEBUG
   syslog (LOG_DEBUG, "Reading file %s ", filename);
-#endif
+#endif /* DEBUG */
   
   message=fopen(filename, "r");
   if (message==NULL) {
@@ -86,10 +90,10 @@ void readmessage(void)
     }
 
     syslog (LOG_INFO, "Set server message to \"%s\"", servermesg);
-#endif
+#endif /* DEBUG */
   }
   free(filename);
-#endif
+#endif /* SERVERTEXT */
 }
 
 int afp_getsrvrmesg(obj, ibuf, ibuflen, rbuf, rbuflen)
index 16b7c330b6c28bfe0ea55649959bac916c0d5738..2ff9217166dd3482bd607c0e2397c8f7f79f6b55 100644 (file)
@@ -1,3 +1,7 @@
+/* 
+ * $Id: misc.h,v 1.2 2001-06-20 18:33:04 rufustfirefly Exp $
+ */
+
 #ifndef AFPD_MISC_H
 #define AFPD_MISC_H 1
 
 extern int     afp_getsrvrmesg __P((AFPObj *, char *, int, char *, int *));
 
 /* afs.c */
-# ifdef AFS
+#ifdef AFS
 extern int     afp_getdiracl __P((AFPObj *, char *, int, char *, int *));
 extern int     afp_setdiracl __P((AFPObj *, char *, int, char *, int *));
-# else AFS
+#else /* AFS */
 #define afp_getdiracl  NULL
 #define afp_setdiracl  NULL
-# endif AFS
+#endif /* AFS */
 
-# if defined( AFS ) && defined( UAM_AFSKRB )
+#if defined( AFS ) && defined( UAM_AFSKRB )
 extern int     afp_afschangepw __P((AFPObj *, char *, int, char *, int *));
-# else AFS UAM_AFSKRB
+#else /* AFS && UAM_AFSKRB */
 #define afp_afschangepw        NULL
-# endif AFS UAM_AFSKRB
+#endif /* AFS && UAM_AFSKRB */
 
 #endif
index 06209bc6f3581e4e69cac369ea4ffdf9958420a9..170aaa40e410786a5971ef0aec46b14140f1eb46 100644 (file)
@@ -1,4 +1,7 @@
-/* parts of this are lifted from the bsd quota program and are
+/*
+ * $Id: nfsquota.c,v 1.3 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
+ * parts of this are lifted from the bsd quota program and are
  * therefore under the following copyright:
  *
  * Copyright (c) 1980, 1990, 1993
@@ -13,7 +16,7 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <string.h>
@@ -23,7 +26,9 @@
 #include <sys/time.h>  /* <rpc/rpc.h> on ultrix doesn't include this */
 #include <syslog.h>
 
+#ifdef HAVE_NETDB_H
 #include <netdb.h>
+#endif /* HAVE_NETDB_H */
 #include <netinet/in.h>
 #include <rpc/rpc.h>
 #include <rpc/pmap_prot.h>
@@ -79,10 +84,10 @@ callaurpc(vol, prognum, versnum, procnum, inproc, in, outproc, out)
 #ifdef USE_OLD_RQUOTA
 #define GQR_STATUS gqr_status
 #define GQR_RQUOTA gqr_rquota
-#else
+#else /* USE_OLD_RQUOTA */
 #define GQR_STATUS status
 #define GQR_RQUOTA getquota_rslt_u.gqr_rquota
-#endif
+#endif /* USE_OLD_RQUOTA */
 
 int getnfsquota(const struct vol *vol, const int uid, const u_int32_t bsize,
                struct dqblk *dqp)
@@ -132,11 +137,11 @@ make sure that rpc.rquotad is running on %s.", vol->v_gvs);
 #ifdef __svr4__
     /* why doesn't using bsize work? */
 #define NFS_BSIZE (gq_rslt.GQR_RQUOTA.rq_bsize / DEV_BSIZE)
-#else
+#else /* __svr4__ */
     /* NOTE: linux' rquotad program doesn't currently report the
      * correct rq_bsize. */
 #define NFS_BSIZE (gq_rslt.GQR_RQUOTA.rq_bsize / bsize)
-#endif
+#endif /* __svr4__ */
 
     dqp->dqb_bhardlimit =
       gq_rslt.GQR_RQUOTA.rq_bhardlimit*NFS_BSIZE;
@@ -147,10 +152,10 @@ make sure that rpc.rquotad is running on %s.", vol->v_gvs);
 
 #ifdef ultrix
     dqp->dqb_bwarn = gq_rslt.GQR_RQUOTA.rq_btimeleft;
-#else
+#else /* ultrix */
     dqp->dqb_btimelimit =
       tv.tv_sec + gq_rslt.GQR_RQUOTA.rq_btimeleft;
-#endif
+#endif /* ultrix */
 
     *hostpath = ':';
     return AFP_OK;
@@ -164,4 +169,4 @@ make sure that rpc.rquotad is running on %s.", vol->v_gvs);
   *hostpath = ':';
   return AFPERR_PARAM;
 }
-#endif
+#endif /* ! NO_QUOTA_SUPPORT */
index f8d98a73cbbc8655e688d385cba2d3ce3c526535..cb4072e0819e01773956b5d042138e550bf40075 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ofork.c,v 1.3 2001-03-21 14:36:36 rufustfirefly Exp $
+ * $Id: ofork.c,v 1.4 2001-06-20 18:33:04 rufustfirefly Exp $
  *
  * Copyright (c) 1996 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -7,7 +7,7 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
index 03b352608af301187a46c599e269a34111ba1511..2ff4516b5d339b7eb4512c29f9fd186581f25782 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: passwd.c,v 1.3 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  *
@@ -23,7 +25,7 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <itc.h>
 #include <stdio.h>
index 98e817b76a6ddffa149adbdb5f5b46305fa22a88..8f92111f2891950423412800d39da70bd2a3e3b1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: quota.c,v 1.8 2001-06-20 14:51:13 rufustfirefly Exp $
+ * $Id: quota.c,v 1.9 2001-06-20 18:33:04 rufustfirefly Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <sys/param.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 #include <syslog.h>
 
 #include <atalk/afp.h>
index 6253400598de9845f94c5664cc5f329f4db6a2ee..19934b67f2efcf14de0d90517fd18ac7532c3586 100644 (file)
@@ -1,11 +1,13 @@
 /*
+ * $Id: status.c,v 1.3 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -17,8 +19,8 @@
 #include <sys/param.h>
 #ifndef USE_GETHOSTID
 #include <sys/sysctl.h>
-#endif
-#endif
+#endif /* USE_GETHOSTID */
+#endif /* BSD4_4 */
 
 #include <netatalk/at.h>
 #include <netatalk/endian.h>
@@ -95,9 +97,9 @@ static void status_machine(char *data)
     int                        len;
 #ifdef AFS
     const char         *machine = "afs";
-#else !AFS
+#else /* !AFS */
     const char         *machine = "unix";
-#endif
+#endif /* AFS */
 
     memcpy(&status, start + AFPSTATUS_MACHOFF, sizeof(status));
     data += ntohs( status );
@@ -122,7 +124,7 @@ static u_int16_t status_signature(char *data, int *servoffset, DSI *dsi,
 #ifdef BSD4_4
   int                  mib[2];
   size_t               len;
-#endif
+#endif /* BSD4_4 */
 
   status = data;
 
@@ -139,9 +141,9 @@ static u_int16_t status_signature(char *data, int *servoffset, DSI *dsi,
   mib[1] = KERN_HOSTID;
   len = sizeof(hostid);
   sysctl(mib, 2, &hostid, &len, NULL, 0);
-#else
+#else /* BSD4_4 && USE_GETHOSTID */
   hostid = gethostid();
-#endif
+#endif /* BSD4_4 && USE_GETHOSTID */
   if (!hostid) {
     if (dsi)
       hostid = dsi->server.sin_addr.s_addr;
@@ -242,7 +244,7 @@ static int status_netaddress(char *data, const int servoffset,
       memcpy(data, &ddpaddr->sat_port, sizeof(ddpaddr->sat_port));
       data += sizeof(ddpaddr->sat_port);
     }
-#endif
+#endif /* ! NO_DDP */
 
     /* return length of buffer */
     return (data - begin);
@@ -342,7 +344,7 @@ const void status_init(AFPConfig *aspconfig, AFPConfig *dsiconfig,
     aspconfig->signature = status + sigoff;
     aspconfig->statuslen = c;
   }
-#endif
+#endif /* ! NO_DDP */
 
   if (dsiconfig) {
     if (aspconfig) { /* copy to dsiconfig */
index d2038e0846fd9285c21381c05e313bfc25e59010..3a51a57ddc825a58053bbf8074600a11313d37e9 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * $Id: status.h,v 1.3 2001-06-20 18:33:04 rufustfirefly Exp $
+ */
+
 #ifndef AFPD_STATUS_H
 #define AFPD_STATUS_H 1
 
index 7f7ce973fb527ef116cd2658ef02a91c898c98ae..84cc5a7fdbac8a0ad73c8c4e22676cd833e70167 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: switch.c,v 1.3 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  *
@@ -23,7 +25,7 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>  /* to pick up NULL */
 #include <sys/stat.h> /* works around a bug */
index 38eaf67caf68fc19b96e0683205986c87342afa8..27e104f648b6eaf6f25c739e089d9d265a9d416a 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: switch.h,v 1.2 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  *
@@ -26,4 +28,5 @@
 
 extern int     (**afp_switch)();
 extern int     (*postauth_switch[])();
+
 #endif
index d22dcf196eddb777fadfa788e1a26facfd626164..f171d2a1ef2c3c877a196fcb44bfcdc7ab7fc322 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: uam.c,v 1.8 2001-05-31 18:48:32 srittau Exp $
+ * $Id: uam.c,v 1.9 2001-06-20 18:33:04 rufustfirefly Exp $
  *
  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved.  See COPYRIGHT.
@@ -7,21 +7,28 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 #include <ctype.h>
 #include <syslog.h>
 #include <sys/param.h>
 #include <sys/time.h>
+#ifdef HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif /* HAVE_DLFCN_H */
 
 #ifdef SHADOWPW
 #include <shadow.h>
-#endif SHADOWPW
+#endif /* SHADOWPW */
 
 #include <netatalk/endian.h>
 #include <atalk/asp.h>
@@ -201,7 +208,7 @@ struct passwd *uam_getname(char *name, const int len)
     }
   }
   endpwent();
-#endif
+#endif /* ! NO_REAL_USER_NAME */
 
   /* os x server doesn't keep anything useful if we do getpwent */
   return pwent ? getpwnam(name) : NULL;
index eedc600371801a862da8c32b517aee3ad87264a7..6e5b3c293053d7d52fa1e7151eb293e4cf4f088d 100644 (file)
@@ -1,4 +1,7 @@
-/* Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
+/*
+ * $Id: uam_auth.h,v 1.2 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
+ * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved.  See COPYRIGHT.
  *
  * interface between uam.c and auth.c
@@ -49,7 +52,6 @@ struct uam_obj {
     (a)->uam_next->uam_prev = (a)->uam_prev; \
 } while (0)
 
-
 extern struct uam_mod *uam_load __P((const char *, const char *));
 extern void uam_unload __P((struct uam_mod *));
 
index b38614649d25d12d7107edde6057417d5acf25b2..2078de1d6a84b1fe0eb5a59cd53f97d8cc7caef9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: uid.c,v 1.3 2001-02-23 22:16:15 rufustfirefly Exp $
+ * $Id: uid.c,v 1.4 2001-06-20 18:33:04 rufustfirefly Exp $
  * code: jeff@univrel.pr.uconn.edu
  *
  * These functions are abstracted here, so that all calls for resolving
@@ -9,7 +9,7 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 /* don't compile this file at all unless FORCE_UIDGID is set */
 #ifdef FORCE_UIDGID
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif
+#endif /* HAVE_UNISTD_H */
 
 void save_uidgid ( pair )
        uidgidset *pair;
 {
+       /* allocate the memory */
+       pair = malloc ( sizeof ( uidgidset ) );
+
+       /* then assign the values */
        (pair)->uid = geteuid ();
        (pair)->gid = getegid ();
 } /* end function void save_uidgid ( pair ) */
@@ -71,6 +75,9 @@ int user_to_uid ( username )
 {
        struct passwd *this_passwd;
 
+       /* free memory for pointer */
+       this_passwd = malloc ( sizeof ( struct passwd ) );
+
        /* check for anything */
        if ( strlen ( username ) < 1 ) return 0;
 
@@ -90,6 +97,9 @@ int group_to_gid ( group )
 {
        struct group *this_group;
 
+       /* free memory for pointer */
+       this_group = malloc ( sizeof ( struct group ) );
+
        /* check for anything */
        if ( strlen ( group ) < 1 ) return 0;
 
@@ -104,4 +114,4 @@ int group_to_gid ( group )
 
 } /* end function int group_to_gid ( group ) */
 
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
index 4a32806cafe1f86a6142516d330988d5b6e3ca9a..19dba748d9f943b9db9c2e4fb1d6b9b09de498d5 100644 (file)
@@ -1,11 +1,13 @@
 /*
- * $Id: unix.h,v 1.6 2001-05-22 19:13:36 rufustfirefly Exp $
+ * $Id: unix.h,v 1.7 2001-06-20 18:33:04 rufustfirefly Exp $
  */
 
 #ifndef AFPD_UNIX_H
 #define AFPD_UNIX_H
 
+#ifdef HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
+#endif /* HAVE_SYS_CDEFS_H */
 #include <netatalk/endian.h>
 #include "volume.h"
 
@@ -15,16 +17,6 @@ typedef int  mode_t;
 #endif /*i386*/
 #endif /*sun __svr4__*/
 
-
-/* some GLIBC/old-libc-isms */
-#if defined(__GNU_LIBRARY__) 
-#if __GNU_LIBRARY__ < 6
-#define HAVE_SYS_VFS_H
-#else
-#define HAVE_STATFS_H
-#endif
-#endif
-
 #if defined(HAVE_SYS_VFS_H) || defined( sun ) || defined( ibm032 ) 
 #include <sys/vfs.h>
 #endif /* HAVE_SYS_VFS_H || sun || ibm032 */
index 3a940602941e773353478abf626e6f001dcf3cdd..662b8dae6f20db545ded5b384fa232bc5c9b8fbc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: volume.c,v 1.7 2001-05-31 18:48:32 srittau Exp $
+ * $Id: volume.c,v 1.8 2001-06-20 18:33:04 rufustfirefly Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -7,7 +7,7 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <sys/time.h>
 #include <sys/syslog.h>
@@ -25,7 +25,9 @@
 #include <atalk/util.h>
 #include <atalk/cnid.h>
 #include <dirent.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 #include <stdio.h>
 #include <stdlib.h>
 #include <ctype.h>
 
 #ifndef MIN
 #define MIN(a, b) ((a) < (b) ? (a) : (b))
-#endif
+#endif /* ! MIN */
 
 #ifndef NO_LARGE_VOL_SUPPORT
 #if BYTE_ORDER == BIG_ENDIAN
 #define hton64(x)       (x)
 #define ntoh64(x)       (x)
-#else
+#else /* BYTE_ORDER == BIG_ENDIAN */
 #define hton64(x)       ((u_int64_t) (htonl(((x) >> 32) & 0xffffffffLL)) | \
                          (u_int64_t) ((htonl(x) & 0xffffffffLL) << 32))
 #define ntoh64(x)       (hton64(x))
-#endif
-#endif
+#endif /* BYTE_ORDER == BIG_ENDIAN */
+#endif /* ! NO_LARGE_VOL_SUPPORT */
 
 static struct vol *volumes = NULL;
 static int             lastvid = 0;
 #if AD_VERSION == AD_VERSION1
 static char            *Trash = "\02\024Network Trash Folder";
-#endif
+#endif /* AD_VERSION == AD_VERSION1 */
 static struct extmap   *extmap = NULL, *defextmap = NULL;
 
 #define VOLOPT_ALLOW      0  /* user allow list */
@@ -349,7 +351,7 @@ static void volset(struct vol_option *options, char *volname, int vlen,
       free(options[VOLOPT_DBPATH].c_value);
     
     options[VOLOPT_DBPATH].c_value = strdup(val + 1);
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
   } else if (optionok(tmp, "mapchars:",val)) {
     if (options[VOLOPT_MAPCHARS].c_value)
       free(options[VOLOPT_MAPCHARS].c_value);
@@ -372,7 +374,7 @@ static void volset(struct vol_option *options, char *volname, int vlen,
       free(options[VOLOPT_FORCEGID].c_value);
     options[VOLOPT_FORCEGID].c_value = strdup(val + 1);
 
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
 
   } else if (val) {
     /* ignore unknown options */
@@ -435,7 +437,7 @@ static int creatvol(const char *path, char *name, struct vol_option *options)
 
 #ifdef __svr4__
     volume->v_qfd = -1;
-#endif
+#endif /* __svr4__ */
     volume->v_vid = lastvid++;
     volume->v_lastdid = 3;
 
@@ -457,7 +459,7 @@ static int creatvol(const char *path, char *name, struct vol_option *options)
 #if AD_VERSION > AD_VERSION1
       if (options[VOLOPT_DBPATH].c_value)
        volume->v_dbpath = strdup(options[VOLOPT_DBPATH].c_value);
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
 
 #ifdef FORCE_UIDGID
 
@@ -473,7 +475,7 @@ static int creatvol(const char *path, char *name, struct vol_option *options)
        volume->v_forcegid = NULL; /* set as null so as to return 0 later on */
          }
 
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
 
     }
 
@@ -787,7 +789,7 @@ static int getvolspace( vol, bfree, btotal, xbfree, xbtotal, bsize )
     u_int32_t   maxsize;
 #ifndef NO_QUOTA_SUPPORT
     VolSpace   qfree, qtotal;
-#endif
+#endif /* ! NO_QUOTA_SUPPORT */
 
     spaceflag = AFPVOL_GVSMASK & vol->v_flags;
     /* report up to 2GB if afp version is < 2.2 (4GB if not) */
@@ -802,7 +804,7 @@ static int getvolspace( vol, bfree, btotal, xbfree, xbtotal, bsize )
            goto getvolspace_done;
        }
     }
-#endif AFS
+#endif /* AFS */
 
     if (( rc = ustatfs_getvolspace( vol, xbfree, xbtotal,
                                    bsize)) != AFP_OK ) {
@@ -819,7 +821,7 @@ static int getvolspace( vol, bfree, btotal, xbfree, xbtotal, bsize )
            goto getvolspace_done;
        }
     }
-#endif
+#endif /* ! NO_QUOTA_SUPPORT */
     vol->v_flags = ( ~AFPVOL_GVSMASK & vol->v_flags ) | AFPVOL_USTATFS;
 
 getvolspace_done:
@@ -889,9 +891,9 @@ static int getvolparams( bitmap, vol, st, buf, buflen )
        case VOLPBIT_ATTR :
 #if AD_VERSION > AD_VERSION1
            ashort = VOLPBIT_ATTR_FILEID;
-#else
+#else /* AD_VERSION > AD_VERSION1 */
            ashort = 0;
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
            /* check for read-only.
             * NOTE: we don't actually set the read-only flag unless
             *       it's passed in that way as it's possible to mount
@@ -957,9 +959,9 @@ static int getvolparams( bitmap, vol, st, buf, buflen )
            xbfree = hton64( xbfree );
 #if defined(__GNUC__) && defined(HAVE_GCC_MEMCPY_BUG)
            bcopy(&xbfree, data, sizeof(xbfree));
-#else
+#else /* __GNUC__ && HAVE_GCC_MEMCPY_BUG */
            memcpy(data, &xbfree, sizeof( xbfree ));
-#endif
+#endif /* __GNUC__ && HAVE_GCC_MEMCPY_BUG */
            data += sizeof( xbfree );
            break;
 
@@ -967,12 +969,12 @@ static int getvolparams( bitmap, vol, st, buf, buflen )
            xbtotal = hton64( xbtotal );
 #if defined(__GNUC__) && defined(HAVE_GCC_MEMCPY_BUG)
            bcopy(&xbtotal, data, sizeof(xbtotal));
-#else
+#else /* __GNUC__ && HAVE_GCC_MEMCPY_BUG */
            memcpy(data, &xbtotal, sizeof( xbtotal ));
-#endif
+#endif /* __GNUC__ && HAVE_GCC_MEMCPY_BUG */
            data += sizeof( xbfree );
            break;
-#endif
+#endif /* ! NO_LARGE_VOL_SUPPORT */
 
        case VOLPBIT_NAME :
            nameoff = data;
@@ -1077,7 +1079,7 @@ int afp_openvol(obj, ibuf, ibuflen, rbuf, rbuflen )
     char       *volname;
 #if AD_VERSION == AD_VERSION1
     char *p;
-#endif
+#endif /* AD_VERSION == AD_VERSION1 */
     struct vol *volume;
     struct dir *dir;
     int                len, ret, buflen;
@@ -1163,7 +1165,7 @@ int afp_openvol(obj, ibuf, ibuflen, rbuf, rbuflen )
      */
     p = Trash;
     cname( volume, volume->v_dir, &p );
-#endif
+#endif /* AD_VERSION == AD_VERSION1 */
 
     return( AFP_OK );
 
@@ -1205,7 +1207,7 @@ int afp_closevol(obj, ibuf, ibuflen, rbuf, rbuflen )
 #if AD_VERSION > AD_VERSION1
     cnid_close(vol->v_db);
     vol->v_db = NULL;
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
     return( AFP_OK );
 }
 
index 8713b6c3792a8a5cd84893957715d82988914eea..6731e28bd0d19befc9493ff3af5b1446b24ef3b7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: volume.h,v 1.4 2001-05-31 18:48:32 srittau Exp $
+ * $Id: volume.h,v 1.5 2001-06-20 18:33:04 rufustfirefly Exp $
  *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -52,18 +52,18 @@ struct vol {
 #if AD_VERSION > AD_VERSION1
     void                *v_db;
     char                *v_dbpath;
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
 #ifdef FORCE_UIDGID
        char                            *v_forceuid;
        char                            *v_forcegid;
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
 };
 
 #ifdef NO_LARGE_VOL_SUPPORT
 typedef u_int32_t VolSpace;
-#else
+#else /* NO_LARGE_VOL_SUPPORT */
 typedef u_int64_t VolSpace;
-#endif
+#endif /* NO_LARGE_VOL_SUPPORT */
 
 #define AFPVOL_OPEN    (1<<0)
 #define AFPVOL_DT      (1<<1)
@@ -150,4 +150,5 @@ extern int  afp_getvolparams __P((AFPObj *, char *, int, char *, int *));
 extern int     afp_setvolparams __P((AFPObj *, char *, int, char *, int *));
 extern int     afp_getsrvrparms __P((AFPObj *, char *, int, char *, int *));
 extern int     afp_closevol     __P((AFPObj *, char *, int, char *, int *));
+
 #endif
index ff623310ed4902df643b32973dbc0b896de9ada6..dee55d59b6f9acb36c47ed45341dfad36d725e3b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: util.h,v 1.2 2001-06-20 14:51:13 rufustfirefly Exp $
+ * $Id: util.h,v 1.3 2001-06-20 18:33:04 rufustfirefly Exp $
  */
 
 #ifndef _ATALK_UTIL_H
@@ -7,7 +7,9 @@
 
 #include <sys/cdefs.h>
 #include <sys/types.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include <netatalk/at.h>
 
 extern unsigned const char _diacasemap[], _dialowermap[];
@@ -33,6 +35,7 @@ extern void mod_close    __P((void *));
 #define mod_error()      ""
 #else /* ! HAVE_DLFCN_H */
 #include <dlfcn.h>
+
 #ifndef RTLD_NOW
 #define RTLD_NOW 1
 #endif /* ! RTLD_NOW */
index 984e7ff9a0261d11f32a9e97fa1cd4107d1415d6..6de1123818bacecd0c74a698c2d0c1a4c2a8e1be 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: module.c,v 1.3 2001-06-20 14:51:13 rufustfirefly Exp $
+ * $Id: module.c,v 1.4 2001-06-20 18:33:04 rufustfirefly Exp $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -49,9 +49,9 @@ void mod_close(void *module)
 
 #else /* HAVE_DLFCN_H */
 
-#ifdef DLSYM_PREPEND_UNDERSCORE
 #include <dlfcn.h>
 
+#ifdef DLSYM_PREPEND_UNDERSCORE
 void *mod_symbol(void *module, const char *name)
 {
    void *symbol;