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>
lustre_fiemap.h \
lustre_idl.h \
lustre_ioctl.h \
+ lgss.h \
lustre_kernelcomm.h \
lustre_ostid.h \
lustre_param.h \
lustre_fiemap.h \
lustre_idl.h \
lustre_ioctl.h \
+ lgss.h \
lustre_kernelcomm.h \
lustre_lfsck_user.h \
lustre_log_user.h \
--- /dev/null
+/*
+ * 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
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 */
#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"
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;
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) {
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)
/*
* 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 {
}
}
-/*
- * 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)
(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 */
#endif
#include <libcfs/util/param.h>
+#include <uapi/linux/lustre/lgss.h>
#include "gssd.h"
#include "err_util.h"
#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"
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;
}
#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"
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)
{
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();
(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 */