]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: remove the now-unused UserGroups entirely
authorGreg Farnum <gfarnum@redhat.com>
Wed, 3 Aug 2016 22:51:01 +0000 (15:51 -0700)
committerGreg Farnum <gfarnum@redhat.com>
Wed, 21 Sep 2016 23:33:56 +0000 (16:33 -0700)
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
src/client/Client.cc
src/client/Client.h
src/client/Inode.cc
src/client/Inode.h
src/client/Makefile.am
src/client/UserGroups.h [deleted file]

index 20818a1c3039de732a0ca97ca74a058e17f73382..85df5afb6145711211d624ecf0386a8f246b98a2 100644 (file)
@@ -12497,35 +12497,11 @@ void Client::handle_conf_change(const struct md_config_t *conf,
   }
 }
 
-void Client::init_groups(RequestUserGroups *groups)
+void Client::init_groups(UserPerm *perms)
 {
   gid_t *sgids;
-  int count = _getgrouplist(&sgids, groups->get_uid(), groups->get_gid());
-  groups->init_gids(sgids, count);
-}
-
-bool Client::RequestUserGroups::is_in(gid_t id)
-{
-  assert(sgid_count >= 0);
-  if (id == gid)
-    return true;
-  for (int i = 0; i < sgid_count; ++i) {
-    if (id == sgids[i])
-      return true;
-  }
-  return false;
-}
-
-int Client::RequestUserGroups::get_gids(const gid_t **out)
-{
-  assert(sgid_count >= 0);
-  if (sgid_count > 0) {
-    *out = sgids;
-    return sgid_count;
-  } else {
-    *out = &gid;
-    return 1;
-  }
+  int count = _getgrouplist(&sgids, perms->uid(), perms->gid());
+  perms->init_gids(sgids, count);
 }
 
 void intrusive_ptr_add_ref(Inode *in)
index 6b4ea03858799a27e0fab4e07645c51b0987198c..72f74dc44879a6b25976719c7b5261be9a7c690b 100644 (file)
@@ -46,7 +46,6 @@ using std::fstream;
 #include "osdc/ObjectCacher.h"
 
 #include "InodeRef.h"
-#include "UserGroups.h"
 #include "UserPerm.h"
 
 class FSMap;
@@ -822,29 +821,7 @@ private:
     MAY_READ = 4,
   };
 
-  class RequestUserGroups : public UserGroups {
-    uid_t uid;
-    gid_t gid;
-    int sgid_count;
-    gid_t *sgids;
-    public:
-    RequestUserGroups(uid_t u, gid_t g) :
-      uid(u), gid(g), sgid_count(-1), sgids(NULL) {}
-    ~RequestUserGroups() {
-      free(sgids);
-    }
-    bool is_init() { return sgid_count < 0; }
-    void init_gids(gid_t *_sgids, int count) {
-      sgids = _sgids;
-      sgid_count = count;
-    }
-    uid_t get_uid() { return uid; }
-    gid_t get_gid() { return gid; }
-    bool is_in(gid_t id);
-    int get_gids(const gid_t **out);
-  };
-  friend class RequestUserGroups;
-  void init_groups(RequestUserGroups *groups);
+  void init_groups(UserPerm *groups);
 
   int inode_permission(Inode *in, const UserPerm& perms, unsigned want);
   int xattr_permission(Inode *in, const char *name, unsigned want,
index 0a324aa637d89a47f489703e9836fa4e8bd7f7a6..e2acb54063b83a9bd5fa88d469ebd89733a9b8d7 100644 (file)
@@ -7,7 +7,6 @@
 #include "Dir.h"
 #include "MetaSession.h"
 #include "ClientSnapRealm.h"
-#include "UserGroups.h"
 
 #include "mds/flock.h"
 
index de07ff210200d3e10414b26a737930beb572d7fb..cd331c72c07df2d84846205a79960785c970abb3 100644 (file)
@@ -23,7 +23,6 @@ struct SnapRealm;
 struct Inode;
 class ceph_lock_state_t;
 class MetaRequest;
-class UserGroups;
 class filepath;
 
 struct Cap {
index 5776f526ef0a4ca4f41a4878ac621d745a342175..312676a306f79ee2a40acbb6aa1dafbaf27097cd 100644 (file)
@@ -26,8 +26,7 @@ noinst_HEADERS += \
        client/ioctl.h \
        client/ObjecterWriteback.h \
        client/posix_acl.h \
-       client/UserPerm.h \
-       client/UserGroups.h
+       client/UserPerm.h
 
 if WITH_FUSE
 libclient_fuse_la_SOURCES = client/fuse_ll.cc
diff --git a/src/client/UserGroups.h b/src/client/UserGroups.h
deleted file mode 100644 (file)
index 3a3966f..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef CEPH_CLIENT_USERGROUPS_H
-#define CEPH_CLIENT_USERGROUPS_H
-
-class UserGroups {
-public:
-  virtual bool is_in(gid_t gid) = 0;
-  virtual gid_t get_gid() = 0;
-  virtual int get_gids(const gid_t **gids) = 0;
-  virtual ~UserGroups() {};
-};
-
-#endif