[Patch 2/3] tabled: return correct owner in lists

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



For some reason we were printing the user which were executing the
request instead of the owner of the key in question, even before the
changeove to obj_vitals.

Signed-Off-By: Pete Zaitcev <zaitcev@xxxxxxxxxx>

---
 server/bucket.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

commit 699fb8443f84b55c3cb6af471082527e177244da
Author: Master <zaitcev@xxxxxxxxxxxxxxxxxxxxx>
Date:   Sun Jan 3 00:31:04 2010 -0700

    Print the correct owner.

diff --git a/server/bucket.c b/server/bucket.c
index 690da79..300a8a6 100644
--- a/server/bucket.c
+++ b/server/bucket.c
@@ -817,6 +817,7 @@ struct obj_vitals {
 	uint64_t		mtime;
 	struct db_obj_addr	addr;
 	char			md5[40];
+	char			owner[65];
 };
 
 static bool bucket_list_iter(const char *key, struct obj_vitals *v,
@@ -1021,6 +1022,7 @@ static bool bucket_list_keys(struct client *cli, const char *user,
 
 		memset(&v, 0, sizeof(v));
 		strcpy(v.md5, obj->md5);
+		strncpy(v.owner, obj->owner, sizeof(v.owner)-1);
 		if (!(GUINT32_FROM_LE(obj->flags) & DB_OBJ_INLINE))
 			memcpy(&v.addr, &obj->d.a, sizeof(v.addr));
 		v.mtime = GUINT64_FROM_LE(obj->mtime);
@@ -1096,8 +1098,8 @@ static bool bucket_list_keys(struct client *cli, const char *user,
 			 time2str(timestr, sizeof(timestr), vp->mtime / 1000000),
 			 vp->md5,
 			 (unsigned long long) vp->size,
-			 user,
-			 user);
+			 vp->owner,
+			 vp->owner);
 
 		content = g_list_append(content, s);
 
--
To unsubscribe from this list: send the line "unsubscribe hail-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Fedora Clound]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux