From d499cf5c0524b2266170f9fe1b7b53451b84aa73 Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Thu, 25 Feb 2010 13:34:47 -0800 Subject: [PATCH] auth: auth_uid needs to be in AuthCapsInfo as well. Conflicts: src/auth/Auth.h --- src/auth/Auth.h | 15 ++++++++++----- src/auth/cephx/CephxKeyServer.cc | 2 +- src/include/rados.h | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/auth/Auth.h b/src/auth/Auth.h index 0c43e4ccbe35d..577fa05c8240d 100644 --- a/src/auth/Auth.h +++ b/src/auth/Auth.h @@ -106,14 +106,14 @@ static inline ostream& operator<<(ostream& out, const EntityName& n) { struct EntityAuth { CryptoKey key; - __le64 uid; + __u64 auth_uid; map caps; void encode(bufferlist& bl) const { __u8 struct_v = 2; ::encode(struct_v, bl); ::encode(key, bl); - ::encode(uid, bl); + ::encode(auth_uid, bl); ::encode(caps, bl); } void decode(bufferlist::iterator& bl) { @@ -121,8 +121,8 @@ struct EntityAuth { ::decode(struct_v, bl); ::decode(key, bl); if (struct_v >= 2) - ::decode(uid, bl); - else uid = -1; + ::decode(auth_uid, bl); + else auth_uid = -1; ::decode(caps, bl); } }; @@ -134,15 +134,17 @@ static inline ostream& operator<<(ostream& out, const EntityAuth& a) { struct AuthCapsInfo { bool allow_all; + __u64 auth_uid; bufferlist caps; AuthCapsInfo() : allow_all(false) {} void encode(bufferlist& bl) const { - __u8 struct_v = 1; + __u8 struct_v = 2; ::encode(struct_v, bl); __u8 a = (__u8)allow_all; ::encode(a, bl); + ::encode(auth_uid, bl); ::encode(caps, bl); } void decode(bufferlist::iterator& bl) { @@ -151,6 +153,9 @@ struct AuthCapsInfo { __u8 a; ::decode(a, bl); allow_all = (bool)a; + if (struct_v >= 2) + ::decode(auth_uid, bl); + else auth_uid = -1; ::decode(caps, bl); } }; diff --git a/src/auth/cephx/CephxKeyServer.cc b/src/auth/cephx/CephxKeyServer.cc index 933168c4fc135..fceec626f917e 100644 --- a/src/auth/cephx/CephxKeyServer.cc +++ b/src/auth/cephx/CephxKeyServer.cc @@ -108,7 +108,7 @@ bool KeyServerData::get_caps(EntityName& name, string& type, AuthCapsInfo& caps_ if (capsiter != iter->second.caps.end()) { caps_info.caps = capsiter->second; } - + caps_info.auth_uid = iter->second.auth_uid; return true; } diff --git a/src/include/rados.h b/src/include/rados.h index fb7edd772e644..b3e8dbef40120 100644 --- a/src/include/rados.h +++ b/src/include/rados.h @@ -99,7 +99,7 @@ struct ceph_pg_pool { __le32 snap_epoch; /* epoch of last snap */ __le32 num_snaps; __le32 num_removed_snap_intervals; - __le64 uid; /* who owns the pg */ + __le64 auth_uid; /* who owns the pg */ } __attribute__ ((packed)); /* -- 2.39.5