From 7dfbc71350c982be20d75e7d7853038809f4e850 Mon Sep 17 00:00:00 2001 From: Sebastien Buisson Date: Thu, 17 Feb 2022 16:40:20 +0100 Subject: [PATCH] LU-9243 gss: fix GSS struct definition badness 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 Change-Id: I97c4a8322e6bb7627c6dff5f068931278f4567d7 Reviewed-on: https://review.whamcloud.com/46543 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: John L. Hammond Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- MAINTAINERS | 1 + lustre/include/uapi/linux/lustre/Makefile.am | 2 + lustre/include/uapi/linux/lustre/lgss.h | 58 ++++++++ lustre/include/uapi/linux/lustre/lustre_idl.h | 71 ++++++++++ lustre/ptlrpc/gss/gss_cli_upcall.c | 181 +++++++++++------------- lustre/ptlrpc/gss/gss_internal.h | 68 --------- lustre/ptlrpc/wiretest.c | 193 ++++++++++++++++++++++++++ lustre/utils/gss/gssd_proc.c | 1 + lustre/utils/gss/lgss_keyring.c | 3 +- lustre/utils/gss/lsupport.h | 15 -- lustre/utils/wirecheck.c | 85 ++++++++++++ lustre/utils/wiretest.c | 193 ++++++++++++++++++++++++++ 12 files changed, 690 insertions(+), 181 deletions(-) create mode 100644 lustre/include/uapi/linux/lustre/lgss.h diff --git a/MAINTAINERS b/MAINTAINERS index 5dc30f0..a04977d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -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 diff --git a/lustre/include/uapi/linux/lustre/Makefile.am b/lustre/include/uapi/linux/lustre/Makefile.am index 4258024..b310a5a 100644 --- a/lustre/include/uapi/linux/lustre/Makefile.am +++ b/lustre/include/uapi/linux/lustre/Makefile.am @@ -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 index 0000000..52c67fe --- /dev/null +++ b/lustre/include/uapi/linux/lustre/lgss.h @@ -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 + +/* + * 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 diff --git a/lustre/include/uapi/linux/lustre/lustre_idl.h b/lustre/include/uapi/linux/lustre/lustre_idl.h index 0162137..af885fa 100644 --- a/lustre/include/uapi/linux/lustre/lustre_idl.h +++ b/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -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 */ diff --git a/lustre/ptlrpc/gss/gss_cli_upcall.c b/lustre/ptlrpc/gss/gss_cli_upcall.c index 4a42f65..0b4bfba 100644 --- a/lustre/ptlrpc/gss/gss_cli_upcall.c +++ b/lustre/ptlrpc/gss/gss_cli_upcall.c @@ -47,6 +47,7 @@ #include #include #include +#include #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(¶m, 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, ¶m, 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) diff --git a/lustre/ptlrpc/gss/gss_internal.h b/lustre/ptlrpc/gss/gss_internal.h index 40e7170..d8302ba 100644 --- a/lustre/ptlrpc/gss/gss_internal.h +++ b/lustre/ptlrpc/gss/gss_internal.h @@ -18,18 +18,7 @@ /* * 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) diff --git a/lustre/ptlrpc/wiretest.c b/lustre/ptlrpc/wiretest.c index 6250bb4..70d9475 100644 --- a/lustre/ptlrpc/wiretest.c +++ b/lustre/ptlrpc/wiretest.c @@ -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 */ diff --git a/lustre/utils/gss/gssd_proc.c b/lustre/utils/gss/gssd_proc.c index 0aa13e8..3a82045 100644 --- a/lustre/utils/gss/gssd_proc.c +++ b/lustre/utils/gss/gssd_proc.c @@ -65,6 +65,7 @@ #endif #include +#include #include "gssd.h" #include "err_util.h" diff --git a/lustre/utils/gss/lgss_keyring.c b/lustre/utils/gss/lgss_keyring.c index c5e0d4a..f34981c 100644 --- a/lustre/utils/gss/lgss_keyring.c +++ b/lustre/utils/gss/lgss_keyring.c @@ -52,6 +52,7 @@ #include #include +#include #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; } diff --git a/lustre/utils/gss/lsupport.h b/lustre/utils/gss/lsupport.h index 64871f5..7a6ec0b 100644 --- a/lustre/utils/gss/lsupport.h +++ b/lustre/utils/gss/lsupport.h @@ -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" diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c index ce055ca..5b2f64e 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -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(); diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c index fc0d981..02e946f 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -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 */ -- 1.8.3.1