svn rev #23870: trunk/src/ clients/ksu/

ghudson@MIT.EDU ghudson at MIT.EDU
Wed Apr 7 23:15:44 EDT 2010


http://src.mit.edu/fisheye/changelog/krb5/?cs=23870
Commit By: ghudson
Log Message:
Assume lstat in Unix code, specifically clients/ksu/ccache.c.  Fix bad
indentation caused by an #ifdef HAVE_LSTAT block.



Changed Files:
U   trunk/src/clients/ksu/ccache.c
U   trunk/src/configure.in
Modified: trunk/src/clients/ksu/ccache.c
===================================================================
--- trunk/src/clients/ksu/ccache.c	2010-04-07 03:39:25 UTC (rev 23869)
+++ trunk/src/clients/ksu/ccache.c	2010-04-08 03:15:44 UTC (rev 23870)
@@ -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: trunk/src/configure.in
===================================================================
--- trunk/src/configure.in	2010-04-07 03:39:25 UTC (rev 23869)
+++ trunk/src/configure.in	2010-04-08 03:15:44 UTC (rev 23870)
@@ -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=




More information about the cvs-krb5 mailing list