]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/volume.c
AC_HEADER_STDC autoconf change
[netatalk.git] / etc / afpd / volume.c
index b1a4b351dcbf74d4238759050d342068d7a7d866..3f9a0a37fb0dad8a8ce07b188c8657b44f8d14d4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: volume.c,v 1.10 2001-08-15 01:37:34 srittau Exp $
+ * $Id: volume.c,v 1.13 2001-09-06 20:00:59 rufustfirefly Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
 #include <stdio.h>
 #include <stdlib.h>
 #include <ctype.h>
+
+/* STDC check */
+#if STDC_HEADERS
 #include <string.h>
+#else /* STDC_HEADERS */
+#ifndef HAVE_STRCHR
+#define strchr index
+#define strrchr index
+#endif /* HAVE_STRCHR */
+char *strchr (), *strrchr ();
+#ifndef HAVE_MEMCPY
+#define memcpy(d,s,n) bcopy ((s), (d), (n))
+#define memmove(d,s,n) bcopy ((s), (d), (n))
+#endif /* ! HAVE_MEMCPY */
+#endif /* STDC_HEADERS */
+
 #include <pwd.h>
 #include <grp.h>
 #include <utime.h>
@@ -86,13 +101,14 @@ static struct extmap       *extmap = NULL, *defextmap = NULL;
                                ~u  -> make u illegal only as the first
                                       part of a double-byte character.
                             */
+#define VOLOPT_VETO      10  /* list of veto filespec */
 
 #ifdef FORCE_UIDGID
-#define VOLOPT_FORCEUID  10  /* force uid for username x */
-#define VOLOPT_FORCEGID  11  /* force gid for group x */
-#define VOLOPT_MAX        11
+#define VOLOPT_FORCEUID  11  /* force uid for username x */
+#define VOLOPT_FORCEGID  12  /* force gid for group x */
+#define VOLOPT_MAX       12
 #else /* normally, there are only 9 possible options */
-#define VOLOPT_MAX        9
+#define VOLOPT_MAX       10
 #endif /* FORCE_UIDGID */
 
 #define VOLOPT_NUM        (VOLOPT_MAX + 1)
@@ -301,6 +317,11 @@ static void volset(struct vol_option *options, char *volname, int vlen,
       free(options[VOLOPT_CODEPAGE].c_value);
     options[VOLOPT_CODEPAGE].c_value = get_codepage_path(nlspath, val + 1);
 
+  } else if (optionok(tmp, "veto:", val)) {
+    if (options[VOLOPT_VETO].c_value)
+      free(options[VOLOPT_VETO].c_value);
+    options[VOLOPT_VETO].c_value = strdup(val + 1);
+
   } else if (optionok(tmp, "casefold:", val)) {
     if (strcasecmp(val + 1, "tolower") == 0)
       options[VOLOPT_CASEFOLD].i_value = AFPVOL_UMLOWER;
@@ -458,6 +479,9 @@ static int creatvol(const char *path, char *name, struct vol_option *options)
       if (options[VOLOPT_PASSWORD].c_value) 
        volume->v_password = strdup(options[VOLOPT_PASSWORD].c_value);
 
+      if (options[VOLOPT_VETO].c_value) 
+       volume->v_veto = strdup(options[VOLOPT_VETO].c_value);
+
 #ifdef CNID_DB
       if (options[VOLOPT_DBPATH].c_value)
        volume->v_dbpath = strdup(options[VOLOPT_DBPATH].c_value);
@@ -1218,7 +1242,7 @@ int afp_closevol(obj, ibuf, ibuflen, rbuf, rbuflen )
 #ifdef CNID_DB
     cnid_close(vol->v_db);
     vol->v_db = NULL;
-#endif /* AD_VERSION > AD_VERSION1 */
+#endif /* CNID_DB */
     return( AFP_OK );
 }