pull up r20064 from trunk
authorTom Yu <tlyu@mit.edu>
Tue, 2 Oct 2007 02:42:02 +0000 (02:42 +0000)
committerTom Yu <tlyu@mit.edu>
Tue, 2 Oct 2007 02:42:02 +0000 (02:42 +0000)
 r20064@cathode-dark-space:  raeburn | 2007-10-01 19:48:57 -0400
 ticket: 5800
 tags: pullup

 Initialize options for _alloc interface to same defaults as for _init.

ticket: 5800
version_fixed: 1.6.3

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-6@20078 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/gic_opt.c

index e3e7d0b50ca220d06cf753dc9091157bd4660b9f..227391ae42e17fcf4a5b7bb83e9068a1dd900107 100644 (file)
@@ -1,10 +1,17 @@
 #include "k5-int.h"
 #include "int-proto.h"
 
+static void
+init_common(krb5_get_init_creds_opt *opt)
+{
+    opt->flags |= KRB5_GET_INIT_CREDS_OPT_CHG_PWD_PRMPT;
+}
+
 void KRB5_CALLCONV
 krb5_get_init_creds_opt_init(krb5_get_init_creds_opt *opt)
 {
-   opt->flags = KRB5_GET_INIT_CREDS_OPT_CHG_PWD_PRMPT;
+    opt->flags = 0;
+    init_common(opt);
 }
 
 void KRB5_CALLCONV
@@ -174,6 +181,7 @@ krb5_get_init_creds_opt_alloc(krb5_context context,
        return ENOMEM;
 
     *opt = (krb5_get_init_creds_opt *) opte;
+    init_common(*opt);
     return 0;
 }