]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert a number of auth_uid commits.
authorGreg Farnum <gregf@hq.newdream.net>
Wed, 3 Mar 2010 21:02:06 +0000 (13:02 -0800)
committerGreg Farnum <gregf@hq.newdream.net>
Thu, 4 Mar 2010 01:15:48 +0000 (17:15 -0800)
Attempting to add an auth_uid to all the relevant structs has gotten too messy;
it *will* get messed up at some point in the future. So we're moving it into
the string map caps, and the machines can store it in their local structs
however they like.
Note to self: In future, do not attempt to extend mirrored structs without
great cause. Or else commit to making them properly-encapsulated objects.

Revert "auth: Add an auth_uid to AuthTicket. Still to do: copy it around"

This reverts commit 62c8ceba870eae66e26b4796e3adc468e0165028.

Revert "auth: misc printing and initialization fixes"

This reverts commit ae8ed243dff02a83cc33c2bf4f4e3715715c482b.

Revert "authtool: set generated key to specific uid if one is given"

This reverts commit 2ab6e75c9b0b2b1f0965ad9ce6ea6a701b6e0098.

Revert "auth: constant for unknown/unsecured user"

This reverts commit ea01f18305f5cd79fe8ff69fcbe4dc4b5f13c2f1.

Revert "auth: auth_uid needs to be in AuthCapsInfo as well."

This reverts commit d499cf5c0524b2266170f9fe1b7b53451b84aa73.

Revert "auth: Add a uid field to EntityAuth; make it a required feature"

This reverts commit 14052d4b12a7efb178af5147d761a1589c23e413.

Conflicts:

src/include/ceph_fs.h

src/auth/Auth.h
src/auth/KeyRing.cc
src/auth/cephx/CephxKeyServer.cc
src/auth/cephx/CephxProtocol.cc
src/cauthtool.cc
src/osd/OSD.cc

index 51acb377ba7efa3085f02b2398eaddf8ed099896..8ed17cc133f562a9f1fe91dd6cd9cd6981682193 100644 (file)
@@ -22,8 +22,6 @@
 
 #include <errno.h>
 
-#define CEPH_AUTH_UID_DEFAULT (__u64) -1
-
 class Cond;
 
 struct EntityName {
@@ -108,50 +106,38 @@ static inline ostream& operator<<(ostream& out, const EntityName& n) {
 
 struct EntityAuth {
   CryptoKey key;
-  __u64 auth_uid;
   map<string, bufferlist> caps;
 
-  EntityAuth() : key(), auth_uid(CEPH_AUTH_UID_DEFAULT), caps() {}
-
   void encode(bufferlist& bl) const {
-    __u8 struct_v = 2;
+    __u8 struct_v = 1;
     ::encode(struct_v, bl);
     ::encode(key, bl);
-    ::encode(auth_uid, bl);
     ::encode(caps, bl);
   }
   void decode(bufferlist::iterator& bl) {
     __u8 struct_v;
     ::decode(struct_v, bl);
     ::decode(key, bl);
-    if (struct_v >= 2)
-      ::decode(auth_uid, bl);
-    else auth_uid = CEPH_AUTH_UID_DEFAULT;
     ::decode(caps, bl);
   }
 };
 WRITE_CLASS_ENCODER(EntityAuth)
 
 static inline ostream& operator<<(ostream& out, const EntityAuth& a) {
-  out << "auth(key=" << a.key;
-  if (a.auth_uid != CEPH_AUTH_UID_DEFAULT)
-    out << " uid=" << a.auth_uid;
-  return out << " with " << a.caps.size() << " caps)";
+  return out << "auth(key=" << a.key << " with " << a.caps.size() << " caps)";
 }
 
 struct AuthCapsInfo {
   bool allow_all;
-  __u64 auth_uid;
   bufferlist caps;
 
-  AuthCapsInfo() : allow_all(false), auth_uid(CEPH_AUTH_UID_DEFAULT){}
+  AuthCapsInfo() : allow_all(false) {}
 
   void encode(bufferlist& bl) const {
-    __u8 struct_v = 2;
+    __u8 struct_v = 1;
     ::encode(struct_v, bl);
     __u8 a = (__u8)allow_all;
     ::encode(a, bl);
-    ::encode(auth_uid, bl);
     ::encode(caps, bl);
   }
   void decode(bufferlist::iterator& bl) {
@@ -160,9 +146,6 @@ struct AuthCapsInfo {
     __u8 a;
     ::decode(a, bl);
     allow_all = (bool)a;
-    if (struct_v >= 2)
-      ::decode(auth_uid, bl);
-    else auth_uid = CEPH_AUTH_UID_DEFAULT;
     ::decode(caps, bl);
   }
 };
@@ -178,7 +161,6 @@ struct AuthTicket {
   uint64_t global_id; /* global instance id */
   utime_t created, renew_after, expires;
   AuthCapsInfo caps;
-  __u64 auth_uid;
   __u32 flags;
 
   AuthTicket() : global_id(0), flags(0) {}
index d924520fee2b1267d87ee60da055570c6a358acc..61a89d808df1936a682600506f3fb479726a3e8d 100644 (file)
@@ -67,7 +67,7 @@ void KeyRing::print(ostream& out)
   for (map<EntityName, EntityAuth>::iterator p = keys.begin();
        p != keys.end();
        ++p) {
-    out << p->first << "\t" << p->second.auth_uid << std::endl;
+    out << p->first << std::endl;
     out << "\tkey: " << p->second.key << std::endl;
 
     for (map<string, bufferlist>::iterator q = p->second.caps.begin();
index 64eaeebc755b6b77de4c428c7764dc4d476904de..933168c4fc135acd1b14e7d03d47131430002ecd 100644 (file)
@@ -103,14 +103,12 @@ bool KeyServerData::get_caps(EntityName& name, string& type, AuthCapsInfo& caps_
   if (iter == secrets.end())
     return false;
 
-  dout(0) << "get_caps: auth_uid=" << iter->second.auth_uid << dendl;
-  caps_info.auth_uid = iter->second.auth_uid;
-
   dout(0) << "get_secret: num of caps=" << iter->second.caps.size() << dendl;
   map<string, bufferlist>::iterator capsiter = iter->second.caps.find(type);
   if (capsiter != iter->second.caps.end()) {
     caps_info.caps = capsiter->second;
   }
+
   return true;
 }
 
index 5ff4afe7231b4da1dbcb9b7a92a41bc052c6f2ed..8c7ef2edbc9f21930f698df35d19f1466c479175 100644 (file)
@@ -39,7 +39,6 @@ bool cephx_build_service_ticket_blob(CephXSessionAuthInfo& info, CephXTicketBlob
   CephXServiceTicketInfo ticket_info;
   ticket_info.session_key = info.session_key;
   ticket_info.ticket = info.ticket;
-  ticket_info.ticket.auth_uid = info.ticket.auth_uid;
   ticket_info.ticket.caps = info.ticket.caps;
 
   dout(10) << "build_service_ticket service " << ceph_entity_type_name(info.service_id)
index 8158cce10d408f2bb2362f82729928f79a88f5c4..7a14b857cfed3bbc041d6263b17be1c68df9e173 100644 (file)
@@ -24,7 +24,7 @@ using namespace std;
 
 void usage()
 {
-  cout << " usage: [--create-keyring] [--gen-key --set-uid=x] [--name=<name>] [--caps=<filename>] [--list] [--print-key] <filename>" << std::endl;
+  cout << " usage: [--create-keyring] [--gen-key] [--name=<name>] [--caps=<filename>] [--list] [--print-key] <filename>" << std::endl;
   exit(1);
 }
 
@@ -47,7 +47,6 @@ int main(int argc, const char **argv)
   const char *name = "";
   const char *caps_fn = NULL;
   const char *import_keyring = NULL;
-  __u64 auth_uid = 0;
 
   FOR_EACH_ARG(args) {
     if (CONF_ARG_EQ("gen-key", 'g')) {
@@ -66,8 +65,6 @@ int main(int argc, const char **argv)
       CONF_SAFE_SET_ARG_VAL(&create_keyring, OPT_BOOL);
     } else if (CONF_ARG_EQ("import-keyring", '\0')) {
       CONF_SAFE_SET_ARG_VAL(&import_keyring, OPT_STR);
-    } else if (CONF_ARG_EQ("set-uid", 'u')) {
-      CONF_SAFE_SET_ARG_VAL(&auth_uid, OPT_LONGLONG);
     } else if (!fn) {
       fn = args[i];
     } else 
@@ -155,8 +152,6 @@ int main(int argc, const char **argv)
   if (gen_key) {
     EntityAuth eauth;
     eauth.key.create(CEPH_CRYPTO_AES);
-    if (auth_uid)
-      eauth.auth_uid = (__u64)auth_uid;
     keyring.add(ename, eauth);
     modified = true;
   }
index d7733c89c717be5594ffc540ef4eb1db7e5b8b67..18d448997efd07058cfafcd783277674e542039d 100644 (file)
@@ -1711,7 +1711,6 @@ bool OSD::ms_verify_authorizer(Connection *con, int peer_type,
     }
 
     s->caps.set_allow_all(caps_info.allow_all);
-    s->caps.set_auth_uid(caps_info.auth_uid);
  
     if (caps_info.caps.length() > 0) {
       bufferlist::iterator iter = caps_info.caps.begin();