]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: allow UserPerm constructor to populate gid list
authorJeff Layton <jlayton@redhat.com>
Mon, 24 Oct 2016 14:02:58 +0000 (10:02 -0400)
committerJeff Layton <jlayton@redhat.com>
Tue, 25 Oct 2016 17:05:15 +0000 (13:05 -0400)
Add args for the gids_count and gids list, and give them default
values so that callers can populate it correctly. We'll need this
for ganesha so it can populate the UserPerm from a RPC AUTH object.

Note that the gidlist pointer must be valid for the lifetime of
the created object!

Signed-off-by: Jeff Layton <jlayton@redhat.com>
src/client/UserPerm.h

index 9ce510412077ddb28b8829c7fd6bfccdd03b157a..1895c15c2d4957bb752b73496f53efc78314bada 100644 (file)
@@ -42,8 +42,9 @@ private:
 public:
   UserPerm() : m_uid(-1), m_gid(-1), gid_count(0),
               gids(NULL), alloced_gids(false) {}
-  UserPerm(int uid, int gid) : m_uid(uid), m_gid(gid), gid_count(0),
-                              gids(NULL), alloced_gids(false) {}
+  UserPerm(uid_t uid, gid_t gid, int ngids=0, gid_t *gidlist=NULL) :
+           m_uid(uid), m_gid(gid), gid_count(ngids),
+           gids(gidlist), alloced_gids(false) {}
   UserPerm(const UserPerm& o) : UserPerm() {
     deep_copy_from(o);
   }