Whamcloud - gitweb
LU-9243 gss: fix GSS struct definition badness 43/46543/6
authorSebastien Buisson <sbuisson@ddn.com>
Thu, 17 Feb 2022 15:40:20 +0000 (16:40 +0100)
committerOleg Drokin <green@whamcloud.com>
Sat, 11 Jun 2022 05:35:23 +0000 (05:35 +0000)
struct lgssd_ioctl_param should not be defined in multiple places. So
move it to a new header file lgss.h that can be included from kernel
space and user space.

struct gss_header, struct gss_rep_header, struct gss_err_header and
struct gss_wire_ctx are going on the wire, so they need to be moved to
lustre_idl.h, and be wire-checked.

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I97c4a8322e6bb7627c6dff5f068931278f4567d7
Reviewed-on: https://review.whamcloud.com/46543
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
12 files changed:
MAINTAINERS
lustre/include/uapi/linux/lustre/Makefile.am
lustre/include/uapi/linux/lustre/lgss.h [new file with mode: 0644]
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/ptlrpc/gss/gss_cli_upcall.c
lustre/ptlrpc/gss/gss_internal.h
lustre/ptlrpc/wiretest.c
lustre/utils/gss/gssd_proc.c
lustre/utils/gss/lgss_keyring.c
lustre/utils/gss/lsupport.h
lustre/utils/wirecheck.c
lustre/utils/wiretest.c

index 5dc30f0..a04977d 100644 (file)
@@ -274,6 +274,7 @@ F:  lustre/ptlrpc/sec*.c
 F:     lustre/scripts/lsvgss
 F:     lustre/tests/sanity-sec.sh
 F:     lustre/utils/gss
+F:     lustre/include/uapi/linux/lustre/lgss.h
 
 Lustre GSSAPI - Kerberos
 M:     Sebastien Buisson <sbuisson@whamcloud.com>
index 4258024..b310a5a 100644 (file)
@@ -36,6 +36,7 @@ lustreinclude_HEADERS = \
        lustre_fiemap.h \
        lustre_idl.h \
        lustre_ioctl.h \
+       lgss.h \
        lustre_kernelcomm.h \
        lustre_ostid.h \
        lustre_param.h \
@@ -60,6 +61,7 @@ EXTRA_DIST = \
        lustre_fiemap.h \
        lustre_idl.h \
        lustre_ioctl.h \
+       lgss.h \
        lustre_kernelcomm.h \
        lustre_lfsck_user.h \
        lustre_log_user.h \
diff --git a/lustre/include/uapi/linux/lustre/lgss.h b/lustre/include/uapi/linux/lustre/lgss.h
new file mode 100644 (file)
index 0000000..52c67fe
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * GPL HEADER START
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 only,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License version 2 for more details (a copy is included
+ * in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License
+ * version 2 along with this program; If not, see
+ * http://www.gnu.org/licenses/gpl-2.0.html
+ *
+ * GPL HEADER END
+ */
+/*
+ * Copyright (c) 2022, Whamcloud.
+ */
+/*
+ * This file is part of Lustre, http://www.lustre.org/
+ */
+
+#ifndef _LGSS_H
+#define _LGSS_H
+
+#include <linux/types.h>
+
+/*
+ * sparse kernel source annotations
+ */
+#ifndef __user
+#define __user
+#endif
+
+struct lgssd_ioctl_param {
+       /* in */
+       __u32 version;
+       __u32 secid;
+       char __user *uuid;
+       __u32 lustre_svc;
+       __kernel_uid_t uid;
+       __kernel_gid_t gid;
+       __u64 send_token_size;
+       char __user *send_token;
+       __u64 reply_buf_size;
+       char __user *reply_buf;
+       /* out */
+       __u64 status;
+       __u64 reply_length;
+};
+
+#endif
index 0162137..af885fa 100644 (file)
@@ -3632,6 +3632,77 @@ union nodemap_rec {
        struct nodemap_global_rec ngr;
 };
 
+/*
+ * rawobj stuff for GSS
+ */
+typedef struct netobj_s {
+       __u32 len;
+       __u8 data[0];
+} netobj_t;
+
+typedef struct rawobj_s {
+       __u32 len;
+       __u8 *data;
+} rawobj_t;
+
+/*
+ * GSS headers
+ * following 3 headers must have the same sizes and offsets
+ */
+struct gss_header {
+       __u8 gh_version;     /* gss version */
+       __u8 gh_sp;          /* sec part */
+       __u16 gh_pad0;
+       __u32 gh_flags;       /* wrap flags */
+       __u32 gh_proc;        /* proc */
+       __u32 gh_seq;         /* sequence */
+       __u32 gh_svc;         /* service */
+       __u32 gh_pad1;
+       __u32 gh_pad2;
+       __u32 gh_pad3;
+       netobj_t gh_handle;      /* context handle */
+};
+
+struct gss_rep_header {
+       __u8 gh_version;
+       __u8 gh_sp;
+       __u16 gh_pad0;
+       __u32 gh_flags;
+       __u32 gh_proc;
+       __u32 gh_major;
+       __u32 gh_minor;
+       __u32 gh_seqwin;
+       __u32 gh_pad2;
+       __u32 gh_pad3;
+       netobj_t gh_handle;
+};
+
+struct gss_err_header {
+       __u8 gh_version;
+       __u8 gh_sp;
+       __u16 gh_pad0;
+       __u32 gh_flags;
+       __u32 gh_proc;
+       __u32 gh_major;
+       __u32 gh_minor;
+       __u32 gh_pad1;
+       __u32 gh_pad2;
+       __u32 gh_pad3;
+       netobj_t gh_handle;
+};
+
+/*
+ * GSS part of wire context information sent from client, saved and
+ * used later by server.
+ */
+struct gss_wire_ctx {
+       __u32 gw_flags;
+       __u32 gw_proc;
+       __u32 gw_seq;
+       __u32 gw_svc;
+       rawobj_t gw_handle;
+};
+
 /* This is the lu_ladvise struct which goes out on the wire.
  * Corresponds to the userspace arg llapi_lu_ladvise.
  * value[1-4] are unspecified fields, used differently by different advices */
index 4a42f65..0b4bfba 100644 (file)
@@ -47,6 +47,7 @@
 #include <lustre_net.h>
 #include <lustre_import.h>
 #include <lustre_sec.h>
+#include <uapi/linux/lustre/lgss.h>
 
 #include "gss_err.h"
 #include "gss_internal.h"
@@ -211,22 +212,6 @@ int ctx_init_parse_reply(struct lustre_msg *msg, int swabbed,
        return effective;
 }
 
-/* XXX move to where lgssd could see */
-struct lgssd_ioctl_param {
-        int             version;        /* in   */
-        int             secid;          /* in   */
-       char __user    *uuid;           /* in   */
-        int             lustre_svc;     /* in   */
-        uid_t           uid;            /* in   */
-        gid_t           gid;            /* in   */
-        long            send_token_size;/* in   */
-       char __user    *send_token;     /* in   */
-        long            reply_buf_size; /* in   */
-       char __user    *reply_buf;      /* in   */
-        long            status;         /* out  */
-        long            reply_length;   /* out  */
-};
-
 int gss_do_ctx_init_rpc(char __user *buffer, unsigned long count)
 {
        struct obd_import *imp, *imp0;
@@ -237,38 +222,39 @@ int gss_do_ctx_init_rpc(char __user *buffer, unsigned long count)
        long lsize;
        int rc;
 
-        if (count != sizeof(param)) {
-                CERROR("ioctl size %lu, expect %lu, please check lgss_keyring "
-                       "version\n", count, (unsigned long) sizeof(param));
-                RETURN(-EINVAL);
-        }
+       if (count != sizeof(param)) {
+               CERROR("ioctl size %lu, expect %lu, please check lgss_keyring version\n",
+                      count, (unsigned long) sizeof(param));
+               RETURN(-EINVAL);
+       }
        if (copy_from_user(&param, buffer, sizeof(param))) {
-                CERROR("failed copy data from lgssd\n");
-                RETURN(-EFAULT);
-        }
+               CERROR("failed copy data from lgssd\n");
+               RETURN(-EFAULT);
+       }
 
-        if (param.version != GSSD_INTERFACE_VERSION) {
-                CERROR("gssd interface version %d (expect %d)\n",
-                        param.version, GSSD_INTERFACE_VERSION);
-                RETURN(-EINVAL);
-        }
+       if (param.version != GSSD_INTERFACE_VERSION) {
+               CERROR("gssd interface version %d (expect %d)\n",
+                      param.version, GSSD_INTERFACE_VERSION);
+               RETURN(-EINVAL);
+       }
 
-        /* take name */
-        if (strncpy_from_user(obdname, param.uuid, sizeof(obdname)) <= 0) {
-                CERROR("Invalid obdname pointer\n");
-                RETURN(-EFAULT);
-        }
+       /* take name */
+       if (strncpy_from_user(obdname, (const char __user *)param.uuid,
+                             sizeof(obdname)) <= 0) {
+               CERROR("Invalid obdname pointer\n");
+               RETURN(-EFAULT);
+       }
 
-        obd = class_name2obd(obdname);
-        if (!obd) {
-                CERROR("no such obd %s\n", obdname);
-                RETURN(-EINVAL);
-        }
+       obd = class_name2obd(obdname);
+       if (!obd) {
+               CERROR("no such obd %s\n", obdname);
+               RETURN(-EINVAL);
+       }
 
-        if (unlikely(!obd->obd_set_up)) {
-                CERROR("obd %s not setup\n", obdname);
-                RETURN(-EINVAL);
-        }
+       if (unlikely(!obd->obd_set_up)) {
+               CERROR("obd %s not setup\n", obdname);
+               RETURN(-EINVAL);
+       }
 
        spin_lock(&obd->obd_dev_lock);
        if (obd->obd_stopping) {
@@ -295,77 +281,78 @@ int gss_do_ctx_init_rpc(char __user *buffer, unsigned long count)
                RETURN(-EINVAL);
        }
 
-        if (imp->imp_deactive) {
-                CERROR("import has been deactivated\n");
-                class_import_put(imp);
-                RETURN(-EINVAL);
-        }
+       if (imp->imp_deactive) {
+               CERROR("import has been deactivated\n");
+               class_import_put(imp);
+               RETURN(-EINVAL);
+       }
 
-        req = ptlrpc_request_alloc_pack(imp, &RQF_SEC_CTX, LUSTRE_OBD_VERSION,
-                                        SEC_CTX_INIT);
-        if (req == NULL) {
-                param.status = -ENOMEM;
-                goto out_copy;
-        }
+       req = ptlrpc_request_alloc_pack(imp, &RQF_SEC_CTX, LUSTRE_OBD_VERSION,
+                                       SEC_CTX_INIT);
+       if (req == NULL) {
+               param.status = -ENOMEM;
+               goto out_copy;
+       }
 
-        if (req->rq_cli_ctx->cc_sec->ps_id != param.secid) {
-                CWARN("original secid %d, now has changed to %d, "
-                      "cancel this negotiation\n", param.secid,
-                      req->rq_cli_ctx->cc_sec->ps_id);
-                param.status = -EINVAL;
-                goto out_copy;
-        }
+       if (req->rq_cli_ctx->cc_sec->ps_id != param.secid) {
+               CWARN("original secid %d, now has changed to %d, cancel this negotiation\n",
+                     param.secid, req->rq_cli_ctx->cc_sec->ps_id);
+               param.status = -EINVAL;
+               goto out_copy;
+       }
 
-        /* get token */
-        rc = ctx_init_pack_request(imp, req,
-                                   param.lustre_svc,
-                                   param.uid, param.gid,
-                                   param.send_token_size,
-                                   param.send_token);
-        if (rc) {
-                param.status = rc;
-                goto out_copy;
-        }
+       /* get token */
+       rc = ctx_init_pack_request(imp, req,
+                                  param.lustre_svc,
+                                  param.uid, param.gid,
+                                  param.send_token_size,
+                                  (char __user *)param.send_token);
+       if (rc) {
+               param.status = rc;
+               goto out_copy;
+       }
 
-        ptlrpc_request_set_replen(req);
-
-        rc = ptlrpc_queue_wait(req);
-        if (rc) {
-                /* If any _real_ denial be made, we expect server return
-                 * -EACCES reply or return success but indicate gss error
-                 * inside reply messsage. All other errors are treated as
-                 * timeout, caller might try the negotiation repeatedly,
-                 * leave recovery decisions to general ptlrpc layer.
-                 *
-                 * FIXME maybe some other error code shouldn't be treated
-                 * as timeout. */
-                param.status = rc;
-                if (rc != -EACCES)
-                        param.status = -ETIMEDOUT;
-                goto out_copy;
-        }
+       ptlrpc_request_set_replen(req);
+
+       rc = ptlrpc_queue_wait(req);
+       if (rc) {
+               /* If any _real_ denial be made, we expect server return
+                * -EACCES reply or return success but indicate gss error
+                * inside reply messsage. All other errors are treated as
+                * timeout, caller might try the negotiation repeatedly,
+                * leave recovery decisions to general ptlrpc layer.
+                *
+                * FIXME maybe some other error code shouldn't be treated
+                * as timeout.
+                */
+               param.status = rc;
+               if (rc != -EACCES)
+                       param.status = -ETIMEDOUT;
+               goto out_copy;
+       }
 
        LASSERT(req->rq_repdata);
        lsize = ctx_init_parse_reply(req->rq_repdata,
                                     req_capsule_rep_need_swab(&req->rq_pill),
-                                    param.reply_buf, param.reply_buf_size);
+                                    (char __user *)param.reply_buf,
+                                    param.reply_buf_size);
        if (lsize < 0) {
                param.status = (int) lsize;
                goto out_copy;
        }
 
-        param.status = 0;
-        param.reply_length = lsize;
+       param.status = 0;
+       param.reply_length = lsize;
 
 out_copy:
        if (copy_to_user(buffer, &param, sizeof(param)))
-                rc = -EFAULT;
-        else
-                rc = 0;
+               rc = -EFAULT;
+       else
+               rc = 0;
 
-        class_import_put(imp);
-        ptlrpc_req_finished(req);
-        RETURN(rc);
+       class_import_put(imp);
+       ptlrpc_req_finished(req);
+       RETURN(rc);
 }
 
 int gss_do_ctx_fini_rpc(struct gss_cli_ctx *gctx)
index 40e7170..d8302ba 100644 (file)
 /*
  * rawobj stuff
  */
-typedef struct netobj_s {
-        __u32           len;
-        __u8            data[0];
-} netobj_t;
-
 #define NETOBJ_EMPTY    ((netobj_t) { 0 })
-
-typedef struct rawobj_s {
-        __u32           len;
-        __u8           *data;
-} rawobj_t;
-
 #define RAWOBJ_EMPTY    ((rawobj_t) { 0, NULL })
 
 typedef struct rawobj_buf_s {
@@ -145,63 +134,6 @@ __u32 import_to_gss_svc(struct obd_import *imp)
        }
 }
 
-/*
- * following 3 header must have the same size and offset
- */
-struct gss_header {
-        __u8                    gh_version;     /* gss version */
-        __u8                    gh_sp;          /* sec part */
-        __u16                   gh_pad0;
-        __u32                   gh_flags;       /* wrap flags */
-        __u32                   gh_proc;        /* proc */
-        __u32                   gh_seq;         /* sequence */
-        __u32                   gh_svc;         /* service */
-        __u32                   gh_pad1;
-        __u32                   gh_pad2;
-        __u32                   gh_pad3;
-        netobj_t                gh_handle;      /* context handle */
-};
-
-struct gss_rep_header {
-        __u8                    gh_version;
-        __u8                    gh_sp;
-        __u16                   gh_pad0;
-        __u32                   gh_flags;
-        __u32                   gh_proc;
-        __u32                   gh_major;
-        __u32                   gh_minor;
-        __u32                   gh_seqwin;
-        __u32                   gh_pad2;
-        __u32                   gh_pad3;
-        netobj_t                gh_handle;
-};
-
-struct gss_err_header {
-        __u8                    gh_version;
-        __u8                    gh_sp;
-        __u16                   gh_pad0;
-        __u32                   gh_flags;
-        __u32                   gh_proc;
-        __u32                   gh_major;
-        __u32                   gh_minor;
-        __u32                   gh_pad1;
-        __u32                   gh_pad2;
-        __u32                   gh_pad3;
-        netobj_t                gh_handle;
-};
-
-/*
- * part of wire context information send from client which be saved and
- * used later by server.
- */
-struct gss_wire_ctx {
-        __u32                   gw_flags;
-        __u32                   gw_proc;
-        __u32                   gw_seq;
-        __u32                   gw_svc;
-        rawobj_t                gw_handle;
-};
-
 #define PTLRPC_GSS_MAX_HANDLE_SIZE      (8)
 #define PTLRPC_GSS_HEADER_SIZE          (sizeof(struct gss_header) + \
                                          PTLRPC_GSS_MAX_HANDLE_SIZE)
index 6250bb4..70d9475 100644 (file)
@@ -5201,6 +5201,199 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct hsm_user_import, hui_archive_id));
        LASSERTF((int)sizeof(((struct hsm_user_import *)0)->hui_archive_id) == 4, "found %lld\n",
                 (long long)(int)sizeof(((struct hsm_user_import *)0)->hui_archive_id));
+
+       /* Checks for struct netobj_s */
+       LASSERTF((int)sizeof(struct netobj_s) == 4, "found %lld\n",
+                (long long)(int)sizeof(struct netobj_s));
+       LASSERTF((int)offsetof(struct netobj_s, len) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct netobj_s, len));
+       LASSERTF((int)sizeof(((struct netobj_s *)0)->len) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct netobj_s *)0)->len));
+       LASSERTF((int)offsetof(struct netobj_s, data) == 4, "found %lld\n",
+                (long long)(int)offsetof(struct netobj_s, data));
+       LASSERTF((int)sizeof(((struct netobj_s *)0)->data) == 0, "found %lld\n",
+                (long long)(int)sizeof(((struct netobj_s *)0)->data));
+
+       /* Checks for struct rawobj_s */
+       LASSERTF((int)sizeof(struct rawobj_s) == 16, "found %lld\n",
+                (long long)(int)sizeof(struct rawobj_s));
+       LASSERTF((int)offsetof(struct rawobj_s, len) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct rawobj_s, len));
+       LASSERTF((int)sizeof(((struct rawobj_s *)0)->len) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct rawobj_s *)0)->len));
+       LASSERTF((int)offsetof(struct rawobj_s, data) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct rawobj_s, data));
+       LASSERTF((int)sizeof(((struct rawobj_s *)0)->data) == 8, "found %lld\n",
+                (long long)(int)sizeof(((struct rawobj_s *)0)->data));
+
+       /* Checks for struct gss_header */
+       LASSERTF((int)sizeof(struct gss_header) == 36, "found %lld\n",
+                (long long)(int)sizeof(struct gss_header));
+       LASSERTF((int)offsetof(struct gss_header, gh_version) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct gss_header, gh_version));
+       LASSERTF((int)sizeof(((struct gss_header *)0)->gh_version) == 1, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_header *)0)->gh_version));
+       LASSERTF((int)offsetof(struct gss_header, gh_sp) == 1, "found %lld\n",
+                (long long)(int)offsetof(struct gss_header, gh_sp));
+       LASSERTF((int)sizeof(((struct gss_header *)0)->gh_sp) == 1, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_header *)0)->gh_sp));
+       LASSERTF((int)offsetof(struct gss_header, gh_pad0) == 2, "found %lld\n",
+                (long long)(int)offsetof(struct gss_header, gh_pad0));
+       LASSERTF((int)sizeof(((struct gss_header *)0)->gh_pad0) == 2, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_header *)0)->gh_pad0));
+       LASSERTF((int)offsetof(struct gss_header, gh_flags) == 4, "found %lld\n",
+                (long long)(int)offsetof(struct gss_header, gh_flags));
+       LASSERTF((int)sizeof(((struct gss_header *)0)->gh_flags) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_header *)0)->gh_flags));
+       LASSERTF((int)offsetof(struct gss_header, gh_proc) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct gss_header, gh_proc));
+       LASSERTF((int)sizeof(((struct gss_header *)0)->gh_proc) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_header *)0)->gh_proc));
+       LASSERTF((int)offsetof(struct gss_header, gh_seq) == 12, "found %lld\n",
+                (long long)(int)offsetof(struct gss_header, gh_seq));
+       LASSERTF((int)sizeof(((struct gss_header *)0)->gh_seq) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_header *)0)->gh_seq));
+       LASSERTF((int)offsetof(struct gss_header, gh_svc) == 16, "found %lld\n",
+                (long long)(int)offsetof(struct gss_header, gh_svc));
+       LASSERTF((int)sizeof(((struct gss_header *)0)->gh_svc) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_header *)0)->gh_svc));
+       LASSERTF((int)offsetof(struct gss_header, gh_pad1) == 20, "found %lld\n",
+                (long long)(int)offsetof(struct gss_header, gh_pad1));
+       LASSERTF((int)sizeof(((struct gss_header *)0)->gh_pad1) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_header *)0)->gh_pad1));
+       LASSERTF((int)offsetof(struct gss_header, gh_pad2) == 24, "found %lld\n",
+                (long long)(int)offsetof(struct gss_header, gh_pad2));
+       LASSERTF((int)sizeof(((struct gss_header *)0)->gh_pad2) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_header *)0)->gh_pad2));
+       LASSERTF((int)offsetof(struct gss_header, gh_pad3) == 28, "found %lld\n",
+                (long long)(int)offsetof(struct gss_header, gh_pad3));
+       LASSERTF((int)sizeof(((struct gss_header *)0)->gh_pad3) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_header *)0)->gh_pad3));
+       LASSERTF((int)offsetof(struct gss_header, gh_handle) == 32, "found %lld\n",
+                (long long)(int)offsetof(struct gss_header, gh_handle));
+       LASSERTF((int)sizeof(((struct gss_header *)0)->gh_handle) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_header *)0)->gh_handle));
+
+       /* Checks for struct gss_rep_header */
+       LASSERTF((int)sizeof(struct gss_rep_header) == 36, "found %lld\n",
+                (long long)(int)sizeof(struct gss_rep_header));
+       LASSERTF((int)offsetof(struct gss_rep_header, gh_version) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct gss_rep_header, gh_version));
+       LASSERTF((int)sizeof(((struct gss_rep_header *)0)->gh_version) == 1, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_rep_header *)0)->gh_version));
+       LASSERTF((int)offsetof(struct gss_rep_header, gh_sp) == 1, "found %lld\n",
+                (long long)(int)offsetof(struct gss_rep_header, gh_sp));
+       LASSERTF((int)sizeof(((struct gss_rep_header *)0)->gh_sp) == 1, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_rep_header *)0)->gh_sp));
+       LASSERTF((int)offsetof(struct gss_rep_header, gh_pad0) == 2, "found %lld\n",
+                (long long)(int)offsetof(struct gss_rep_header, gh_pad0));
+       LASSERTF((int)sizeof(((struct gss_rep_header *)0)->gh_pad0) == 2, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_rep_header *)0)->gh_pad0));
+       LASSERTF((int)offsetof(struct gss_rep_header, gh_flags) == 4, "found %lld\n",
+                (long long)(int)offsetof(struct gss_rep_header, gh_flags));
+       LASSERTF((int)sizeof(((struct gss_rep_header *)0)->gh_flags) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_rep_header *)0)->gh_flags));
+       LASSERTF((int)offsetof(struct gss_rep_header, gh_proc) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct gss_rep_header, gh_proc));
+       LASSERTF((int)sizeof(((struct gss_rep_header *)0)->gh_proc) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_rep_header *)0)->gh_proc));
+       LASSERTF((int)offsetof(struct gss_rep_header, gh_major) == 12, "found %lld\n",
+                (long long)(int)offsetof(struct gss_rep_header, gh_major));
+       LASSERTF((int)sizeof(((struct gss_rep_header *)0)->gh_major) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_rep_header *)0)->gh_major));
+       LASSERTF((int)offsetof(struct gss_rep_header, gh_minor) == 16, "found %lld\n",
+                (long long)(int)offsetof(struct gss_rep_header, gh_minor));
+       LASSERTF((int)sizeof(((struct gss_rep_header *)0)->gh_minor) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_rep_header *)0)->gh_minor));
+       LASSERTF((int)offsetof(struct gss_rep_header, gh_seqwin) == 20, "found %lld\n",
+                (long long)(int)offsetof(struct gss_rep_header, gh_seqwin));
+       LASSERTF((int)sizeof(((struct gss_rep_header *)0)->gh_seqwin) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_rep_header *)0)->gh_seqwin));
+       LASSERTF((int)offsetof(struct gss_rep_header, gh_pad2) == 24, "found %lld\n",
+                (long long)(int)offsetof(struct gss_rep_header, gh_pad2));
+       LASSERTF((int)sizeof(((struct gss_rep_header *)0)->gh_pad2) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_rep_header *)0)->gh_pad2));
+       LASSERTF((int)offsetof(struct gss_rep_header, gh_pad3) == 28, "found %lld\n",
+                (long long)(int)offsetof(struct gss_rep_header, gh_pad3));
+       LASSERTF((int)sizeof(((struct gss_rep_header *)0)->gh_pad3) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_rep_header *)0)->gh_pad3));
+       LASSERTF((int)offsetof(struct gss_rep_header, gh_handle) == 32, "found %lld\n",
+                (long long)(int)offsetof(struct gss_rep_header, gh_handle));
+       LASSERTF((int)sizeof(((struct gss_rep_header *)0)->gh_handle) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_rep_header *)0)->gh_handle));
+
+       /* Checks for struct gss_err_header */
+       LASSERTF((int)sizeof(struct gss_err_header) == 36, "found %lld\n",
+                (long long)(int)sizeof(struct gss_err_header));
+       LASSERTF((int)offsetof(struct gss_err_header, gh_version) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct gss_err_header, gh_version));
+       LASSERTF((int)sizeof(((struct gss_err_header *)0)->gh_version) == 1, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_err_header *)0)->gh_version));
+       LASSERTF((int)offsetof(struct gss_err_header, gh_sp) == 1, "found %lld\n",
+                (long long)(int)offsetof(struct gss_err_header, gh_sp));
+       LASSERTF((int)sizeof(((struct gss_err_header *)0)->gh_sp) == 1, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_err_header *)0)->gh_sp));
+       LASSERTF((int)offsetof(struct gss_err_header, gh_pad0) == 2, "found %lld\n",
+                (long long)(int)offsetof(struct gss_err_header, gh_pad0));
+       LASSERTF((int)sizeof(((struct gss_err_header *)0)->gh_pad0) == 2, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_err_header *)0)->gh_pad0));
+       LASSERTF((int)offsetof(struct gss_err_header, gh_flags) == 4, "found %lld\n",
+                (long long)(int)offsetof(struct gss_err_header, gh_flags));
+       LASSERTF((int)sizeof(((struct gss_err_header *)0)->gh_flags) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_err_header *)0)->gh_flags));
+       LASSERTF((int)offsetof(struct gss_err_header, gh_proc) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct gss_err_header, gh_proc));
+       LASSERTF((int)sizeof(((struct gss_err_header *)0)->gh_proc) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_err_header *)0)->gh_proc));
+       LASSERTF((int)offsetof(struct gss_err_header, gh_major) == 12, "found %lld\n",
+                (long long)(int)offsetof(struct gss_err_header, gh_major));
+       LASSERTF((int)sizeof(((struct gss_err_header *)0)->gh_major) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_err_header *)0)->gh_major));
+       LASSERTF((int)offsetof(struct gss_err_header, gh_minor) == 16, "found %lld\n",
+                (long long)(int)offsetof(struct gss_err_header, gh_minor));
+       LASSERTF((int)sizeof(((struct gss_err_header *)0)->gh_minor) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_err_header *)0)->gh_minor));
+       LASSERTF((int)offsetof(struct gss_err_header, gh_pad1) == 20, "found %lld\n",
+                (long long)(int)offsetof(struct gss_err_header, gh_pad1));
+       LASSERTF((int)sizeof(((struct gss_err_header *)0)->gh_pad1) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_err_header *)0)->gh_pad1));
+       LASSERTF((int)offsetof(struct gss_err_header, gh_pad2) == 24, "found %lld\n",
+                (long long)(int)offsetof(struct gss_err_header, gh_pad2));
+       LASSERTF((int)sizeof(((struct gss_err_header *)0)->gh_pad2) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_err_header *)0)->gh_pad2));
+       LASSERTF((int)offsetof(struct gss_err_header, gh_pad3) == 28, "found %lld\n",
+                (long long)(int)offsetof(struct gss_err_header, gh_pad3));
+       LASSERTF((int)sizeof(((struct gss_err_header *)0)->gh_pad3) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_err_header *)0)->gh_pad3));
+       LASSERTF((int)offsetof(struct gss_err_header, gh_handle) == 32, "found %lld\n",
+                (long long)(int)offsetof(struct gss_err_header, gh_handle));
+       LASSERTF((int)sizeof(((struct gss_err_header *)0)->gh_handle) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_err_header *)0)->gh_handle));
+
+       /* Checks for struct gss_wire_ctx */
+       LASSERTF((int)sizeof(struct gss_wire_ctx) == 32, "found %lld\n",
+                (long long)(int)sizeof(struct gss_wire_ctx));
+       LASSERTF((int)offsetof(struct gss_wire_ctx, gw_flags) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct gss_wire_ctx, gw_flags));
+       LASSERTF((int)sizeof(((struct gss_wire_ctx *)0)->gw_flags) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_wire_ctx *)0)->gw_flags));
+       LASSERTF((int)offsetof(struct gss_wire_ctx, gw_proc) == 4, "found %lld\n",
+                (long long)(int)offsetof(struct gss_wire_ctx, gw_proc));
+       LASSERTF((int)sizeof(((struct gss_wire_ctx *)0)->gw_proc) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_wire_ctx *)0)->gw_proc));
+       LASSERTF((int)offsetof(struct gss_wire_ctx, gw_seq) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct gss_wire_ctx, gw_seq));
+       LASSERTF((int)sizeof(((struct gss_wire_ctx *)0)->gw_seq) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_wire_ctx *)0)->gw_seq));
+       LASSERTF((int)offsetof(struct gss_wire_ctx, gw_svc) == 12, "found %lld\n",
+                (long long)(int)offsetof(struct gss_wire_ctx, gw_svc));
+       LASSERTF((int)sizeof(((struct gss_wire_ctx *)0)->gw_svc) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_wire_ctx *)0)->gw_svc));
+       LASSERTF((int)offsetof(struct gss_wire_ctx, gw_handle) == 16, "found %lld\n",
+                (long long)(int)offsetof(struct gss_wire_ctx, gw_handle));
+       LASSERTF((int)sizeof(((struct gss_wire_ctx *)0)->gw_handle) == 16, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_wire_ctx *)0)->gw_handle));
+
 #ifdef HAVE_SERVER_SUPPORT
 
        /* Checks for struct object_update_param */
index 0aa13e8..3a82045 100644 (file)
@@ -65,6 +65,7 @@
 #endif
 
 #include <libcfs/util/param.h>
+#include <uapi/linux/lustre/lgss.h>
 
 #include "gssd.h"
 #include "err_util.h"
index c5e0d4a..f34981c 100644 (file)
@@ -52,6 +52,7 @@
 
 #include <libcfs/util/param.h>
 #include <libcfs/util/string.h>
+#include <uapi/linux/lustre/lgss.h>
 #include "lsupport.h"
 #include "lgss_utils.h"
 #include "write_bytes.h"
@@ -260,7 +261,7 @@ int do_nego_rpc(struct lgss_nego_data *lnd,
        logmsg(LL_TRACE, "do_nego_rpc: to parse reply\n");
        if (param.status) {
                logmsg(LL_ERR, "status: %ld (%s)\n",
-                      param.status, strerror((int)(-param.status)));
+                      (long int)param.status, strerror((int)(-param.status)));
                return param.status;
        }
 
index 64871f5..7a6ec0b 100644 (file)
@@ -97,21 +97,6 @@ struct lgssd_upcall_data {
 #define GSSD_INTERFACE_VERSION_V2       (2)
 #define GSSD_INTERFACE_VERSION_V1       (1)
 
-struct lgssd_ioctl_param {
-        int             version;        /* in   */
-        int             secid;          /* in   */
-        char           *uuid;           /* in   */
-        int             lustre_svc;     /* in   */
-        uid_t           uid;            /* in   */
-        gid_t           gid;            /* in   */
-        long            send_token_size;/* in   */
-        char           *send_token;     /* in   */
-        long            reply_buf_size; /* in   */
-        char           *reply_buf;      /* in   */
-        long            status;         /* out  */
-        long            reply_length;   /* out  */
-};
-
 #define GSSD_DEFAULT_GETHOSTNAME_EX     "/etc/lustre/nid2hostname"
 #define MAPPING_DATABASE_FILE           "/etc/lustre/idmap.conf"
 
index ce055ca..5b2f64e 100644 (file)
@@ -2460,6 +2460,84 @@ static void check_hsm_user_import(void)
        CHECK_MEMBER(hsm_user_import, hui_archive_id);
 }
 
+static void check_netobj_s(void)
+{
+       BLANK_LINE();
+       CHECK_STRUCT(netobj_s);
+       CHECK_MEMBER(netobj_s, len);
+       CHECK_MEMBER(netobj_s, data);
+}
+
+static void check_rawobj_s(void)
+{
+       BLANK_LINE();
+       CHECK_STRUCT(rawobj_s);
+       CHECK_MEMBER(rawobj_s, len);
+       CHECK_MEMBER(rawobj_s, data);
+}
+
+static void check_gss_header(void)
+{
+       BLANK_LINE();
+       CHECK_STRUCT(gss_header);
+       CHECK_MEMBER(gss_header, gh_version);
+       CHECK_MEMBER(gss_header, gh_sp);
+       CHECK_MEMBER(gss_header, gh_pad0);
+       CHECK_MEMBER(gss_header, gh_flags);
+       CHECK_MEMBER(gss_header, gh_proc);
+       CHECK_MEMBER(gss_header, gh_seq);
+       CHECK_MEMBER(gss_header, gh_svc);
+       CHECK_MEMBER(gss_header, gh_pad1);
+       CHECK_MEMBER(gss_header, gh_pad2);
+       CHECK_MEMBER(gss_header, gh_pad3);
+       CHECK_MEMBER(gss_header, gh_handle);
+}
+
+static void check_gss_rep_header(void)
+{
+       BLANK_LINE();
+       CHECK_STRUCT(gss_rep_header);
+       CHECK_MEMBER(gss_rep_header, gh_version);
+       CHECK_MEMBER(gss_rep_header, gh_sp);
+       CHECK_MEMBER(gss_rep_header, gh_pad0);
+       CHECK_MEMBER(gss_rep_header, gh_flags);
+       CHECK_MEMBER(gss_rep_header, gh_proc);
+       CHECK_MEMBER(gss_rep_header, gh_major);
+       CHECK_MEMBER(gss_rep_header, gh_minor);
+       CHECK_MEMBER(gss_rep_header, gh_seqwin);
+       CHECK_MEMBER(gss_rep_header, gh_pad2);
+       CHECK_MEMBER(gss_rep_header, gh_pad3);
+       CHECK_MEMBER(gss_rep_header, gh_handle);
+}
+
+static void check_gss_err_header(void)
+{
+       BLANK_LINE();
+       CHECK_STRUCT(gss_err_header);
+       CHECK_MEMBER(gss_err_header, gh_version);
+       CHECK_MEMBER(gss_err_header, gh_sp);
+       CHECK_MEMBER(gss_err_header, gh_pad0);
+       CHECK_MEMBER(gss_err_header, gh_flags);
+       CHECK_MEMBER(gss_err_header, gh_proc);
+       CHECK_MEMBER(gss_err_header, gh_major);
+       CHECK_MEMBER(gss_err_header, gh_minor);
+       CHECK_MEMBER(gss_err_header, gh_pad1);
+       CHECK_MEMBER(gss_err_header, gh_pad2);
+       CHECK_MEMBER(gss_err_header, gh_pad3);
+       CHECK_MEMBER(gss_err_header, gh_handle);
+}
+
+static void check_gss_wire_ctx(void)
+{
+       BLANK_LINE();
+       CHECK_STRUCT(gss_wire_ctx);
+       CHECK_MEMBER(gss_wire_ctx, gw_flags);
+       CHECK_MEMBER(gss_wire_ctx, gw_proc);
+       CHECK_MEMBER(gss_wire_ctx, gw_seq);
+       CHECK_MEMBER(gss_wire_ctx, gw_svc);
+       CHECK_MEMBER(gss_wire_ctx, gw_handle);
+}
+
 #ifndef HAVE_NATIVE_LINUX_CLIENT
 static void check_object_update_param(void)
 {
@@ -3183,6 +3261,13 @@ printf("#endif /* HAVE_SERVER_SUPPORT */\n");
        check_hsm_user_request();
        check_hsm_user_import();
 
+       check_netobj_s();
+       check_rawobj_s();
+       check_gss_header();
+       check_gss_rep_header();
+       check_gss_err_header();
+       check_gss_wire_ctx();
+
 #ifndef HAVE_NATIVE_LINUX_CLIENT
        printf("#ifdef HAVE_SERVER_SUPPORT\n");
        check_object_update_param();
index fc0d981..02e946f 100644 (file)
@@ -5228,6 +5228,199 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct hsm_user_import, hui_archive_id));
        LASSERTF((int)sizeof(((struct hsm_user_import *)0)->hui_archive_id) == 4, "found %lld\n",
                 (long long)(int)sizeof(((struct hsm_user_import *)0)->hui_archive_id));
+
+       /* Checks for struct netobj_s */
+       LASSERTF((int)sizeof(struct netobj_s) == 4, "found %lld\n",
+                (long long)(int)sizeof(struct netobj_s));
+       LASSERTF((int)offsetof(struct netobj_s, len) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct netobj_s, len));
+       LASSERTF((int)sizeof(((struct netobj_s *)0)->len) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct netobj_s *)0)->len));
+       LASSERTF((int)offsetof(struct netobj_s, data) == 4, "found %lld\n",
+                (long long)(int)offsetof(struct netobj_s, data));
+       LASSERTF((int)sizeof(((struct netobj_s *)0)->data) == 0, "found %lld\n",
+                (long long)(int)sizeof(((struct netobj_s *)0)->data));
+
+       /* Checks for struct rawobj_s */
+       LASSERTF((int)sizeof(struct rawobj_s) == 16, "found %lld\n",
+                (long long)(int)sizeof(struct rawobj_s));
+       LASSERTF((int)offsetof(struct rawobj_s, len) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct rawobj_s, len));
+       LASSERTF((int)sizeof(((struct rawobj_s *)0)->len) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct rawobj_s *)0)->len));
+       LASSERTF((int)offsetof(struct rawobj_s, data) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct rawobj_s, data));
+       LASSERTF((int)sizeof(((struct rawobj_s *)0)->data) == 8, "found %lld\n",
+                (long long)(int)sizeof(((struct rawobj_s *)0)->data));
+
+       /* Checks for struct gss_header */
+       LASSERTF((int)sizeof(struct gss_header) == 36, "found %lld\n",
+                (long long)(int)sizeof(struct gss_header));
+       LASSERTF((int)offsetof(struct gss_header, gh_version) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct gss_header, gh_version));
+       LASSERTF((int)sizeof(((struct gss_header *)0)->gh_version) == 1, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_header *)0)->gh_version));
+       LASSERTF((int)offsetof(struct gss_header, gh_sp) == 1, "found %lld\n",
+                (long long)(int)offsetof(struct gss_header, gh_sp));
+       LASSERTF((int)sizeof(((struct gss_header *)0)->gh_sp) == 1, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_header *)0)->gh_sp));
+       LASSERTF((int)offsetof(struct gss_header, gh_pad0) == 2, "found %lld\n",
+                (long long)(int)offsetof(struct gss_header, gh_pad0));
+       LASSERTF((int)sizeof(((struct gss_header *)0)->gh_pad0) == 2, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_header *)0)->gh_pad0));
+       LASSERTF((int)offsetof(struct gss_header, gh_flags) == 4, "found %lld\n",
+                (long long)(int)offsetof(struct gss_header, gh_flags));
+       LASSERTF((int)sizeof(((struct gss_header *)0)->gh_flags) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_header *)0)->gh_flags));
+       LASSERTF((int)offsetof(struct gss_header, gh_proc) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct gss_header, gh_proc));
+       LASSERTF((int)sizeof(((struct gss_header *)0)->gh_proc) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_header *)0)->gh_proc));
+       LASSERTF((int)offsetof(struct gss_header, gh_seq) == 12, "found %lld\n",
+                (long long)(int)offsetof(struct gss_header, gh_seq));
+       LASSERTF((int)sizeof(((struct gss_header *)0)->gh_seq) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_header *)0)->gh_seq));
+       LASSERTF((int)offsetof(struct gss_header, gh_svc) == 16, "found %lld\n",
+                (long long)(int)offsetof(struct gss_header, gh_svc));
+       LASSERTF((int)sizeof(((struct gss_header *)0)->gh_svc) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_header *)0)->gh_svc));
+       LASSERTF((int)offsetof(struct gss_header, gh_pad1) == 20, "found %lld\n",
+                (long long)(int)offsetof(struct gss_header, gh_pad1));
+       LASSERTF((int)sizeof(((struct gss_header *)0)->gh_pad1) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_header *)0)->gh_pad1));
+       LASSERTF((int)offsetof(struct gss_header, gh_pad2) == 24, "found %lld\n",
+                (long long)(int)offsetof(struct gss_header, gh_pad2));
+       LASSERTF((int)sizeof(((struct gss_header *)0)->gh_pad2) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_header *)0)->gh_pad2));
+       LASSERTF((int)offsetof(struct gss_header, gh_pad3) == 28, "found %lld\n",
+                (long long)(int)offsetof(struct gss_header, gh_pad3));
+       LASSERTF((int)sizeof(((struct gss_header *)0)->gh_pad3) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_header *)0)->gh_pad3));
+       LASSERTF((int)offsetof(struct gss_header, gh_handle) == 32, "found %lld\n",
+                (long long)(int)offsetof(struct gss_header, gh_handle));
+       LASSERTF((int)sizeof(((struct gss_header *)0)->gh_handle) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_header *)0)->gh_handle));
+
+       /* Checks for struct gss_rep_header */
+       LASSERTF((int)sizeof(struct gss_rep_header) == 36, "found %lld\n",
+                (long long)(int)sizeof(struct gss_rep_header));
+       LASSERTF((int)offsetof(struct gss_rep_header, gh_version) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct gss_rep_header, gh_version));
+       LASSERTF((int)sizeof(((struct gss_rep_header *)0)->gh_version) == 1, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_rep_header *)0)->gh_version));
+       LASSERTF((int)offsetof(struct gss_rep_header, gh_sp) == 1, "found %lld\n",
+                (long long)(int)offsetof(struct gss_rep_header, gh_sp));
+       LASSERTF((int)sizeof(((struct gss_rep_header *)0)->gh_sp) == 1, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_rep_header *)0)->gh_sp));
+       LASSERTF((int)offsetof(struct gss_rep_header, gh_pad0) == 2, "found %lld\n",
+                (long long)(int)offsetof(struct gss_rep_header, gh_pad0));
+       LASSERTF((int)sizeof(((struct gss_rep_header *)0)->gh_pad0) == 2, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_rep_header *)0)->gh_pad0));
+       LASSERTF((int)offsetof(struct gss_rep_header, gh_flags) == 4, "found %lld\n",
+                (long long)(int)offsetof(struct gss_rep_header, gh_flags));
+       LASSERTF((int)sizeof(((struct gss_rep_header *)0)->gh_flags) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_rep_header *)0)->gh_flags));
+       LASSERTF((int)offsetof(struct gss_rep_header, gh_proc) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct gss_rep_header, gh_proc));
+       LASSERTF((int)sizeof(((struct gss_rep_header *)0)->gh_proc) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_rep_header *)0)->gh_proc));
+       LASSERTF((int)offsetof(struct gss_rep_header, gh_major) == 12, "found %lld\n",
+                (long long)(int)offsetof(struct gss_rep_header, gh_major));
+       LASSERTF((int)sizeof(((struct gss_rep_header *)0)->gh_major) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_rep_header *)0)->gh_major));
+       LASSERTF((int)offsetof(struct gss_rep_header, gh_minor) == 16, "found %lld\n",
+                (long long)(int)offsetof(struct gss_rep_header, gh_minor));
+       LASSERTF((int)sizeof(((struct gss_rep_header *)0)->gh_minor) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_rep_header *)0)->gh_minor));
+       LASSERTF((int)offsetof(struct gss_rep_header, gh_seqwin) == 20, "found %lld\n",
+                (long long)(int)offsetof(struct gss_rep_header, gh_seqwin));
+       LASSERTF((int)sizeof(((struct gss_rep_header *)0)->gh_seqwin) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_rep_header *)0)->gh_seqwin));
+       LASSERTF((int)offsetof(struct gss_rep_header, gh_pad2) == 24, "found %lld\n",
+                (long long)(int)offsetof(struct gss_rep_header, gh_pad2));
+       LASSERTF((int)sizeof(((struct gss_rep_header *)0)->gh_pad2) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_rep_header *)0)->gh_pad2));
+       LASSERTF((int)offsetof(struct gss_rep_header, gh_pad3) == 28, "found %lld\n",
+                (long long)(int)offsetof(struct gss_rep_header, gh_pad3));
+       LASSERTF((int)sizeof(((struct gss_rep_header *)0)->gh_pad3) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_rep_header *)0)->gh_pad3));
+       LASSERTF((int)offsetof(struct gss_rep_header, gh_handle) == 32, "found %lld\n",
+                (long long)(int)offsetof(struct gss_rep_header, gh_handle));
+       LASSERTF((int)sizeof(((struct gss_rep_header *)0)->gh_handle) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_rep_header *)0)->gh_handle));
+
+       /* Checks for struct gss_err_header */
+       LASSERTF((int)sizeof(struct gss_err_header) == 36, "found %lld\n",
+                (long long)(int)sizeof(struct gss_err_header));
+       LASSERTF((int)offsetof(struct gss_err_header, gh_version) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct gss_err_header, gh_version));
+       LASSERTF((int)sizeof(((struct gss_err_header *)0)->gh_version) == 1, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_err_header *)0)->gh_version));
+       LASSERTF((int)offsetof(struct gss_err_header, gh_sp) == 1, "found %lld\n",
+                (long long)(int)offsetof(struct gss_err_header, gh_sp));
+       LASSERTF((int)sizeof(((struct gss_err_header *)0)->gh_sp) == 1, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_err_header *)0)->gh_sp));
+       LASSERTF((int)offsetof(struct gss_err_header, gh_pad0) == 2, "found %lld\n",
+                (long long)(int)offsetof(struct gss_err_header, gh_pad0));
+       LASSERTF((int)sizeof(((struct gss_err_header *)0)->gh_pad0) == 2, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_err_header *)0)->gh_pad0));
+       LASSERTF((int)offsetof(struct gss_err_header, gh_flags) == 4, "found %lld\n",
+                (long long)(int)offsetof(struct gss_err_header, gh_flags));
+       LASSERTF((int)sizeof(((struct gss_err_header *)0)->gh_flags) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_err_header *)0)->gh_flags));
+       LASSERTF((int)offsetof(struct gss_err_header, gh_proc) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct gss_err_header, gh_proc));
+       LASSERTF((int)sizeof(((struct gss_err_header *)0)->gh_proc) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_err_header *)0)->gh_proc));
+       LASSERTF((int)offsetof(struct gss_err_header, gh_major) == 12, "found %lld\n",
+                (long long)(int)offsetof(struct gss_err_header, gh_major));
+       LASSERTF((int)sizeof(((struct gss_err_header *)0)->gh_major) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_err_header *)0)->gh_major));
+       LASSERTF((int)offsetof(struct gss_err_header, gh_minor) == 16, "found %lld\n",
+                (long long)(int)offsetof(struct gss_err_header, gh_minor));
+       LASSERTF((int)sizeof(((struct gss_err_header *)0)->gh_minor) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_err_header *)0)->gh_minor));
+       LASSERTF((int)offsetof(struct gss_err_header, gh_pad1) == 20, "found %lld\n",
+                (long long)(int)offsetof(struct gss_err_header, gh_pad1));
+       LASSERTF((int)sizeof(((struct gss_err_header *)0)->gh_pad1) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_err_header *)0)->gh_pad1));
+       LASSERTF((int)offsetof(struct gss_err_header, gh_pad2) == 24, "found %lld\n",
+                (long long)(int)offsetof(struct gss_err_header, gh_pad2));
+       LASSERTF((int)sizeof(((struct gss_err_header *)0)->gh_pad2) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_err_header *)0)->gh_pad2));
+       LASSERTF((int)offsetof(struct gss_err_header, gh_pad3) == 28, "found %lld\n",
+                (long long)(int)offsetof(struct gss_err_header, gh_pad3));
+       LASSERTF((int)sizeof(((struct gss_err_header *)0)->gh_pad3) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_err_header *)0)->gh_pad3));
+       LASSERTF((int)offsetof(struct gss_err_header, gh_handle) == 32, "found %lld\n",
+                (long long)(int)offsetof(struct gss_err_header, gh_handle));
+       LASSERTF((int)sizeof(((struct gss_err_header *)0)->gh_handle) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_err_header *)0)->gh_handle));
+
+       /* Checks for struct gss_wire_ctx */
+       LASSERTF((int)sizeof(struct gss_wire_ctx) == 32, "found %lld\n",
+                (long long)(int)sizeof(struct gss_wire_ctx));
+       LASSERTF((int)offsetof(struct gss_wire_ctx, gw_flags) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct gss_wire_ctx, gw_flags));
+       LASSERTF((int)sizeof(((struct gss_wire_ctx *)0)->gw_flags) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_wire_ctx *)0)->gw_flags));
+       LASSERTF((int)offsetof(struct gss_wire_ctx, gw_proc) == 4, "found %lld\n",
+                (long long)(int)offsetof(struct gss_wire_ctx, gw_proc));
+       LASSERTF((int)sizeof(((struct gss_wire_ctx *)0)->gw_proc) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_wire_ctx *)0)->gw_proc));
+       LASSERTF((int)offsetof(struct gss_wire_ctx, gw_seq) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct gss_wire_ctx, gw_seq));
+       LASSERTF((int)sizeof(((struct gss_wire_ctx *)0)->gw_seq) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_wire_ctx *)0)->gw_seq));
+       LASSERTF((int)offsetof(struct gss_wire_ctx, gw_svc) == 12, "found %lld\n",
+                (long long)(int)offsetof(struct gss_wire_ctx, gw_svc));
+       LASSERTF((int)sizeof(((struct gss_wire_ctx *)0)->gw_svc) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_wire_ctx *)0)->gw_svc));
+       LASSERTF((int)offsetof(struct gss_wire_ctx, gw_handle) == 16, "found %lld\n",
+                (long long)(int)offsetof(struct gss_wire_ctx, gw_handle));
+       LASSERTF((int)sizeof(((struct gss_wire_ctx *)0)->gw_handle) == 16, "found %lld\n",
+                (long long)(int)sizeof(((struct gss_wire_ctx *)0)->gw_handle));
+
 #ifdef HAVE_SERVER_SUPPORT
 
        /* Checks for struct object_update_param */