]> arthur.barton.de Git - netatalk.git/commitdiff
Only work with dbd volumes
authorFrank Lahm <franklahm@googlemail.com>
Sun, 10 Oct 2010 17:01:11 +0000 (19:01 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Sun, 10 Oct 2010 17:01:11 +0000 (19:01 +0200)
bin/ad/ad.c
bin/ad/ad.h
bin/ad/ad_util.c
include/atalk/util.h
include/atalk/volinfo.h

index deedaf76e57bef9a3837d9860a3cea4fa4790c76..013228c6bc6f76fdaa94d53a9a2c755cdcf1ff9d 100644 (file)
@@ -29,6 +29,8 @@
 #include <atalk/cnid.h>
 #include <atalk/volinfo.h>
 #include <atalk/logger.h>
+#include <atalk/util.h>
+
 #include "ad.h"
 
 static void usage_main(void)
index 85cdbda38a54d69dae44a40cbfaffad662f3dc67..6b8f01df3fe1a035c31ff744f37d1fccb4099be8 100644 (file)
@@ -25,8 +25,6 @@
 #include <atalk/volinfo.h>
 #include <atalk/cnid.h>
 
-#define STRCMP(a,b,c) (strcmp(a,c) b 0)
-
 #define DIR_DOT_OR_DOTDOT(a) \
         ((strcmp(a, ".") == 0) || (strcmp(a, "..") == 0))
 
index f951d25e9826698a9a89b65cef056b7163497d14..439acf007562d55061126b3d5b72f2192423f23a 100644 (file)
 #include <stdarg.h>
 #include <string.h>
 
+#include <atalk/util.h>
 #include <atalk/cnid.h>
 #include <atalk/volinfo.h>
 #include <atalk/bstrlib.h>
 #include <atalk/bstradd.h>
-#include <atalk/util.h>
 #include <atalk/logger.h>
 #include <atalk/errchk.h>
 #include <atalk/unicode.h>
@@ -80,9 +80,11 @@ void _log(enum logtype lt, char *fmt, ...)
 /*!
  * Load volinfo and initialize struct vol
  *
+ * Only opens "dbd" volumes ! 
+ *
  * @param path   (r)  path to evaluate
  * @param vol    (rw) structure to initialize 
-*
+ *
  * @returns 0 on success, exits on error
  */
 int openvol(const char *path, afpvol_t *vol)
@@ -94,6 +96,9 @@ int openvol(const char *path, afpvol_t *vol)
     /* try to find a .AppleDesktop/.volinfo */
     if (loadvolinfo((char *)path, &vol->volinfo) == 0) {
 
+        if (STRCMP(vol->volinfo.v_cnidscheme, != , "dbd"))
+            ERROR("\"%s\" isn't a \"dbd\" CNID volume!", vol->volinfo.v_path);
+
         if (vol_load_charsets(&vol->volinfo) == -1)
             ERROR("Error loading charsets!");
 
index ad917cd3062a219e7a8bf350f12a4266b5c03b41..32fd3cd3751c952f3325f7c423c7a86d337e47cc 100644 (file)
@@ -1,7 +1,3 @@
-/*
- * $Id: util.h,v 1.21 2010/02/28 22:29:16 didg Exp $
- */
-
 /*!
  * @file
  * Netatalk utility functions
@@ -47,6 +43,7 @@
 #define AFP_ASSERT(b)
 #endif /* NDEBUG */
 
+#define STRCMP(a,b,c) (strcmp(a,c) b 0)
 
 #ifdef WITH_SENDFILE
 extern ssize_t sys_sendfile (int __out_fd, int __in_fd, off_t *__offset,size_t __count);
index 2a95bef6fdf58beaa91ef96284a0b1c783e636dd..bd8c2a76e1bacadd7c3f75e736a9f299bdc7c94f 100644 (file)
@@ -1,7 +1,3 @@
-/*
- * $Id: volinfo.h,v 1.10 2009-12-03 12:47:37 franklahm Exp $
- */
-
 #ifndef _ATALK_VOLINFO_H
 #define _ATALK_VOLINFO_H 1