Whamcloud - gitweb
Reverting the changes
[fs/lustre-release.git] / lustre / ptlrpc / gss / gss_keyring.c
index 7dde1bb..8301482 100644 (file)
@@ -1,23 +1,41 @@
 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
  * vim:expandtab:shiftwidth=8:tabstop=8:
  *
- * Copyright (C) 2007 Cluster File Systems, Inc.
- *   Author: Eric Mei <ericm@clusterfs.com>
+ * GPL HEADER START
  *
- *   This file is part of Lustre, http://www.lustre.org.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- *   Lustre is free software; you can redistribute it and/or
- *   modify it under the terms of version 2 of the GNU General Public
- *   License as published by the Free Software Foundation.
+ * 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.
  *
- *   Lustre 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 for more details.
+ * 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
- *   along with Lustre; if not, write to the Free Software
- *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * You should have received a copy of the GNU General Public License
+ * version 2 along with this program; If not, see
+ * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ *
+ * GPL HEADER END
+ */
+/*
+ * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Use is subject to license terms.
+ */
+/*
+ * This file is part of Lustre, http://www.lustre.org/
+ * Lustre is a trademark of Sun Microsystems, Inc.
+ *
+ * lustre/ptlrpc/gss/gss_keyring.c
+ *
+ * Author: Eric Mei <ericm@clusterfs.com>
  */
 
 #ifndef EXPORT_SYMTAB
@@ -1197,7 +1215,7 @@ int gss_kt_instantiate(struct key *key, const void *data, size_t datalen)
         ENTRY;
 
         if (data != NULL || datalen != 0) {
-                CERROR("invalid: data %p, len %d\n", data, datalen);
+                CERROR("invalid: data %p, len "LPSZ"\n", data, datalen);
                 RETURN(-EINVAL);
         }
 
@@ -1240,11 +1258,12 @@ int gss_kt_update(struct key *key, const void *data, size_t datalen)
         struct ptlrpc_cli_ctx   *ctx = key->payload.data;
         struct gss_cli_ctx      *gctx;
         rawobj_t                 tmpobj = RAWOBJ_EMPTY;
+        __u32                    datalen32 = (__u32) datalen;
         int                      rc;
         ENTRY;
 
         if (data == NULL || datalen == 0) {
-                CWARN("invalid: data %p, len %d\n", data, datalen);
+                CWARN("invalid: data %p, len "LPSZ"\n", data, datalen);
                 RETURN(-EINVAL);
         }
 
@@ -1279,7 +1298,7 @@ int gss_kt_update(struct key *key, const void *data, size_t datalen)
         sptlrpc_cli_ctx_get(ctx);
         gctx = ctx2gctx(ctx);
 
-        rc = buffer_extract_bytes(&data, &datalen, &gctx->gc_win,
+        rc = buffer_extract_bytes(&data, &datalen32, &gctx->gc_win,
                                   sizeof(gctx->gc_win));
         if (rc) {
                 CERROR("failed extract seq_win\n");
@@ -1289,14 +1308,14 @@ int gss_kt_update(struct key *key, const void *data, size_t datalen)
         if (gctx->gc_win == 0) {
                 __u32   nego_rpc_err, nego_gss_err;
 
-                rc = buffer_extract_bytes(&data, &datalen, &nego_rpc_err,
+                rc = buffer_extract_bytes(&data, &datalen32, &nego_rpc_err,
                                           sizeof(nego_rpc_err));
                 if (rc) {
                         CERROR("failed to extrace rpc rc\n");
                         goto out;
                 }
 
-                rc = buffer_extract_bytes(&data, &datalen, &nego_gss_err,
+                rc = buffer_extract_bytes(&data, &datalen32, &nego_gss_err,
                                           sizeof(nego_gss_err));
                 if (rc) {
                         CERROR("failed to extrace gss rc\n");
@@ -1309,13 +1328,13 @@ int gss_kt_update(struct key *key, const void *data, size_t datalen)
                 rc = nego_rpc_err ? nego_rpc_err : -EACCES;
         } else {
                 rc = rawobj_extract_local_alloc(&gctx->gc_handle,
-                                                (__u32 **) &data, &datalen);
+                                                (__u32 **) &data, &datalen32);
                 if (rc) {
                         CERROR("failed extract handle\n");
                         goto out;
                 }
 
-                rc = rawobj_extract_local(&tmpobj, (__u32 **) &data, &datalen);
+                rc = rawobj_extract_local(&tmpobj, (__u32 **) &data,&datalen32);
                 if (rc) {
                         CERROR("failed extract mech\n");
                         goto out;