From: Alexandra Ellwood Date: Wed, 8 Oct 2008 21:51:35 +0000 (+0000) Subject: KLL should use __attribute ((deprecated)) X-Git-Tag: krb5-1.7-alpha1~332 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c1ae613e4929fddc9b09dcf748c0e203692d0aa7;p=krb5.git KLL should use __attribute ((deprecated)) 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 --- diff --git a/src/kim/lib/mac/KerberosLogin.c b/src/kim/lib/mac/KerberosLogin.c index 17a7a8072..e8d7b577e 100644 --- a/src/kim/lib/mac/KerberosLogin.c +++ b/src/kim/lib/mac/KerberosLogin.c @@ -26,8 +26,6 @@ #ifdef KIM_TO_KLL_SHIM -#define KERBEROSLOGIN_DEPRECATED - #include "CredentialsCache.h" #include "KerberosLogin.h" #include "KerberosLoginPrivate.h" @@ -36,6 +34,19 @@ #include "k5-thread.h" #include +/* + * 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); } /* ------------------------------------------------------------------------ */ diff --git a/src/kim/lib/mac/KerberosLogin.h b/src/kim/lib/mac/KerberosLogin.h index b9c8262fb..8dc49e18d 100644 --- a/src/kim/lib/mac/KerberosLogin.h +++ b/src/kim/lib/mac/KerberosLogin.h @@ -34,6 +34,12 @@ # endif #endif +#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 30203 +# define KERBEROSLOGIN_DEPRECATED __attribute__((deprecated)) +#else +# define KERBEROSLOGIN_DEPRECATED +#endif + #include #include @@ -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,