inq_cred.c (krb5_gss_inquire_cred):
authorTheodore Tso <tytso@mit.edu>
Mon, 25 May 1998 01:45:17 +0000 (01:45 +0000)
committerTheodore Tso <tytso@mit.edu>
Mon, 25 May 1998 01:45:17 +0000 (01:45 +0000)
inq_context.c (krb5_gss_inquire_context):
import_name.c (krb5_gss_import_name):
export_name.c (krb5_gss_export_name):
disp_name.c (krb5_gss_display_name):
context_time.c (krb5_gss_context_time):
acquire_cred.c (krb5_gss_acquire_cred): Clean up -Wall flames.

indicate_mechs.c (krb5_gss_indicate_mechs): Return a dynamic OID set.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10577 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/gssapi/krb5/ChangeLog
src/lib/gssapi/krb5/acquire_cred.c
src/lib/gssapi/krb5/context_time.c
src/lib/gssapi/krb5/disp_name.c
src/lib/gssapi/krb5/export_name.c
src/lib/gssapi/krb5/import_name.c
src/lib/gssapi/krb5/indicate_mechs.c
src/lib/gssapi/krb5/inq_context.c
src/lib/gssapi/krb5/inq_cred.c
src/lib/gssapi/krb5/k5seal.c

index d78347bad6b5ba1d11c1b5b2724b6e9fbc6d6c4a..d736938f7cd332ee83aea516ede53cb2f0139ff8 100644 (file)
@@ -1,3 +1,16 @@
+1998-05-18  Theodore Ts'o  <tytso@rsts-11.mit.edu>
+
+       * inq_cred.c (krb5_gss_inquire_cred): 
+       * inq_context.c (krb5_gss_inquire_context): 
+       * import_name.c (krb5_gss_import_name): 
+       * export_name.c (krb5_gss_export_name): 
+       * disp_name.c (krb5_gss_display_name): 
+       * context_time.c (krb5_gss_context_time): 
+       * acquire_cred.c (krb5_gss_acquire_cred): Clean up -Wall flames.
+
+       * indicate_mechs.c (krb5_gss_indicate_mechs): Return a dynamic OID
+               set.
+
 Fri Feb 27 18:41:08 1998  Theodore Y. Ts'o  <tytso@mit.edu>
 
        * export_name.c (krb5_gss_export_name): Fix bug in
index 272ea426dc881812cc9336725227c756d5caa6b2..1ca1bf31a7dfa2a693d7349b4a13bdb192d4c314 100644 (file)
@@ -56,7 +56,7 @@ acquire_accept_cred(context, minor_status, desired_name, output_princ, cred)
 
    /* open the default keytab */
 
-   if (code = krb5_kt_default(context, &kt)) {
+   if ((code = krb5_kt_default(context, &kt))) {
       *minor_status = code;
       return(GSS_S_CRED_UNAVAIL);
    }
@@ -65,8 +65,8 @@ acquire_accept_cred(context, minor_status, desired_name, output_princ, cred)
       requested, use the default sn2princ output */
 
    if (desired_name == (gss_name_t) NULL) {
-      if (code = krb5_sname_to_principal(context, NULL, NULL, KRB5_NT_SRV_HST,
-                                        &princ)) {
+      if ((code = krb5_sname_to_principal(context, NULL, NULL, KRB5_NT_SRV_HST,
+                                         &princ))) {
         (void) krb5_kt_close(context, kt);
         *minor_status = code;
         return(GSS_S_FAILURE);
@@ -76,7 +76,7 @@ acquire_accept_cred(context, minor_status, desired_name, output_princ, cred)
       princ = (krb5_principal) desired_name;
    }
 
-   if (code = krb5_kt_get_entry(context, kt, princ, 0, 0, &entry)) {
+   if ((code = krb5_kt_get_entry(context, kt, princ, 0, 0, &entry))) {
        (void) krb5_kt_close(context, kt);
        if (code == KRB5_KT_NOTFOUND)
             *minor_status = KG_KEYTAB_NOMATCH;
@@ -128,7 +128,7 @@ acquire_init_cred(context, minor_status, desired_name, output_princ, cred)
 
    /* open the default credential cache */
 
-   if (code = krb5_cc_default(context, &ccache)) {
+   if ((code = krb5_cc_default(context, &ccache))) {
       *minor_status = code;
       return(GSS_S_CRED_UNAVAIL);
    }
@@ -136,14 +136,14 @@ acquire_init_cred(context, minor_status, desired_name, output_princ, cred)
    /* turn off OPENCLOSE mode while extensive frobbing is going on */
 
    flags = 0;          /* turns off OPENCLOSE mode */
-   if (code = krb5_cc_set_flags(context, ccache, flags)) {
+   if ((code = krb5_cc_set_flags(context, ccache, flags))) {
       *minor_status = code;
       return(GSS_S_CRED_UNAVAIL);
    }
 
    /* get out the principal name and see if it matches */
 
-   if (code = krb5_cc_get_principal(context, ccache, &princ)) {
+   if ((code = krb5_cc_get_principal(context, ccache, &princ))) {
       (void)krb5_cc_close(context, ccache);
       *minor_status = code;
       return(GSS_S_FAILURE);
@@ -164,7 +164,7 @@ acquire_init_cred(context, minor_status, desired_name, output_princ, cred)
 
    /* iterate over the ccache, find the tgt */
 
-   if (code = krb5_cc_start_seq_get(context, ccache, &cur)) {
+   if ((code = krb5_cc_start_seq_get(context, ccache, &cur))) {
       (void)krb5_cc_close(context, ccache);
       *minor_status = code;
       return(GSS_S_FAILURE);
@@ -210,13 +210,13 @@ acquire_init_cred(context, minor_status, desired_name, output_princ, cred)
       return(GSS_S_FAILURE);
    } else {
       /* this means that we found an endtime to use. */
-      if (code = krb5_cc_end_seq_get(context, ccache, &cur)) {
+      if ((code = krb5_cc_end_seq_get(context, ccache, &cur))) {
         (void)krb5_cc_close(context, ccache);
         *minor_status = code;
         return(GSS_S_FAILURE);
       }
       flags = KRB5_TC_OPENCLOSE;       /* turns on OPENCLOSE mode */
-      if (code = krb5_cc_set_flags(context, ccache, flags)) {
+      if ((code = krb5_cc_set_flags(context, ccache, flags))) {
         (void)krb5_cc_close(context, ccache);
         *minor_status = code;
         return(GSS_S_FAILURE);
@@ -367,8 +367,8 @@ krb5_gss_acquire_cred(minor_status, desired_name, time_req,
    /* if the princ wasn't filled in already, fill it in now */
 
    if (!cred->princ)
-      if (code = krb5_copy_principal(context, (krb5_principal) desired_name,
-                                    &(cred->princ))) {
+      if ((code = krb5_copy_principal(context, (krb5_principal) desired_name,
+                                     &(cred->princ)))) {
         if (cred->ccache)
            (void)krb5_cc_close(context, cred->ccache);
         if (cred->keytab)
@@ -388,7 +388,7 @@ krb5_gss_acquire_cred(minor_status, desired_name, time_req,
    } else {
       krb5_timestamp now;
 
-      if (code = krb5_timeofday(context, &now)) {
+      if ((code = krb5_timeofday(context, &now))) {
         if (cred->ccache)
            (void)krb5_cc_close(context, cred->ccache);
         if (cred->keytab)
index 76f1489b77ee2ae22733f63be016d65b10f542b3..8b94ee587d362886e1453bed8ef855c38851edc6 100644 (file)
@@ -54,7 +54,7 @@ krb5_gss_context_time(minor_status, context_handle, time_rec)
       return(GSS_S_NO_CONTEXT);
    }
 
-   if (code = krb5_timeofday(context, &now)) {
+   if ((code = krb5_timeofday(context, &now))) {
       *minor_status = code;
       return(GSS_S_FAILURE);
    }
index 77f520035f59d3d78533fa26ea85f222673651cd..b7e183048e2de1b9c0093ca6171e55165d705631 100644 (file)
@@ -45,7 +45,8 @@ krb5_gss_display_name(minor_status, input_name, output_name_buffer,
       return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_BAD_NAME);
    }
 
-   if (code = krb5_unparse_name(context, (krb5_principal) input_name, &str)) {
+   if ((code = krb5_unparse_name(context,
+                                (krb5_principal) input_name, &str))) {
       *minor_status = code;
       return(GSS_S_FAILURE);
    }
index f3d25db15f3f57288d726a8235cbf592b6d82223..23cb080e04e33ebe2c3746f28827d9516487fd35 100644 (file)
@@ -45,8 +45,8 @@ OM_uint32 krb5_gss_export_name(OM_uint32  *minor_status,
                return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_BAD_NAME);
        }
 
-       if (code = krb5_unparse_name(context, (krb5_principal) input_name, 
-                                    &str)) {
+       if ((code = krb5_unparse_name(context, (krb5_principal) input_name, 
+                                     &str))) {
                *minor_status = code;
                return(GSS_S_FAILURE);
        }
index 90206a7011270b4fdf689be931e27db5dead53d6..74de6181352e1611e41b0b02ca4ffe33fdac50f0 100644 (file)
@@ -85,7 +85,7 @@ krb5_gss_import_name(minor_status, input_name_buffer,
       tmp[input_name_buffer->length] = 0;
 
       service = tmp;
-      if (host = strchr(tmp, '@')) {
+      if ((host = strchr(tmp, '@'))) {
         *host = '\0';
         host++;
       }
index bc53b4434d84c229278408275681879e27f046aa..9c1ca59e697b6abb4d1e1884cf4ff2c068eed29e 100644 (file)
@@ -32,6 +32,12 @@ krb5_gss_indicate_mechs(minor_status, mech_set)
      gss_OID_set *mech_set;
 {
    *minor_status = 0;
-   *mech_set = (gss_OID_set) gss_mech_set_krb5;
+
+   if (! g_copy_OID_set(gss_mech_set_krb5, mech_set)) {
+         *mech_set     = GSS_C_NO_OID_SET;
+         *minor_status = ENOMEM;
+         return(GSS_S_FAILURE);
+   }
+
    return(GSS_S_COMPLETE);
 }
index 5e5746344166ad16864c8e112a2926a4fc3e697e..5c156f86d66aa16dd991983bc5486781da9e053a 100644 (file)
@@ -67,7 +67,7 @@ krb5_gss_inquire_context(minor_status, context_handle, initiator_name,
    init = NULL;
    accept = NULL;
 
-   if (code = krb5_timeofday(context, &now)) {
+   if ((code = krb5_timeofday(context, &now))) {
       *minor_status = code;
       return(GSS_S_FAILURE);
    }
@@ -76,9 +76,9 @@ krb5_gss_inquire_context(minor_status, context_handle, initiator_name,
       lifetime = 0;
 
    if (initiator_name) {
-      if (code = krb5_copy_principal(context, 
-                                    ctx->initiate?ctx->here:ctx->there,
-                                    &init)) {
+      if ((code = krb5_copy_principal(context, 
+                                     ctx->initiate?ctx->here:ctx->there,
+                                     &init))) {
         *minor_status = code;
         return(GSS_S_FAILURE);
       }
@@ -90,9 +90,9 @@ krb5_gss_inquire_context(minor_status, context_handle, initiator_name,
    }
 
    if (acceptor_name) {
-      if (code = krb5_copy_principal(context, 
-                                    ctx->initiate?ctx->there:ctx->here,
-                                    &accept)) {
+      if ((code = krb5_copy_principal(context, 
+                                     ctx->initiate?ctx->there:ctx->here,
+                                     &accept))) {
         if (init) krb5_free_principal(context, init);
         *minor_status = code;
         return(GSS_S_FAILURE);
index b2edc257127fd55df7b649500adeafbc04ea8e30..ee5d436c19bafb798cc5848693b372c7614911fd 100644 (file)
@@ -65,7 +65,7 @@ krb5_gss_inquire_cred(minor_status, cred_handle, name, lifetime_ret,
 
    cred = (krb5_gss_cred_id_t) cred_handle;
 
-   if (code = krb5_timeofday(context, &now)) {
+   if ((code = krb5_timeofday(context, &now))) {
       *minor_status = code;
       return(GSS_S_FAILURE);
    }
@@ -78,7 +78,7 @@ krb5_gss_inquire_cred(minor_status, cred_handle, name, lifetime_ret,
        lifetime = GSS_C_INDEFINITE;
 
    if (name) {
-      if (code = krb5_copy_principal(context, cred->princ, &ret_name)) {
+      if ((code = krb5_copy_principal(context, cred->princ, &ret_name))) {
         *minor_status = code;
         return(GSS_S_FAILURE);
       }
index 254d5168077384c60d3f7a11b9991d9263986a39..1182b5f31ee7d83398492ea372de6da62f4c6557 100644 (file)
@@ -114,7 +114,7 @@ make_seal_token(context, enc_ed, seq_ed, seqnum, direction, text, token,
            return(ENOMEM);
         }
 
-        if (code = kg_make_confounder(enc_ed, plain)) {
+        if ((code = kg_make_confounder(enc_ed, plain))) {
            xfree(plain);
            xfree(md5cksum.contents);
            xfree(t);
@@ -133,8 +133,9 @@ make_seal_token(context, enc_ed, seq_ed, seqnum, direction, text, token,
       }
 
       if (encrypt) {
-        if (code = kg_encrypt(context, enc_ed, NULL, (krb5_pointer) plain,
-                              (krb5_pointer) (ptr+cksum_size+14), tmsglen)) {
+        if ((code = kg_encrypt(context, enc_ed, NULL, (krb5_pointer) plain,
+                               (krb5_pointer) (ptr+cksum_size+14),
+                               tmsglen))) {
            if (plain)
               xfree(plain);
            xfree(md5cksum.contents);
@@ -234,10 +235,10 @@ make_seal_token(context, enc_ed, seq_ed, seqnum, direction, text, token,
 
        xfree(cksum.contents);
 #else
-       if (code = kg_encrypt(context, seq_ed,
-                            (g_OID_equal(oid, gss_mech_krb5_old) ?
-                             seq_ed->key->contents : NULL),
-                            md5cksum.contents, md5cksum.contents, 16)) {
+       if ((code = kg_encrypt(context, seq_ed,
+                             (g_OID_equal(oid, gss_mech_krb5_old) ?
+                              seq_ed->key->contents : NULL),
+                             md5cksum.contents, md5cksum.contents, 16))) {
          xfree(md5cksum.contents);
          xfree(t);
          return code;
@@ -256,8 +257,8 @@ make_seal_token(context, enc_ed, seq_ed, seqnum, direction, text, token,
 
    /* create the seq_num */
 
-   if (code = kg_make_seq_num(context, seq_ed, direction?0:0xff, *seqnum,
-                             ptr+14, ptr+6)) {
+   if ((code = kg_make_seq_num(context, seq_ed, direction?0:0xff, *seqnum,
+                              ptr+14, ptr+6))) {
       xfree(t);
       return(code);
    }