/*
- * $Id: file.c,v 1.125 2009-11-27 15:45:40 franklahm Exp $
+ * $Id: file.c,v 1.126 2009-11-30 15:27:48 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
(1 << FILPBIT_RFLEN) |\
(1 << FILPBIT_EXTRFLEN) |\
(1 << FILPBIT_PDINFO) |\
+ (1 << FILPBIT_FNUM) |\
(1 << FILPBIT_UNIXPR)))
/* -------------------------- */
u_int32_t aint = 0;
if (vol->v_cdb != NULL) {
+ /* prime aint with what we think is the cnid, set did to zero for
+ catching moved files */
+ aint = ad_getid(adp, st->st_dev, st->st_ino, 0, vol->v_stamp);
+
aint = cnid_add(vol->v_cdb, st, did, upath, len, aint);
/* Throw errors if cnid_add fails. */
if (aint == CNID_INVALID) {
/*
- * $Id: dbd_lookup.c,v 1.13 2009-11-28 15:42:05 didg Exp $
+ * $Id: dbd_lookup.c,v 1.14 2009-11-30 15:27:48 didg Exp $
*
* Copyright (C) Joerg Lenneis 2003
* Copyright (C) Frank Lahm 2009
LOG(log_debug, logtype_cnid, "dbd_lookup(DID:%u/'%s',0x%llx/0x%llx): CNID resolve problem: server side rename oder reused inode",
ntohl(rqst->did), rqst->name, (unsigned long long)rqst->dev, (unsigned long long)rqst->ino);
/* Case 2) ? */
- if (strcmp(rqst->name, (char *)devdata.data + CNID_NAME_OFS) == 0) {
- rqst->cnid = id_devino;
- LOG(log_debug, logtype_cnid, "dbd_lookup: server side mv from one dir to another");
+ if (rqst->cnid == id_devino) {
+ LOG(log_debug, logtype_cnid, "dbd_lookup: server side mv (with resource fork)");
update = 1;
} else {
if ( ! roflag) {
/*
- * $Id: ad_attr.c,v 1.10 2009-07-21 13:41:16 didg Exp $
+ * $Id: ad_attr.c,v 1.11 2009-11-30 15:27:48 didg Exp $
*/
#ifdef HAVE_CONFIG_H
memcpy(&a_did, ad_entry(adp, ADEID_DID), sizeof(cnid_t));
if ( ((adp->ad_options & ADVOL_NODEV) || dev == st_dev)
- && ino == st_ino && a_did == did
+ && ino == st_ino && (!did || a_did == did)
&& !memcmp(stamp, temp, sizeof(temp))) {
memcpy(&aint, ad_entry(adp, ADEID_PRIVID), sizeof(aint));
return aint;
/*
- * $Id: cnid_dbd.c,v 1.14 2009-11-24 12:18:19 didg Exp $
+ * $Id: cnid_dbd.c,v 1.15 2009-11-30 15:27:48 didg Exp $
*
* Copyright (C) Joerg Lenneis 2003
* All Rights Reserved. See COPYING.
/* ---------------------- */
cnid_t cnid_dbd_add(struct _cnid_db *cdb, const struct stat *st,
const cnid_t did, char *name, const size_t len,
- cnid_t hint _U_)
+ cnid_t hint)
{
CNID_private *db;
struct cnid_dbd_rqst rqst;
rqst.ino = st->st_ino;
rqst.type = S_ISDIR(st->st_mode)?1:0;
+ rqst.cnid = hint;
rqst.did = did;
rqst.name = name;
rqst.namelen = len;