diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/krb5/krb/brand.c | 2 | ||||
-rw-r--r-- | src/lib/krb5/krb/init_ctx.c | 17 |
2 files changed, 14 insertions, 5 deletions
diff --git a/src/lib/krb5/krb/brand.c b/src/lib/krb5/krb/brand.c index fc098ddb5..c7b8a61dc 100644 --- a/src/lib/krb5/krb/brand.c +++ b/src/lib/krb5/krb/brand.c @@ -70,4 +70,4 @@ #define BRANDSTR RELTAG " " RELNAME " " RELDATE -static char krb5_brand[] = "KRB5_BRAND: " BRANDSTR; +char krb5_brand[] = "KRB5_BRAND: " BRANDSTR; diff --git a/src/lib/krb5/krb/init_ctx.c b/src/lib/krb5/krb/init_ctx.c index 30ae2efc0..91ed6e1c7 100644 --- a/src/lib/krb5/krb/init_ctx.c +++ b/src/lib/krb5/krb/init_ctx.c @@ -91,10 +91,19 @@ krb5_init_context(krb5_context *context) krb5_error_code KRB5_CALLCONV krb5_init_secure_context(krb5_context *context) { - - /* This is to make gcc -Wall happy */ - if(0) krb5_brand[0] = krb5_brand[0]; - return init_common (context, TRUE, FALSE); + /* + * This is rather silly, but should improve our chances of + * retaining the krb5_brand array in the final linked library, + * better than a static variable that's unreferenced after + * optimization, or even a non-static symbol that's not exported + * from the library nor referenced from anywhere else in the + * library. + * + * If someday we grow an API to actually return the string, we can + * get rid of this silliness. + */ + int my_false = (krb5_brand[0] == 0); + return init_common (context, TRUE, my_false); } krb5_error_code |