summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_xattr_tdb.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-03-01 16:39:35 +0100
committerJelmer Vernooij <jelmer@samba.org>2009-03-01 16:39:35 +0100
commit09ac816b36e45fd537af2f7fe7c57a11f5c744f5 (patch)
tree4d5d44c27a2395a39efc62359f6e4b6976f2ba2e /source3/modules/vfs_xattr_tdb.c
parent235244f4cc707130dd130afce88bde49606bd501 (diff)
parent54bc27e9374742d37b1ed9012d1cfe8f5ace6d40 (diff)
downloadsamba-09ac816b36e45fd537af2f7fe7c57a11f5c744f5.tar.gz
samba-09ac816b36e45fd537af2f7fe7c57a11f5c744f5.tar.bz2
samba-09ac816b36e45fd537af2f7fe7c57a11f5c744f5.zip
Merge branch 'master' of git://git.samba.org/samba into teventfix
Conflicts: lib/tevent/pytevent.c
Diffstat (limited to 'source3/modules/vfs_xattr_tdb.c')
-rw-r--r--source3/modules/vfs_xattr_tdb.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/source3/modules/vfs_xattr_tdb.c b/source3/modules/vfs_xattr_tdb.c
index 44bfffb94e..4e37ed6477 100644
--- a/source3/modules/vfs_xattr_tdb.c
+++ b/source3/modules/vfs_xattr_tdb.c
@@ -100,6 +100,7 @@ static NTSTATUS xattr_tdb_load_attrs(TALLOC_CTX *mem_ctx,
NTSTATUS status;
TDB_DATA data;
+ /* For backwards compatibility only store the dev/inode. */
push_file_id_16((char *)id_buf, id);
if (db_ctx->fetch(db_ctx, mem_ctx,
@@ -122,6 +123,8 @@ static struct db_record *xattr_tdb_lock_attrs(TALLOC_CTX *mem_ctx,
const struct file_id *id)
{
uint8 id_buf[16];
+
+ /* For backwards compatibility only store the dev/inode. */
push_file_id_16((char *)id_buf, id);
return db_ctx->fetch_locked(db_ctx, mem_ctx,
make_tdb_data(id_buf, sizeof(id_buf)));
@@ -216,7 +219,7 @@ static ssize_t xattr_tdb_getxattr(struct vfs_handle_struct *handle,
return -1;
}
- id = SMB_VFS_FILE_ID_CREATE(handle->conn, sbuf.st_dev, sbuf.st_ino);
+ id = SMB_VFS_FILE_ID_CREATE(handle->conn, &sbuf);
return xattr_tdb_getattr(db, &id, name, value, size);
}
@@ -235,7 +238,7 @@ static ssize_t xattr_tdb_fgetxattr(struct vfs_handle_struct *handle,
return -1;
}
- id = SMB_VFS_FILE_ID_CREATE(handle->conn, sbuf.st_dev, sbuf.st_ino);
+ id = SMB_VFS_FILE_ID_CREATE(handle->conn, &sbuf);
return xattr_tdb_getattr(db, &id, name, value, size);
}
@@ -338,7 +341,7 @@ static int xattr_tdb_setxattr(struct vfs_handle_struct *handle,
return -1;
}
- id = SMB_VFS_FILE_ID_CREATE(handle->conn, sbuf.st_dev, sbuf.st_ino);
+ id = SMB_VFS_FILE_ID_CREATE(handle->conn, &sbuf);
return xattr_tdb_setattr(db, &id, name, value, size, flags);
}
@@ -358,7 +361,7 @@ static int xattr_tdb_fsetxattr(struct vfs_handle_struct *handle,
return -1;
}
- id = SMB_VFS_FILE_ID_CREATE(handle->conn, sbuf.st_dev, sbuf.st_ino);
+ id = SMB_VFS_FILE_ID_CREATE(handle->conn, &sbuf);
return xattr_tdb_setattr(db, &id, name, value, size, flags);
}
@@ -443,7 +446,7 @@ static ssize_t xattr_tdb_listxattr(struct vfs_handle_struct *handle,
return -1;
}
- id = SMB_VFS_FILE_ID_CREATE(handle->conn, sbuf.st_dev, sbuf.st_ino);
+ id = SMB_VFS_FILE_ID_CREATE(handle->conn, &sbuf);
return xattr_tdb_listattr(db, &id, list, size);
}
@@ -462,7 +465,7 @@ static ssize_t xattr_tdb_flistxattr(struct vfs_handle_struct *handle,
return -1;
}
- id = SMB_VFS_FILE_ID_CREATE(handle->conn, sbuf.st_dev, sbuf.st_ino);
+ id = SMB_VFS_FILE_ID_CREATE(handle->conn, &sbuf);
return xattr_tdb_listattr(db, &id, list, size);
}
@@ -543,7 +546,7 @@ static int xattr_tdb_removexattr(struct vfs_handle_struct *handle,
return -1;
}
- id = SMB_VFS_FILE_ID_CREATE(handle->conn, sbuf.st_dev, sbuf.st_ino);
+ id = SMB_VFS_FILE_ID_CREATE(handle->conn, &sbuf);
return xattr_tdb_removeattr(db, &id, name);
}
@@ -561,7 +564,7 @@ static int xattr_tdb_fremovexattr(struct vfs_handle_struct *handle,
return -1;
}
- id = SMB_VFS_FILE_ID_CREATE(handle->conn, sbuf.st_dev, sbuf.st_ino);
+ id = SMB_VFS_FILE_ID_CREATE(handle->conn, &sbuf);
return xattr_tdb_removeattr(db, &id, name);
}
@@ -628,7 +631,7 @@ static int xattr_tdb_unlink(vfs_handle_struct *handle, const char *path)
return -1;
}
- id = SMB_VFS_FILE_ID_CREATE(handle->conn, sbuf.st_dev, sbuf.st_ino);
+ id = SMB_VFS_FILE_ID_CREATE(handle->conn, &sbuf);
rec = xattr_tdb_lock_attrs(talloc_tos(), db, &id);
@@ -667,7 +670,7 @@ static int xattr_tdb_rmdir(vfs_handle_struct *handle, const char *path)
return -1;
}
- id = SMB_VFS_FILE_ID_CREATE(handle->conn, sbuf.st_dev, sbuf.st_ino);
+ id = SMB_VFS_FILE_ID_CREATE(handle->conn, &sbuf);
rec = xattr_tdb_lock_attrs(talloc_tos(), db, &id);