diff options
author | Jeff Darcy <jdarcy@redhat.com> | 2014-04-22 15:37:09 +0000 |
---|---|---|
committer | Jeff Darcy <jdarcy@redhat.com> | 2014-04-22 15:37:09 +0000 |
commit | a827c5eab32a43ade5551259ea56a6a1af7e861b (patch) | |
tree | e6707df68f72baa8645210ba931272285116ad85 /rpc/rpc-lib/src/xdr-common.h | |
parent | 46d333783a968ab39e0beade9c7a1eec8035f8b1 (diff) | |
parent | 99bfc2a2a1689da1e173cb2f8ef54d2b09ef3a5d (diff) |
Merge branch 'upstream'
Conflicts:
glusterfs.spec.in
xlators/mgmt/glusterd/src/Makefile.am
xlators/mgmt/glusterd/src/glusterd-utils.c
xlators/mgmt/glusterd/src/glusterd.h
Change-Id: I27bdcf42b003cfc42d6ad981bd2bf8180176806d
Diffstat (limited to 'rpc/rpc-lib/src/xdr-common.h')
-rw-r--r-- | rpc/rpc-lib/src/xdr-common.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/rpc/rpc-lib/src/xdr-common.h b/rpc/rpc-lib/src/xdr-common.h index 34dc9c6a2..f221192ad 100644 --- a/rpc/rpc-lib/src/xdr-common.h +++ b/rpc/rpc-lib/src/xdr-common.h @@ -18,6 +18,7 @@ #include <rpc/types.h> #include <sys/types.h> +#include <rpc/auth.h> #include <rpc/xdr.h> #include <sys/uio.h> @@ -34,7 +35,34 @@ enum gf_dump_procnum { #define GLUSTER_DUMP_PROGRAM 123451501 /* Completely random */ #define GLUSTER_DUMP_VERSION 1 -#define GF_MAX_AUTH_BYTES 2048 +/* MAX_AUTH_BYTES is restricted to 400 bytes, see + * http://tools.ietf.org/html/rfc5531#section-8.2 */ +#define GF_MAX_AUTH_BYTES MAX_AUTH_BYTES + +/* The size of an AUTH_GLUSTERFS_V2 structure: + * + * 1 | pid + * 1 | uid + * 1 | gid + * 1 | groups_len + * XX | groups_val (GF_MAX_AUX_GROUPS=65535) + * 1 | lk_owner_len + * YY | lk_owner_val (GF_MAX_LOCK_OWNER_LEN=1024) + * ----+------------------------------------------- + * 5 | total xdr-units + * + * one XDR-unit is defined as BYTES_PER_XDR_UNIT = 4 bytes + * MAX_AUTH_BYTES = 400 is the maximum, this is 100 xdr-units. + * XX + YY can be 95 to fill the 100 xdr-units. + * + * Note that the on-wire protocol has tighter requirements than the internal + * structures. It is possible for xlators to use more groups and a bigger + * lk_owner than that can be sent by a GlusterFS-client. + */ +#define GF_AUTH_GLUSTERFS_MAX_GROUPS(lk_owner_len) \ + (95 - lk_owner_len) +#define GF_AUTH_GLUSTERFS_MAX_LKOWNER(groups_len) \ + (95 - groups_len) #if GF_DARWIN_HOST_OS #define xdr_u_quad_t xdr_u_int64_t |