]> arthur.barton.de Git - netatalk.git/commitdiff
Check if we can get a DB stamp sucessfully in afs_openvol and fail
authorlenneis <lenneis>
Wed, 14 Jan 2004 23:15:19 +0000 (23:15 +0000)
committerlenneis <lenneis>
Wed, 14 Jan 2004 23:15:19 +0000 (23:15 +0000)
the open if not.

etc/afpd/volume.c
include/atalk/cnid.h
libatalk/cnid/cnid.c
libatalk/cnid/dbd/cnid_dbd.c

index 5b71a71539aba3349375fb2d6b044ffe6c74c288..5e9014dabba13c32ff98e52f9e6360e40293e078 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: volume.c,v 1.51.2.7.2.16 2004-01-08 04:17:21 bfernhomberg Exp $
+ * $Id: volume.c,v 1.51.2.7.2.17 2004-01-14 23:15:19 lenneis Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -1706,7 +1706,10 @@ int              ibuflen, *rbuflen;
         if ((volume->v_cdb->flags & CNID_FLAG_PERSISTENT)) {
 
             /* FIXME find db time stamp */
-            cnid_getstamp(volume->v_cdb, volume->v_stamp, sizeof(volume->v_stamp));
+            if (cnid_getstamp(volume->v_cdb, volume->v_stamp, sizeof(volume->v_stamp)) < 0) {
+               LOG (log_error, logtype_afpd, "Fatal error: Unable to get stamp value from CNID backend");
+               goto openvol_err;
+           }
        }
        else {
             p = Trash;
index b3a5a39320ad79cc915beeddb9e950348c85a98f..e0e61c0b202dbda4742ee388c31ae566897a4a26 100644 (file)
@@ -1,5 +1,5 @@
 /* 
- * $Id: cnid.h,v 1.9.6.4 2004-01-10 07:19:31 bfernhomberg Exp $
+ * $Id: cnid.h,v 1.9.6.5 2004-01-14 23:15:19 lenneis Exp $
  *
  * Copyright (c) 2003 the Netatalk Team
  * Copyright (c) 2003 Rafal Lewczuk <rlewczuk@pronet.pl>
@@ -95,7 +95,7 @@ int    cnid_delete(struct _cnid_db *cdb, cnid_t id);
 
 cnid_t cnid_get   (struct _cnid_db *cdb, const cnid_t did, const char *name,const int len);
 
-cnid_t cnid_getstamp(struct _cnid_db *cdb, void *buffer, const int len);
+int    cnid_getstamp(struct _cnid_db *cdb, void *buffer, const int len);
 
 cnid_t cnid_lookup(struct _cnid_db *cdb, const struct stat *st, const cnid_t did,
                        const char *name, const int len);
@@ -112,7 +112,11 @@ void cnid_close(struct _cnid_db *db);
 
 /*
  * $Log: cnid.h,v $
- * Revision 1.9.6.4  2004-01-10 07:19:31  bfernhomberg
+ * Revision 1.9.6.5  2004-01-14 23:15:19  lenneis
+ * Check if we can get a DB stamp sucessfully in afs_openvol and fail
+ * the open if not.
+ *
+ * Revision 1.9.6.4  2004/01/10 07:19:31  bfernhomberg
  * add cnid_init prototype
  *
  * Revision 1.9.6.3  2004/01/03 22:42:55  didg
index c97b625de1020bb19d5eb97e119dee8eab1163b2..7a4e3939027cbf346ab5ba46add1c3bd026f26c4 100644 (file)
@@ -1,5 +1,5 @@
 /* 
- * $Id: cnid.c,v 1.1.4.7 2004-01-03 22:21:09 didg Exp $
+ * $Id: cnid.c,v 1.1.4.8 2004-01-14 23:15:19 lenneis Exp $
  *
  * Copyright (c) 2003 the Netatalk Team
  * Copyright (c) 2003 Rafal Lewczuk <rlewczuk@pronet.pl>
@@ -223,7 +223,7 @@ cnid_t ret;
 }
 
 /* --------------- */
-cnid_t cnid_getstamp(struct _cnid_db *cdb,  void *buffer, const int len)
+int cnid_getstamp(struct _cnid_db *cdb,  void *buffer, const int len)
 {
 cnid_t ret;
 
index c6483a4cdf08a9d87177b86295dcb55f47bdea5e..b435cec5343ffdf9d899ef6e8aed67024a4f35d0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: cnid_dbd.c,v 1.1.4.14 2004-01-10 07:30:29 didg Exp $
+ * $Id: cnid_dbd.c,v 1.1.4.15 2004-01-14 23:15:19 lenneis Exp $
  *
  * Copyright (C) Joerg Lenneis 2003
  * All Rights Reserved.  See COPYING.
@@ -584,17 +584,9 @@ static int dbd_getstamp(CNID_private *db, void *buffer, const int len)
     struct cnid_dbd_rqst rqst;
     struct cnid_dbd_rply rply;
 
-    /* TODO: We should maybe also check len. At the moment we rely on the caller
-       to provide a buffer that is large enough for MAXPATHLEN plus
-       CNID_HEADER_LEN plus 1 byte, which is large enough for the maximum that
-       can come from the database. */
-
     memset(buffer, 0, len);
     dbd_initstamp(&rqst);
 
-    /* This mimicks the behaviour of the "regular" cnid_resolve. So far,
-       nobody uses the content of buffer. It only provides space for the
-       name in the caller. */
     rply.name = buffer;
 
     if (transmit(db, &rqst, &rply) < 0) {