All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] libgssglue clean up.
@ 2012-10-24 18:08 Steve Dickson
  2012-10-24 18:08 ` [PATCH 1/5] Fixed warnings in src/g_canon_name.c Steve Dickson
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Steve Dickson @ 2012-10-24 18:08 UTC (permalink / raw)
  To: Linux NFS Mailing list

These patches, including the ones Yao Zhao posted a while back,
remove a number of different types of warnings through out the 
code.

Steve Dickson (2):
  Fixed warnings in src/g_mit_krb5_mech.c
  Fixed warnings in src/g_unseal.c and src/g_verify.c

Yao Zhao (3):
  Fixed warnings in src/g_canon_name.c
  Fixed warnings in src/g_initialize.c
  Fixed warnings in src/g_inq_cred.c

 src/g_canon_name.c    | 16 +++++++++++-----
 src/g_initialize.c    |  2 ++
 src/g_inq_cred.c      |  6 ++++--
 src/g_mit_krb5_mech.c |  1 -
 src/g_unseal.c        |  2 +-
 src/g_verify.c        |  2 +-
 src/mglueP.h          |  4 ++--
 7 files changed, 21 insertions(+), 12 deletions(-)

-- 
1.7.11.7


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/5] Fixed warnings in src/g_canon_name.c
  2012-10-24 18:08 [PATCH 0/5] libgssglue clean up Steve Dickson
@ 2012-10-24 18:08 ` Steve Dickson
  2012-10-24 18:08 ` [PATCH 2/5] Fixed warnings in src/g_initialize.c Steve Dickson
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Steve Dickson @ 2012-10-24 18:08 UTC (permalink / raw)
  To: Linux NFS Mailing list

From: Yao Zhao <yao.zhao@windriver.com>

g_canon_name.c:125:5: warning: passing argument 2 of
'__gss_copy_namebuf' from incompatible pointer type [enabled by default]

the 2nd argument of __gss_copy_namebuf should be address of
*gss_buffer_t, but a *gss_buffer_t is assigned.

what __gss_copy_namebuf does is to alloc memory for a gss_buffer_desc
and copy from src and return its address.

if following code failed, gss_release_name will free
union_canon_name->external_name.value if it is not NULL.

Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
---
 src/g_canon_name.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/g_canon_name.c b/src/g_canon_name.c
index 11a6b21..080befe 100644
--- a/src/g_canon_name.c
+++ b/src/g_canon_name.c
@@ -121,11 +121,17 @@ gss_canonicalize_name (OM_uint32 *minor_status,
 
     union_canon_name->mech_name = mech_name;
 
-    status = __gss_copy_namebuf(&union_input_name->external_name,
-				&union_canon_name->external_name);
-    if (status != GSS_S_COMPLETE)
-	goto failure;
-
+    union_canon_name->external_name.value = (void*) malloc(
+                      union_input_name->external_name.length + 1);
+    if (!union_canon_name->external_name.value)
+        goto failure;
+
+    memcpy(union_canon_name->external_name.value, 
+           union_input_name->external_name.value, 
+           union_input_name->external_name.length);
+    union_canon_name->external_name.length = 
+                      union_input_name->external_name.length; 
+   
     if (union_input_name->name_type != GSS_C_NO_OID) {
 	status = generic_gss_copy_oid(minor_status,
 				      union_input_name->name_type,
-- 
1.7.11.7


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/5] Fixed warnings in src/g_initialize.c
  2012-10-24 18:08 [PATCH 0/5] libgssglue clean up Steve Dickson
  2012-10-24 18:08 ` [PATCH 1/5] Fixed warnings in src/g_canon_name.c Steve Dickson
@ 2012-10-24 18:08 ` Steve Dickson
  2012-10-24 18:08 ` [PATCH 3/5] Fixed warnings in src/g_inq_cred.c Steve Dickson
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Steve Dickson @ 2012-10-24 18:08 UTC (permalink / raw)
  To: Linux NFS Mailing list

From: Yao Zhao <yao.zhao@windriver.com>

g_initialize.c: In function 'linux_initialize':
g_initialize.c:275:5: warning: implicit declaration of function 'getuid'
[-Wimplicit-function-declaration]
g_initialize.c:275:5: warning: implicit declaration of function
'geteuid' [-Wimplicit-function-declaration]

Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
---
 src/g_initialize.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/g_initialize.c b/src/g_initialize.c
index 908398e..d1cb172 100644
--- a/src/g_initialize.c
+++ b/src/g_initialize.c
@@ -29,6 +29,8 @@
 #include "mglueP.h"
 #include <stdlib.h>
 
+#include <unistd.h>   /*getuid, geteuid */
+#include <sys/types.h>
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
-- 
1.7.11.7


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/5] Fixed warnings in src/g_inq_cred.c
  2012-10-24 18:08 [PATCH 0/5] libgssglue clean up Steve Dickson
  2012-10-24 18:08 ` [PATCH 1/5] Fixed warnings in src/g_canon_name.c Steve Dickson
  2012-10-24 18:08 ` [PATCH 2/5] Fixed warnings in src/g_initialize.c Steve Dickson
@ 2012-10-24 18:08 ` Steve Dickson
  2012-10-24 18:08 ` [PATCH 4/5] Fixed warnings in src/g_mit_krb5_mech.c Steve Dickson
  2012-10-24 18:08 ` [PATCH 5/5] Fixed warnings in src/g_unseal.c and src/g_verify.c Steve Dickson
  4 siblings, 0 replies; 6+ messages in thread
From: Steve Dickson @ 2012-10-24 18:08 UTC (permalink / raw)
  To: Linux NFS Mailing list

From: Yao Zhao <yao.zhao@windriver.com>

g_inq_cred.c:161:8: warning: passing argument 3 of
'generic_gss_copy_oid' from incompatible pointer type [enabled by default]

Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
---
 src/g_inq_cred.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/g_inq_cred.c b/src/g_inq_cred.c
index 9f531d8..8367a56 100644
--- a/src/g_inq_cred.c
+++ b/src/g_inq_cred.c
@@ -152,13 +152,15 @@ gss_OID_set *		mechanisms;
 			     union_cred->count);
 	if ((*mechanisms)->elements == NULL) {
 	    *minor_status = ENOMEM;
+	    free(*mechanisms);
+	    *mechanisms = GSS_C_NO_OID_SET;
 	    return (GSS_S_FAILURE);
 	}
 
 	for (i=0; i < union_cred->count; i++) {
-	    status = generic_gss_copy_oid(minor_status,
+	    status = generic_gss_add_oid_set_member(minor_status,
 	    				  &union_cred->mechs_array[i],
-					  &((*mechanisms)->elements[i]));
+					  mechanisms);
 	    if (status != GSS_S_COMPLETE)
 	        break;
 	}
-- 
1.7.11.7


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/5] Fixed warnings in src/g_mit_krb5_mech.c
  2012-10-24 18:08 [PATCH 0/5] libgssglue clean up Steve Dickson
                   ` (2 preceding siblings ...)
  2012-10-24 18:08 ` [PATCH 3/5] Fixed warnings in src/g_inq_cred.c Steve Dickson
@ 2012-10-24 18:08 ` Steve Dickson
  2012-10-24 18:08 ` [PATCH 5/5] Fixed warnings in src/g_unseal.c and src/g_verify.c Steve Dickson
  4 siblings, 0 replies; 6+ messages in thread
From: Steve Dickson @ 2012-10-24 18:08 UTC (permalink / raw)
  To: Linux NFS Mailing list

g_mit_krb5_mech.c:209:1: warning: label 'out' defined but not used [-Wunused-label]

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 src/g_mit_krb5_mech.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/g_mit_krb5_mech.c b/src/g_mit_krb5_mech.c
index b2ad784..aa7433a 100644
--- a/src/g_mit_krb5_mech.c
+++ b/src/g_mit_krb5_mech.c
@@ -206,6 +206,5 @@ internal_krb5_gss_initialize(void *dl)
 		krb5_mechanism.gss_free_lucid_sec_context = p;
 	}
 	krb5_mech_ptr = &krb5_mechanism;
-out:
 	return (krb5_mech_ptr);
 }
-- 
1.7.11.7


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 5/5] Fixed warnings in src/g_unseal.c and src/g_verify.c
  2012-10-24 18:08 [PATCH 0/5] libgssglue clean up Steve Dickson
                   ` (3 preceding siblings ...)
  2012-10-24 18:08 ` [PATCH 4/5] Fixed warnings in src/g_mit_krb5_mech.c Steve Dickson
@ 2012-10-24 18:08 ` Steve Dickson
  4 siblings, 0 replies; 6+ messages in thread
From: Steve Dickson @ 2012-10-24 18:08 UTC (permalink / raw)
  To: Linux NFS Mailing list

Changed the signedness qop_state argument from int * to gss_qop_t *

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 src/g_unseal.c | 2 +-
 src/g_verify.c | 2 +-
 src/mglueP.h   | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/g_unseal.c b/src/g_unseal.c
index 5f5ccf0..a1c78e3 100644
--- a/src/g_unseal.c
+++ b/src/g_unseal.c
@@ -41,7 +41,7 @@ gss_ctx_id_t		context_handle;
 gss_buffer_t		input_message_buffer;
 gss_buffer_t		output_message_buffer;
 int *			conf_state;
-int *			qop_state;
+gss_qop_t *		qop_state;
 
 {
     OM_uint32		status;
diff --git a/src/g_verify.c b/src/g_verify.c
index 4439405..6c734bc 100644
--- a/src/g_verify.c
+++ b/src/g_verify.c
@@ -74,7 +74,7 @@ int *			qop_state;
 				      ctx->internal_ctx_id,
 				      message_buffer,
 				      token_buffer,
-				      qop_state);
+				      (gss_qop_t *)qop_state);
 	else
 	    status = GSS_S_BAD_BINDINGS;
 
diff --git a/src/mglueP.h b/src/mglueP.h
index da3eaed..78eabdd 100644
--- a/src/mglueP.h
+++ b/src/mglueP.h
@@ -171,7 +171,7 @@ typedef struct gss_config {
 		    gss_buffer_t,	/* input_message_buffer */
 		    gss_buffer_t,	/* output_message_buffer */
 		    int*,		/* conf_state */
-		    int*		/* qop_state */
+		    gss_qop_t *	/* qop_state */
 		    );
     OM_uint32       (*gss_display_status)
 	(
@@ -316,7 +316,7 @@ typedef struct gss_config {
 		    gss_ctx_id_t,	/* context_handle */
 		    gss_buffer_t,	/* message_buffer */
 		    gss_buffer_t,	/* token_buffer */
-		    int*		/* qop_state */
+		    gss_qop_t  *	/* qop_state */
 		    );
 
     OM_uint32       (*gss_export_lucid_sec_context)
-- 
1.7.11.7


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-10-24 18:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-24 18:08 [PATCH 0/5] libgssglue clean up Steve Dickson
2012-10-24 18:08 ` [PATCH 1/5] Fixed warnings in src/g_canon_name.c Steve Dickson
2012-10-24 18:08 ` [PATCH 2/5] Fixed warnings in src/g_initialize.c Steve Dickson
2012-10-24 18:08 ` [PATCH 3/5] Fixed warnings in src/g_inq_cred.c Steve Dickson
2012-10-24 18:08 ` [PATCH 4/5] Fixed warnings in src/g_mit_krb5_mech.c Steve Dickson
2012-10-24 18:08 ` [PATCH 5/5] Fixed warnings in src/g_unseal.c and src/g_verify.c Steve Dickson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.