From: Todd C. Miller Date: Thu, 30 Aug 2018 20:06:18 +0000 (-0600) Subject: Fix warnings on OpenIndiana (Illumos) X-Git-Tag: SUDO_1_8_25^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a924b4610b8ee9794ab79c2c6967528af9342a84;p=sudo Fix warnings on OpenIndiana (Illumos) --- diff --git a/lib/util/regress/atofoo/atofoo_test.c b/lib/util/regress/atofoo/atofoo_test.c index 050270566..1ad78ebd6 100644 --- a/lib/util/regress/atofoo/atofoo_test.c +++ b/lib/util/regress/atofoo/atofoo_test.c @@ -83,9 +83,9 @@ static struct strtoid_data { { "10", 10, NULL, NULL }, { "-2", -2, NULL, NULL }, #if SIZEOF_ID_T != SIZEOF_LONG_LONG - { "-2", 4294967294U, NULL, NULL }, + { "-2", (id_t)4294967294U, NULL, NULL }, #endif - { "4294967294", 4294967294U, NULL, NULL }, + { "4294967294", (id_t)4294967294U, NULL, NULL }, { NULL, 0, NULL, NULL } }; @@ -128,7 +128,7 @@ static struct strtomode_data { { "755", 0755 }, { "007", 007 }, { "7", 7 }, - { "8", -1 }, + { "8", (mode_t)-1 }, { NULL, 0 } }; diff --git a/lib/util/regress/parse_gids/parse_gids_test.c b/lib/util/regress/parse_gids/parse_gids_test.c index 655283a40..da1a87aae 100644 --- a/lib/util/regress/parse_gids/parse_gids_test.c +++ b/lib/util/regress/parse_gids/parse_gids_test.c @@ -51,7 +51,7 @@ struct parse_gids_test { static const GETGROUPS_T test1_out[] = { 0, 1, 2, 3, 4 }; static const GETGROUPS_T test2_out[] = { 1, 2, 3, 4 }; -static const GETGROUPS_T test3_out[] = { 0, 1, -2, 3, 4 }; +static const GETGROUPS_T test3_out[] = { 0, 1, (gid_t)-2, 3, 4 }; /* XXX - test syntax errors too */ static struct parse_gids_test test_data[] = { diff --git a/plugins/sudoers/ldap.c b/plugins/sudoers/ldap.c index 5942e5c84..60931a592 100644 --- a/plugins/sudoers/ldap.c +++ b/plugins/sudoers/ldap.c @@ -1231,7 +1231,8 @@ oom: } #ifdef HAVE_LDAP_SASL_INTERACTIVE_BIND_S -static unsigned int (*sudo_gss_krb5_ccache_name)(unsigned int *minor_status, const char *name, const char **old_name); +typedef unsigned int (*sudo_gss_krb5_ccache_name_t)(unsigned int *minor_status, const char *name, const char **old_name); +static sudo_gss_krb5_ccache_name_t sudo_gss_krb5_ccache_name; static int sudo_set_krb5_ccache_name(const char *name, const char **old_name) @@ -1242,7 +1243,7 @@ sudo_set_krb5_ccache_name(const char *name, const char **old_name) debug_decl(sudo_set_krb5_ccache_name, SUDOERS_DEBUG_LDAP) if (!initialized) { - sudo_gss_krb5_ccache_name = + sudo_gss_krb5_ccache_name = (sudo_gss_krb5_ccache_name_t) sudo_dso_findsym(SUDO_DSO_DEFAULT, "gss_krb5_ccache_name"); initialized = true; } diff --git a/plugins/sudoers/regress/parser/check_base64.c b/plugins/sudoers/regress/parser/check_base64.c index 0e82b43f2..a3f28e0af 100644 --- a/plugins/sudoers/regress/parser/check_base64.c +++ b/plugins/sudoers/regress/parser/check_base64.c @@ -42,14 +42,14 @@ extern size_t base64_encode(const unsigned char *in, size_t in_len, char *out, s __dso_public int main(int argc, char *argv[]); -static char bstring1[] = { 0xea, 0xb8, 0xa2, 0x71, 0xef, 0x67, 0xc1, 0xcd, 0x0d, 0xd9, 0xa6, 0xaa, 0xa8, 0x24, 0x77, 0x2a, 0xfc, 0x6f, 0x76, 0x37, 0x1b, 0xed, 0x9e, 0x1a, 0x90, 0x5f, 0xcf, 0xbc, 0x00 }; +static unsigned char bstring1[] = { 0xea, 0xb8, 0xa2, 0x71, 0xef, 0x67, 0xc1, 0xcd, 0x0d, 0xd9, 0xa6, 0xaa, 0xa8, 0x24, 0x77, 0x2a, 0xfc, 0x6f, 0x76, 0x37, 0x1b, 0xed, 0x9e, 0x1a, 0x90, 0x5f, 0xcf, 0xbc, 0x00 }; struct base64_test { const char *ascii; const char *encoded; } test_strings[] = { { - bstring1, + (char *)bstring1, "6riice9nwc0N2aaqqCR3Kvxvdjcb7Z4akF/PvA==" }, {