]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
user auth messages
authorsageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Thu, 1 Feb 2007 07:24:44 +0000 (07:24 +0000)
committersageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Thu, 1 Feb 2007 07:24:44 +0000 (07:24 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1070 29311d96-e01e-0410-9327-a35deaab8ce9

branches/aleung/security1/ceph/client/Client.cc
branches/aleung/security1/ceph/messages/MClientAuthUser.h [new file with mode: 0644]
branches/aleung/security1/ceph/messages/MClientAuthUserAck.h [new file with mode: 0644]
branches/aleung/security1/ceph/mon/ClientMonitor.h
branches/aleung/security1/ceph/mon/Monitor.cc
branches/aleung/security1/ceph/msg/Message.cc
branches/aleung/security1/ceph/msg/Message.h
branches/aleung/security1/ceph/osd/OSDMap.h

index f0a3e81427c4f2f8e5d23d76368aec47219ba02a..5f230e23e40b24dc7e221dfa07a1bf31e2777fe4 100644 (file)
@@ -455,6 +455,12 @@ Dentry *Client::lookup(filepath& path)
 
 // -------
 
+UserCert *Client::get_user_cert(int uid)
+{
+  
+
+}
+
 MClientReply *Client::make_request(MClientRequest *req, 
                                    bool auth_best, 
                                    int use_mds)  // this param is icky, debug weirdness!
@@ -1682,6 +1688,7 @@ int Client::utime(const char *relpath, struct utimbuf *buf)
 
 
 
+
 int Client::mknod(const char *relpath, mode_t mode) 
 { 
   client_lock.Lock();
@@ -1690,6 +1697,10 @@ int Client::mknod(const char *relpath, mode_t mode)
   mkabspath(relpath, abspath);
   const char *path = abspath.c_str();
 
+  UserCert *uc = get_user_cert(getuid(), getgid());
+  // do work
+  put_user_cert(uc);
+
   dout(3) << "op: client->mknod(\"" << path << "\", " << mode << ");" << endl;
   tout << "mknod" << endl;
   tout << path << endl;
diff --git a/branches/aleung/security1/ceph/messages/MClientAuthUser.h b/branches/aleung/security1/ceph/messages/MClientAuthUser.h
new file mode 100644 (file)
index 0000000..cd1d3fb
--- /dev/null
@@ -0,0 +1,34 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
+/*
+ * Ceph - scalable distributed file system
+ *
+ * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
+ *
+ * This is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software 
+ * Foundation.  See file COPYING.
+ * 
+ */
+
+
+#ifndef __MCLIENTAUTHUSER_H
+#define __MCLIENTAUTHUSER_H
+
+#include "msg/Message.h"
+
+class MClientAuthUser : public Message {
+
+ public:
+  MClientAuthUser() : Message(MSG_CLIENT_AUTH_USER) { 
+  }
+
+  char *get_type_name() { return "client_auth_user"; }
+
+  void decode_payload() {  
+  }
+  void encode_payload() {  
+  }
+};
+
+#endif
diff --git a/branches/aleung/security1/ceph/messages/MClientAuthUserAck.h b/branches/aleung/security1/ceph/messages/MClientAuthUserAck.h
new file mode 100644 (file)
index 0000000..c6c47cd
--- /dev/null
@@ -0,0 +1,34 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
+/*
+ * Ceph - scalable distributed file system
+ *
+ * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
+ *
+ * This is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software 
+ * Foundation.  See file COPYING.
+ * 
+ */
+
+
+#ifndef __MCLIENTAUTHUSERACK_H
+#define __MCLIENTAUTHUSERACK_H
+
+#include "msg/Message.h"
+
+class MClientAuthUserAck : public Message {
+
+ public:
+  MClientAuthUserAck() : Message(MSG_CLIENT_AUTH_USER_ACK) { 
+  }
+
+  char *get_type_name() { return "client_auth_user_ack"; }
+
+  void decode_payload() {  
+  }
+  void encode_payload() {  
+  }
+};
+
+#endif
index 09c13adddf5ef7568891e4ef2c7d6bd16edf276e..a85bb1e2fe86d4598c75a13ed0dcff5465c61b82 100644 (file)
@@ -40,6 +40,7 @@ class ClientMonitor : public Dispatcher {
   //void send_incremental(epoch_t since, msg_addr_t dest);
 
   void handle_client_boot(class MClientBoot *m);
+  void handle_client_auth_user(class MClientAuthUser *m);
 
  public:
   ClientMonitor(Monitor *mn, Messenger *m, Mutex& l) : mon(mn), messenger(m), lock(l),
index acba0e9f5e45a130090b56ab24e962440a7ace51..8e2abf57524cc780c183c4aafecc1470495f077d 100644 (file)
@@ -159,6 +159,7 @@ void Monitor::dispatch(Message *m)
 
       // clients
     case MSG_CLIENT_BOOT:
+    case MSG_CLIENT_AUTH_USER:
       clientmon->dispatch(m);
       break;
 
index 2ce6b8bbf12724a2295f0034400d5ffc38f0a11e..ec7f991f42989d2d656942a5dd6e9b93903df3c8 100644 (file)
@@ -44,6 +44,8 @@ using namespace std;
 #include "messages/MClientBoot.h"
 #include "messages/MClientMount.h"
 #include "messages/MClientMountAck.h"
+#include "messages/MClientAuthUser.h"
+#include "messages/MClientAuthUserAck.h"
 #include "messages/MClientRequest.h"
 #include "messages/MClientReply.h"
 #include "messages/MClientFileCaps.h"
@@ -228,6 +230,12 @@ decode_message(msg_envelope_t& env, bufferlist& payload)
   case MSG_CLIENT_MOUNTACK:
     m = new MClientMountAck();
     break;
+  case MSG_CLIENT_AUTH_USER:
+    m = new MClientAuthUser();
+    break;
+  case MSG_CLIENT_AUTH_USER_ACK:
+    m = new MClientAuthUserAck();
+    break;
   case MSG_CLIENT_REQUEST:
     m = new MClientRequest();
     break;
index 5f41453e9ec40a523fb477695c61e8b341351458..eaace16354a9abb37fff1b5d489cd19f738f1aa5 100644 (file)
@@ -83,6 +83,8 @@
 #define MSG_CLIENT_MOUNT           71
 #define MSG_CLIENT_MOUNTACK        72
 #define MSG_CLIENT_UNMOUNT         73
+#define MSG_CLIENT_AUTH_USER       74
+#define MSG_CLIENT_AUTH_USER_ACK   75
 
 
 // *** MDS ***
index d53ee3ab4c52ee977d078d5ed8ac033343162b12..1b0e956605684703dbafb7e7f70389203ac04330 100644 (file)
@@ -146,7 +146,6 @@ private:
   const utime_t& get_ctime() const { return ctime; }
 
   bool is_mkfs() const { return epoch == 1; }
-  //void set_mkfs() { assert(epoch == 1); }
 
   /***** cluster state *****/
   int num_osds() { return osds.size(); }