All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch 2/3] tabled: return correct owner in lists
@ 2010-01-03  7:56 Pete Zaitcev
  0 siblings, 0 replies; only message in thread
From: Pete Zaitcev @ 2010-01-03  7:56 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Project Hail List

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@redhat.com>

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

commit 699fb8443f84b55c3cb6af471082527e177244da
Author: Master <zaitcev@niphredil.zaitcev.lan>
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);
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-01-03  7:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-03  7:56 [Patch 2/3] tabled: return correct owner in lists Pete Zaitcev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.