svn rev #23875: branches/iakerb/src/ clients/ksu/ include/krb5/ lib/krb5/ccache/ ...
ghudson@MIT.EDU
ghudson at MIT.EDU
Thu Apr 8 12:41:17 EDT 2010
http://src.mit.edu/fisheye/changelog/krb5/?cs=23875
Commit By: ghudson
Log Message:
Merge trunk changes from r23842 to r23874 to iakerb branch.
Changed Files:
U branches/iakerb/src/clients/ksu/ccache.c
U branches/iakerb/src/configure.in
U branches/iakerb/src/include/krb5/krb5.hin
U branches/iakerb/src/lib/krb5/ccache/ccbase.c
U branches/iakerb/src/util/testrealm.py
Modified: branches/iakerb/src/clients/ksu/ccache.c
===================================================================
--- branches/iakerb/src/clients/ksu/ccache.c 2010-04-08 16:39:31 UTC (rev 23874)
+++ branches/iakerb/src/clients/ksu/ccache.c 2010-04-08 16:41:17 UTC (rev 23875)
@@ -87,12 +87,8 @@
*stored = krb5_find_princ_in_cred_list(context, cc_def_creds_arr,
primary_principal);
-#ifdef HAVE_LSTAT
if (!lstat( cc_other_name, &st_temp))
-#else /*HAVE_LSTAT*/
- if (!stat( cc_other_name, &st_temp))
-#endif
- return EINVAL;
+ return EINVAL;
if (krb5_seteuid(0)||krb5_seteuid(target_uid)) {
return errno;
@@ -679,141 +675,137 @@
}
-#ifdef HAVE_LSTAT
if (!lstat( cc_other_name, &st_temp)) {
-#else /*HAVE_LSTAT*/
- if (!stat( cc_other_name, &st_temp)) {
-#endif
- return EINVAL;
- }
+ return EINVAL;
+ }
- if (krb5_seteuid(0)||krb5_seteuid(target_uid)) {
- return errno;
- }
+ if (krb5_seteuid(0)||krb5_seteuid(target_uid)) {
+ return errno;
+ }
- if ((retval = krb5_cc_initialize(context, *cc_other, prst))){
- return retval;
- }
+ if ((retval = krb5_cc_initialize(context, *cc_other, prst))){
+ return retval;
+ }
- retval = krb5_store_some_creds(context, * cc_other,
- cc_def_creds_arr, cc_other_creds_arr, prst, stored);
+ retval = krb5_store_some_creds(context, * cc_other,
+ cc_def_creds_arr, cc_other_creds_arr, prst, stored);
- if (cc_def_creds_arr){
- while (cc_def_creds_arr[i]){
- krb5_free_creds(context, cc_def_creds_arr[i]);
- i++;
- }
+ if (cc_def_creds_arr){
+ while (cc_def_creds_arr[i]){
+ krb5_free_creds(context, cc_def_creds_arr[i]);
+ i++;
}
+ }
- i=0;
+ i=0;
- if(cc_other_creds_arr){
- while (cc_other_creds_arr[i]){
- krb5_free_creds(context, cc_other_creds_arr[i]);
- i++;
- }
+ if(cc_other_creds_arr){
+ while (cc_other_creds_arr[i]){
+ krb5_free_creds(context, cc_other_creds_arr[i]);
+ i++;
}
-
- *cc_out = *cc_other;
- return retval;
}
- krb5_error_code krb5_ccache_filter (context, cc, prst)
- krb5_context context;
+ *cc_out = *cc_other;
+ return retval;
+}
+
+krb5_error_code krb5_ccache_filter (context, cc, prst)
+ krb5_context context;
krb5_ccache cc;
krb5_principal prst;
- {
+{
- int i=0;
- krb5_error_code retval=0;
- krb5_principal temp_principal;
- krb5_creds ** cc_creds_arr = NULL;
- const char * cc_name;
- krb5_boolean stored;
- struct stat st_temp;
+ int i=0;
+ krb5_error_code retval=0;
+ krb5_principal temp_principal;
+ krb5_creds ** cc_creds_arr = NULL;
+ const char * cc_name;
+ krb5_boolean stored;
+ struct stat st_temp;
- cc_name = krb5_cc_get_name(context, cc);
+ cc_name = krb5_cc_get_name(context, cc);
- if ( ! stat(cc_name, &st_temp)){
+ if ( ! stat(cc_name, &st_temp)){
- if (auth_debug) {
- fprintf(stderr,"putting cache %s through a filter for -z option\n", cc_name);
- }
+ if (auth_debug) {
+ fprintf(stderr,"putting cache %s through a filter for -z option\n", cc_name);
+ }
- if ((retval = krb5_get_nonexp_tkts(context, cc, &cc_creds_arr))){
- return retval;
- }
+ if ((retval = krb5_get_nonexp_tkts(context, cc, &cc_creds_arr))){
+ return retval;
+ }
- if ((retval = krb5_cc_get_principal(context, cc, &temp_principal))){
- return retval;
- }
+ if ((retval = krb5_cc_get_principal(context, cc, &temp_principal))){
+ return retval;
+ }
- if ((retval = krb5_cc_initialize(context, cc, temp_principal))){
- return retval;
- }
+ if ((retval = krb5_cc_initialize(context, cc, temp_principal))){
+ return retval;
+ }
- if ((retval = krb5_store_some_creds(context, cc, cc_creds_arr,
- NULL, prst, &stored))){
- return retval;
- }
+ if ((retval = krb5_store_some_creds(context, cc, cc_creds_arr,
+ NULL, prst, &stored))){
+ return retval;
+ }
- if (cc_creds_arr){
- while (cc_creds_arr[i]){
- krb5_free_creds(context, cc_creds_arr[i]);
- i++;
- }
+ if (cc_creds_arr){
+ while (cc_creds_arr[i]){
+ krb5_free_creds(context, cc_creds_arr[i]);
+ i++;
}
}
- return 0;
}
+ return 0;
+}
- krb5_boolean krb5_find_princ_in_cred_list (context, creds_list, princ)
- krb5_context context;
+krb5_boolean krb5_find_princ_in_cred_list (context, creds_list, princ)
+ krb5_context context;
krb5_creds **creds_list;
krb5_principal princ;
- {
+{
- int i = 0;
- krb5_boolean temp_stored = FALSE;
+ int i = 0;
+ krb5_boolean temp_stored = FALSE;
- if (creds_list){
- while(creds_list[i]){
- if (krb5_principal_compare(context,
- creds_list[i]->client,
- princ)== TRUE){
- temp_stored = TRUE;
- break;
- }
-
- i++;
+ if (creds_list){
+ while(creds_list[i]){
+ if (krb5_principal_compare(context,
+ creds_list[i]->client,
+ princ)== TRUE){
+ temp_stored = TRUE;
+ break;
}
- }
- return temp_stored;
+ i++;
+ }
}
- krb5_error_code krb5_find_princ_in_cache (context, cc, princ, found)
- krb5_context context;
+ return temp_stored;
+}
+
+krb5_error_code krb5_find_princ_in_cache (context, cc, princ, found)
+ krb5_context context;
krb5_ccache cc;
krb5_principal princ;
krb5_boolean *found;
- {
- krb5_error_code retval;
- krb5_creds ** creds_list = NULL;
- const char * cc_name;
- struct stat st_temp;
+{
+ krb5_error_code retval;
+ krb5_creds ** creds_list = NULL;
+ const char * cc_name;
+ struct stat st_temp;
- cc_name = krb5_cc_get_name(context, cc);
+ cc_name = krb5_cc_get_name(context, cc);
- if ( ! stat(cc_name, &st_temp)){
- if ((retval = krb5_get_nonexp_tkts(context, cc, &creds_list))){
- return retval;
- }
+ if ( ! stat(cc_name, &st_temp)){
+ if ((retval = krb5_get_nonexp_tkts(context, cc, &creds_list))){
+ return retval;
}
-
- *found = krb5_find_princ_in_cred_list(context, creds_list, princ);
- return 0;
}
+
+ *found = krb5_find_princ_in_cred_list(context, creds_list, princ);
+ return 0;
+}
Modified: branches/iakerb/src/configure.in
===================================================================
--- branches/iakerb/src/configure.in 2010-04-08 16:39:31 UTC (rev 23874)
+++ branches/iakerb/src/configure.in 2010-04-08 16:41:17 UTC (rev 23875)
@@ -169,7 +169,7 @@
AC_PROG_LEX
AC_C_CONST
AC_HEADER_DIRENT
-AC_CHECK_FUNCS(strdup setvbuf inet_ntoa inet_aton seteuid setresuid setreuid setegid setresgid setregid setsid flock fchmod chmod strftime strptime geteuid setenv unsetenv getenv gmtime_r localtime_r bswap16 bswap64 mkstemp getusershell lstat access getcwd srand48 srand srandom stat strchr strerror strerror_r)
+AC_CHECK_FUNCS(strdup setvbuf inet_ntoa inet_aton seteuid setresuid setreuid setegid setresgid setregid setsid flock fchmod chmod strftime strptime geteuid setenv unsetenv getenv gmtime_r localtime_r bswap16 bswap64 mkstemp getusershell access getcwd srand48 srand srandom stat strchr strerror strerror_r)
AC_CHECK_FUNC(mkstemp,
[MKSTEMP_ST_OBJ=
Modified: branches/iakerb/src/include/krb5/krb5.hin
===================================================================
--- branches/iakerb/src/include/krb5/krb5.hin 2010-04-08 16:39:31 UTC (rev 23874)
+++ branches/iakerb/src/include/krb5/krb5.hin 2010-04-08 16:41:17 UTC (rev 23875)
@@ -1851,6 +1851,13 @@
krb5_error_code KRB5_CALLCONV
krb5_cc_resolve(krb5_context, const char *, krb5_ccache *);
+/**
+ * Create a new handle referring to the same cache as @a in.
+ * The new handle and @a in can be closed independently.
+ */
+krb5_error_code KRB5_CALLCONV
+krb5_cc_dup(krb5_context context, krb5_ccache in, krb5_ccache *out);
+
const char *KRB5_CALLCONV
krb5_cc_default_name(krb5_context);
Modified: branches/iakerb/src/lib/krb5/ccache/ccbase.c
===================================================================
--- branches/iakerb/src/lib/krb5/ccache/ccbase.c 2010-04-08 16:39:31 UTC (rev 23874)
+++ branches/iakerb/src/lib/krb5/ccache/ccbase.c 2010-04-08 16:41:17 UTC (rev 23875)
@@ -238,6 +238,12 @@
return ops->resolve(context, cache, resid);
}
+krb5_error_code KRB5_CALLCONV
+krb5_cc_dup(krb5_context context, krb5_ccache in, krb5_ccache *out)
+{
+ return in->ops->resolve(context, out, in->ops->get_name(context, in));
+}
+
/*
* cc_getops
*
Modified: branches/iakerb/src/util/testrealm.py
===================================================================
--- branches/iakerb/src/util/testrealm.py 2010-04-08 16:39:31 UTC (rev 23874)
+++ branches/iakerb/src/util/testrealm.py 2010-04-08 16:41:17 UTC (rev 23875)
@@ -33,10 +33,12 @@
os.path.join('kadmin', 'cli'),
os.path.join('kadmin', 'dbutil'),
os.path.join('kadmin', 'ktutil'),
+ os.path.join('clients', 'kdestroy'),
os.path.join('clients', 'kinit'),
os.path.join('clients', 'klist'),
- os.path.join('clients', 'kdestroy'),
os.path.join('clients', 'kpasswd'),
+ os.path.join('clients', 'ksu'),
+ os.path.join('clients', 'kvno'),
'slave'
]
More information about the cvs-krb5
mailing list