KLL should use __attribute ((deprecated))
authorAlexandra Ellwood <lxs@mit.edu>
Wed, 8 Oct 2008 21:51:35 +0000 (21:51 +0000)
committerAlexandra Ellwood <lxs@mit.edu>
Wed, 8 Oct 2008 21:51:35 +0000 (21:51 +0000)
Switched from a macro to GCC deprecated attributes.

Also removed the deprecated struct used by KLSetApplicationOptions
and KLGetApplicationOptions because they weren't touching it.
Replaced pointer-to-struct arguments with void *.

KLGetApplicationOptions now also returns an error since it did
not modify its input.  Not sure why it wasn't before since no one
should be calling it on Mac OS X.

ticket: new

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

src/kim/lib/mac/KerberosLogin.c
src/kim/lib/mac/KerberosLogin.h

index 17a7a8072a768ca3b012b75d46f30a230c760fbe..e8d7b577e4979c032f61d6aaeea8020b7409caa6 100644 (file)
@@ -26,8 +26,6 @@
 
 #ifdef KIM_TO_KLL_SHIM
 
-#define KERBEROSLOGIN_DEPRECATED
-
 #include "CredentialsCache.h"
 #include "KerberosLogin.h"
 #include "KerberosLoginPrivate.h"
 #include "k5-thread.h"
 #include <time.h>
 
+/* 
+ * Deprecated Error codes 
+ */
+enum {
+    /* Carbon Dialog errors */
+    klDialogDoesNotExistErr             = 19676,
+    klDialogAlreadyExistsErr,
+    klNotInForegroundErr,
+    klNoAppearanceErr,
+    klFatalDialogErr,
+    klCarbonUnavailableErr    
+};
+
 krb5_get_init_creds_opt *__KLLoginOptionsGetKerberos5Options (KLLoginOptions ioOptions);
 KLTime __KLLoginOptionsGetStartTime (KLLoginOptions ioOptions);
 char *__KLLoginOptionsGetServiceName (KLLoginOptions ioOptions);
@@ -161,7 +172,7 @@ KLStatus KLAcquireNewTicketsWithPassword (KLPrincipal      inPrincipal,
 
 /* ------------------------------------------------------------------------ */
 
-KLStatus KLSetApplicationOptions (const KLApplicationOptions *inAppOptions)
+KLStatus KLSetApplicationOptions (const void *inAppOptions)
 {
     /* Deprecated */
     return kl_check_error (klNoErr);
@@ -169,10 +180,14 @@ KLStatus KLSetApplicationOptions (const KLApplicationOptions *inAppOptions)
 
 /* ------------------------------------------------------------------------ */
 
-KLStatus KLGetApplicationOptions (KLApplicationOptions *outAppOptions)
+KLStatus KLGetApplicationOptions (void *outAppOptions)
 {
-    /* Deprecated */
-    return kl_check_error (klNoErr);
+    /* Deprecated -- this function took a struct declared on the caller's
+     * stack.  It used to fill in the struct with information about the
+     * Mac OS 9 dialog used for automatic prompting.  Since there is no
+     * way for us provide valid values, just leave the struct untouched
+     * and return a reasonable error. */
+    return kl_check_error (klDialogDoesNotExistErr);
 }
 
 /* ------------------------------------------------------------------------ */
index b9c8262fb8fd3aa55b8dee037413258e4b08f359..8dc49e18d529fae7877b1fda6db4b83873340ad6 100644 (file)
 #    endif
 #endif
 
+#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 30203
+# define KERBEROSLOGIN_DEPRECATED __attribute__((deprecated))
+#else
+# define KERBEROSLOGIN_DEPRECATED
+#endif
+
 #include <sys/types.h>
 #include <krb5.h>
 
@@ -152,16 +158,6 @@ enum {
     klInsecurePasswordErr,
     klPasswordChangeFailedErr,
     
-#ifdef KERBEROSLOGIN_DEPRECATED
-    /* Dialog errors -- deprecated */
-    klDialogDoesNotExistErr             = 19676,
-    klDialogAlreadyExistsErr,
-    klNotInForegroundErr,
-    klNoAppearanceErr,
-    klFatalDialogErr,
-    klCarbonUnavailableErr,
-#endif
-    
     /* Login IPC errors */
     klCantContactServerErr              = 19776,
     klCantDisplayUIErr,
@@ -191,18 +187,6 @@ typedef    int16_t   KLSInt16;               /* used for Darwin-compat for KLApplic
 typedef void (*KLIdleCallback) (KLRefCon appData);
 #define CallKLIdleCallback(userRoutine, appData) ((userRoutine) (appData))
 
-#ifdef KERBEROSLOGIN_DEPRECATED
-
-/* Application options */
-typedef struct {
-    void *   deprecatedEventFilter;
-    KLRefCon deprecatedEventFilterAppData;
-    KLSInt16 deprecatedRealmsPopupMenuID;
-    KLSInt16 deprecatedLoginModeMenuID;
-} KLApplicationOptions;
-
-#endif
-
 /* Principal information */
 typedef kim_identity KLPrincipal;
 
@@ -216,31 +200,35 @@ typedef kim_options KLLoginOptions;
  */
 
 /* Deprecated functions -- provided for compatibility with KfM 4.0 */
-#ifdef KERBEROSLOGIN_DEPRECATED
 
 KLStatus KLAcquireTickets (KLPrincipal   inPrincipal,
                            KLPrincipal  *outPrincipal,
-                           char        **outCredCacheName);
+                           char        **outCredCacheName) 
+    KERBEROSLOGIN_DEPRECATED;
 
 KLStatus KLAcquireNewTickets (KLPrincipal  inPrincipal,
                               KLPrincipal  *outPrincipal,
-                              char        **outCredCacheName);
+                              char        **outCredCacheName) 
+    KERBEROSLOGIN_DEPRECATED;
 
 KLStatus KLAcquireTicketsWithPassword (KLPrincipal      inPrincipal,
                                        KLLoginOptions   inLoginOptions,
                                        const char      *inPassword,
-                                       char           **outCredCacheName);
+                                       char           **outCredCacheName) 
+    KERBEROSLOGIN_DEPRECATED;
 
 KLStatus KLAcquireNewTicketsWithPassword (KLPrincipal      inPrincipal,
                                           KLLoginOptions   inLoginOptions,
                                           const char      *inPassword,
-                                          char           **outCredCacheName);
+                                          char           **outCredCacheName) 
+    KERBEROSLOGIN_DEPRECATED;
 
-KLStatus KLSetApplicationOptions (const KLApplicationOptions *inAppOptions);
+KLStatus KLSetApplicationOptions (const void *inAppOptions) 
+    KERBEROSLOGIN_DEPRECATED;
 
-KLStatus KLGetApplicationOptions (KLApplicationOptions *outAppOptions);
+KLStatus KLGetApplicationOptions (void *outAppOptions) 
+    KERBEROSLOGIN_DEPRECATED;
 
-#endif
 
 /* Kerberos Login high-level API */
 KLStatus KLAcquireInitialTickets (KLPrincipal      inPrincipal,