[16186] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

[krbdev.mit.edu #8684] git commit

daemon@ATHENA.MIT.EDU (Greg Hudson via RT)
Tue Oct 30 12:27:44 2018

Mail-followup-to: rt@krbdev.mit.edu
mail-copies-to: never
From: "Greg Hudson via RT" <rt-comment@KRBDEV-PROD-APP-1.mit.edu>
In-Reply-To: <rt-8684@krbdev.mit.edu>
Message-ID: <rt-8684-49102.14.2034996681129@krbdev.mit.edu>
To: "'AdminCc of krbdev.mit.edu Ticket #8684'":;
Date: Tue, 30 Oct 2018 12:27:34 -0400 (EDT)
Reply-To: rt-comment@KRBDEV-PROD-APP-1.mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: krb5-bugs-bounces@mit.edu


Fix option parsing on Windows

Commit 8f9ade8ec50cde1176411085294f85ecfb2820a4 (ticket 8391) moved
the built-in getopt() and getopt_long() implementations from a static
library in util/windows to util/support, where (on Windows) it is
built into k5sprt32.dll or k5sprt64.dll.  The getopt() interface uses
global variables opterr, optind, optopt, and optarg, each renamed via
macro to have a k5_ prefix when we use the built-in implementation.
Data objects exported from DLLs need special handling in Windows; they
must be marked as DATA in the DLL .def file, and they must be declared
with "__declspec(dllimport)" in calling code.  Without this handling,
optind begins with a garbage value and getopt_long() returns -1
immediately, so client programs always behave as if they have no
arguments.

Stop unnecessarily declaring optind and optarg in client programs.
Declare the getopt() global variables with __declspec(dllimport) on
Windows, except when compiling getopt.c itself.  When creating
libkrb5support.exports on Windows (this file is later used by
lib/Makefile.in to create k5sprt32.def), add a DATA tag to the data
objects.

(cherry picked from commit 63246cf3513a0e8bdfc734db985af14c8c5170c5)

https://github.com/krb5/krb5/commit/8b8cad8b9ff92e2a2d344fc7c4d77277c9c09829
Author: Greg Hudson <ghudson@mit.edu>
Commit: 8b8cad8b9ff92e2a2d344fc7c4d77277c9c09829
Branch: krb5-1.15
 src/clients/kdestroy/kdestroy.c |    3 ---
 src/clients/klist/klist.c       |    2 --
 src/clients/kswitch/kswitch.c   |    3 ---
 src/clients/kvno/kvno.c         |    3 ---
 src/include/k5-platform.h       |   14 ++++++++++----
 src/util/support/Makefile.in    |    4 +++-
 src/util/support/getopt.c       |    2 ++
 7 files changed, 15 insertions(+), 16 deletions(-)

_______________________________________________
krb5-bugs mailing list
krb5-bugs@mit.edu
https://mailman.mit.edu/mailman/listinfo/krb5-bugs

home help back first fref pref prev next nref lref last post