X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/3857519629ca8fbcf3466c3fc761a5bb6ed32d53..HEAD:/src/src/auths/plaintext.c diff --git a/src/src/auths/plaintext.c b/src/src/auths/plaintext.c index 1392b369f..13d05d1e5 100644 --- a/src/src/auths/plaintext.c +++ b/src/src/auths/plaintext.c @@ -2,12 +2,14 @@ * Exim - an Internet mail transport agent * *************************************************/ +/* Copyright (c) The Exim Maintainers 2020 - 2024 */ /* Copyright (c) University of Cambridge 1995 - 2018 */ -/* Copyright (c) The Exim Maintainers 2020 - 2021 */ /* See the file NOTICE for conditions of use and distribution. */ /* SPDX-License-Identifier: GPL-2.0-or-later */ #include "../exim.h" + +#ifdef AUTH_PLAINTEXT /* Remainder of file */ #include "plaintext.h" @@ -40,7 +42,7 @@ auth_plaintext_options_block auth_plaintext_option_defaults = { #ifdef MACRO_PREDEF /* Dummy values */ -void auth_plaintext_init(auth_instance *ablock) {} +void auth_plaintext_init(driver_instance *ablock) {} int auth_plaintext_server(auth_instance *ablock, uschar *data) {return 0;} int auth_plaintext_client(auth_instance *ablock, void * sx, int timeout, uschar *buffer, int buffsize) {return 0;} @@ -58,13 +60,17 @@ enable consistency checks to be done, or anything else that needs to be set up. */ void -auth_plaintext_init(auth_instance *ablock) +auth_plaintext_init(driver_instance * a) { -auth_plaintext_options_block *ob = - (auth_plaintext_options_block *)(ablock->options_block); -if (!ablock->public_name) ablock->public_name = ablock->name; -if (ablock->server_condition) ablock->server = TRUE; -if (ob->client_send) ablock->client = TRUE; +auth_instance * ablock = (auth_instance *)a; +auth_plaintext_options_block * ob = a->options_block; + +if (!ablock->public_name) + ablock->public_name = ablock->drinst.name; +if (ablock->server_condition) + ablock->server = TRUE; +if (ob->client_send) + ablock->client = TRUE; } @@ -78,8 +84,7 @@ if (ob->client_send) ablock->client = TRUE; int auth_plaintext_server(auth_instance * ablock, uschar * data) { -auth_plaintext_options_block * ob = - (auth_plaintext_options_block *)(ablock->options_block); +auth_plaintext_options_block * ob = ablock->drinst.options_block; const uschar * prompts = ob->server_prompts; uschar * s; int number = 1; @@ -141,8 +146,7 @@ auth_plaintext_client( uschar *buffer, /* buffer for reading response */ int buffsize) /* size of buffer */ { -auth_plaintext_options_block *ob = - (auth_plaintext_options_block *)(ablock->options_block); +auth_plaintext_options_block * ob = ablock->drinst.options_block; const uschar * text = ob->client_send; const uschar * s; int sep = 0; @@ -176,5 +180,29 @@ while ((s = string_nextinlist(&text, &sep, NULL, 0))) return FAIL; } -#endif /*!MACRO_PREDEF*/ + +# ifdef DYNLOOKUP +# define plaintext_auth_info _auth_info +# endif + +auth_info plaintext_auth_info = { +.drinfo = { + .driver_name = US"plaintext", /* lookup name */ + .options = auth_plaintext_options, + .options_count = &auth_plaintext_options_count, + .options_block = &auth_plaintext_option_defaults, + .options_len = sizeof(auth_plaintext_options_block), + .init = auth_plaintext_init, +# ifdef DYNLOOKUP + .dyn_magic = AUTH_MAGIC, +# endif + }, +.servercode = auth_plaintext_server, +.clientcode = auth_plaintext_client, +.version_report = NULL, +.macros_create = NULL, +}; + +#endif /*!MACRO_PREDEF*/ +#endif /*AUTH_PLAINTEST*/ /* End of plaintext.c */