Commit Graph

157 Commits

Author SHA1 Message Date
Minsoo Choo
aff90c322e Fix spelling 2024-06-16 23:30:48 -04:00
Joseph Sutton
12ed86de90 wind: Fix incorrect coding lines
Commit e172367898 converted all these
files to UTF-8, but didn’t change the coding lines.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-11-28 21:37:56 -05:00
Joseph Sutton
ff079377f2 wind: Do not use invalid escape sequences
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-11-28 21:37:56 -05:00
Joseph Sutton
1f88e8c919 wind: Fix code spelling
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-11-28 21:34:35 -05:00
Joseph Sutton
a3878d3e9d wind: Deny invalid UTF-8 encodings
Codepoints above U+10FFFF and overlong encodings are considered invalid.
Unpaired surrogates are not, as these are known to be generated on
occasion — by Windows, for example.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-11-08 14:58:21 -06:00
Joseph Sutton
bf25b38c0a wind: Support UTF-8–encoding non-BMP codepoints
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-11-08 14:58:21 -06:00
Joseph Sutton
ba63461cd4 wind: Support UTF-16–encoding non-BMP codepoints
View with ‘git show -b’.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-11-08 14:58:21 -06:00
Joseph Sutton
821fac3648 wind: Use portable integer types
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-11-08 14:58:21 -06:00
Joseph Sutton
db70a76074 wind: Do not perform arithmetic on a NULL pointer
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-11-08 14:58:21 -06:00
Joseph Sutton
ed798da1f2 wind: Fix documentation comment
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-11-08 14:58:21 -06:00
Joseph Sutton
487ba95669 wind: Don’t use invalid escape sequences
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-11-02 20:19:54 -05:00
Nicolas Williams
04933966e6 wind: Fix build (snprintf overflow warning in test) 2023-05-26 13:07:45 -05:00
Nicolas Williams
933f805079 wind: Quiet warnings in idn-lookup utility 2023-01-04 16:06:06 -06:00
Nicolas Williams
a331a7a04f wind: Check for integer overflow in idn-lookup utility 2023-01-04 00:43:35 -06:00
Daria Phoebe Brashear
133f517482 rewrite fallthrough to HEIM_FALLTHROUGH to deal with new Apple SDKs
Apple clang version 14.0.0 (clang-1400.0.17.3.1) fails the build
because stds.h defines `fallthrough` as a macro which is then
expanded when base.h evaluates

  # if __has_attribute(fallthrough) && __clang_major__ >= 5

The macOS SDK defines `DISPATCH_FALLTHROUGH` as the macro instead
of `fallthrough`.

This change replaces the use of `fallthrough` in the tree with
`HEIM_FALLTHROUGH` and updates the declaration in configure logic
to define `HEIM_FALLTHROUGH` based upon existing definitions
(if any) of `fallthrough` or `DISPATCH_FALLTHROUGH`.
2022-09-16 15:58:45 -04:00
Jeffrey Altman
04527412e3 Follow the Linux kernel's lead on "fallthrough"
The pseudo keyword 'fallthrough' is defined such that case statement
blocks must end with any of these keywords:
 * break;
 * fallthrough;
 * continue;
 * goto <label>;
 * return [expression];
 *
 *  gcc: https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html#Statement-Attributes

The macro is defined either as

  __attribute__((__fallthrough__))

or as

  do {} while (0)  /* fallthrough */

not including the semicolon.

This change implements the Linux kernel style and updates several locations
where "/*fallthrough*/ and /* FALLTHROUGH */ were not previously replaced.

Externally imported code such as libedit, libtommath and sqlite are
restored to their unaltered state.

Change-Id: I69db8167b0d5884f55d96d72de3059a0235a1ba3
2022-01-21 10:39:47 -05:00
Nicolas Williams
c607135a03 Use fallthrough statement attribute (moar) 2022-01-14 16:53:34 -06:00
Nicolas Williams
ddc6113610 Use fallthrough statement attribute 2022-01-14 16:32:58 -06:00
Nicolas Williams
6f467b8097 wind: Fix some warnings 2022-01-14 14:47:13 -06:00
Jeffrey Altman
357a38fc7f lib/wind: find_normalize read past end of array
find_normalize() can under some circumstances read one element
beyond the input array.  The contents are discarded immediately
without further use.

This change prevents the unintended read.

Change-Id: Ia2759a5632d64f7fa6553f879b5bbbf43ba3513e
2021-11-17 20:03:03 -05:00
Quanah Gibson-Mount
6415a2032e Fix #696 - Find python as part of the configure process instead of hard coding it.
Change-Id: I66d91f16d156d1a940f41ab16a049fb38f0e8bc4
2021-11-16 22:41:39 -05:00
Nicolas Williams
fdc13c4aac Fix switch fallthrough warnings/errors 2020-09-07 22:04:59 -05:00
Jeffrey Altman
4d57ee72f3 lib/wind: get-punycode-examples.py whitespace fix
Change-Id: I89e82539578fd9436ee735c124401fa019369eee
2019-01-02 10:23:39 -06:00
Jeffrey Altman
63914b95b8 lib/wind: PY3 gen-punycode-examples.py
Update gen-punycode-examples.py for python 3.

gen-punycode-examples.py parses the Sample strings from section 7.1
of rfc3492.txt and generates the punycode_examples.[ch] sources containing
the punycode_examples[].

Python 3 requires that print output be surrounded by parentheses
and the split and join operations have been moved from the "string"
class to built-ins.

This change adds the missing parentheses and switches to the built-in
split and join str operations.

The "string" class is no longer required as an import.

Change-Id: Ic5f341080d2ff2feef692c89e0b28dcbf4e48cb4
2018-12-26 11:51:41 -06:00
Noel Power
59aee7cad2 PY3: fix "TabError: inconsistent use of tabs and spaces"
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

(cherry-picked from Samba commit e8fec94827c933041acd5b447eeeefd0b7b507ef)
2018-12-19 19:44:05 -06:00
Noel Power
5542a0ba16 PY3: make sure print stmt is enclosed by '(' & ')'
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from Samba merge request https://gitlab.com/samba-team/samba/merge_requests/68)
2018-12-14 16:39:55 -06:00
Noel Power
fa3c0031a8 Bulk: enclose .keys() method with list where list (from python2) expected
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from Samba commit 521bc6056edc5252f2256664f4eacba13a3749e3)
2018-12-14 16:39:55 -06:00
Noel Power
06143cc12b PY3: xrange->range
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from Samba commit e2c0af6bcdf271ff75c455695c129bc18322bd5a)
2018-12-14 16:39:55 -06:00
Noel Power
926b3aae82 PY3: string.upper not in PY3
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from Samba commit 899ef5d186c2c44f63c1cbf415daa33e9f668a5b)
2018-12-14 16:39:55 -06:00
Noel Power
76b2f15729 PY3: string.translate string.upper don't exist in PY3
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from Samba commit a0c8c8c8331856d9f09d18b389b7dd01c8d33de2)
2018-12-14 16:39:55 -06:00
Noel Power
96b410ed46 PY3: bytes.maketrans, string.maketrans is a PY2 only function
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from Samba commit b342e6f038b5277cf30115f11cf0f30d238c12ea)
2018-12-14 16:39:55 -06:00
Noel Power
07e3cbb7fb PY3: dict_keys doesn't have a sort method
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from Samba commit 0358d57db4705b2330e294b5d6318c1a78a8518c)
2018-12-14 16:39:55 -06:00
Noel Power
fc9aab949f PY3: dict doesn't have has_key
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from Samba commit 82c84513331da9d0f42ba73d03e58dce5d0f76d3)
2018-12-14 16:39:55 -06:00
Noel Power
f26b1cd599 PY3: iterkeys -> keys
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from Samba commit b2b0f8191dde58fe234b0147c4a0bd39020aa504)
2018-12-14 16:39:55 -06:00
Noel Power
965bb515ed PY3: iterkeys -> keys
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from Samba commit d20e85d008e1b7badbea5ada8b22639f7767a097)
2018-12-14 16:39:55 -06:00
Noel Power
f7c2860a36 PY3: dict has no iterkeys method
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from Samba commit c6884138e4c1aec80e8f99ef0978b43919ae9d3a)
2018-12-14 16:39:55 -06:00
Jeffrey Altman
902aa4ee02 tests on Windows
Modify the NTMakefile rules for tests so that a failed test does
not prevent subsequent tests from being executed.

Change-Id: I9595ad4a1527feae7c402241bf06ab21a0b76d4a
2015-03-21 15:44:48 -04:00
Stefan Metzmacher
1ae5df045e heimdal:lib/wind: include <stdlib.h> at the end
This makes sure config.h gets includes first.

This should fix the build on AIX.

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sun Jun 17 16:16:24 CEST 2012 on sn-devel-104
2014-03-24 23:07:50 -05:00
Stefan Metzmacher
2596cfe324 heimdal:lib/wind: make sure errorlist_table.c includes config.h as first header
This should fix the build on AIX.

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sat Jun 16 23:59:07 CEST 2012 on sn-devel-104
2014-03-24 23:07:50 -05:00
Jeffrey Altman
aed7a3b948 Windows: missing exports on Windows
synchronize the export lists on Windows and UNIX.
When new functions are exported on UNIX or Windows,
the "test" build target on Windows will verify if
the export lists are in sync.

Change-Id: I9df3607983b03ee8dc6fa7cd22f85b07a6cee784
2012-06-12 18:48:37 -04:00
Roland C. Dowdeswell
cc47c8fa7b Turn on -Wextra -Wno-sign-compare -Wno-unused-paramter and fix issues.
We turn on a few extra warnings and fix the fallout that occurs
when building with --enable-developer.  Note that we get different
warnings on different machines and so this will be a work in
progress.  So far, we have built on NetBSD/amd64 5.99.64 (which
uses gcc 4.5.3) and Ubuntu 10.04.3 LTS (which uses gcc 4.4.3).

Notably, we fixed

	1.  a lot of missing structure initialisers,

	2.  unchecked return values for functions that glibc
	    marks as __attribute__((warn-unused-result)),

	3.  made minor modifications to slc and asn1_compile
	    which can generate code which generates warnings,
	    and

	4.  a few stragglers here and there.

We turned off the extended warnings for many programs in appl/ as
they are nearing the end of their useful lifetime, e.g.  rsh, rcp,
popper, ftp and telnet.

Interestingly, glibc's strncmp() macro needed to be worked around
whereas the function calls did not.

We have not yet tried this on 32 bit platforms, so there will be
a few more warnings when we do.
2012-02-20 19:45:41 +00:00
Stefan Metzmacher
55d66f2aff lib/wind: export wind_ucs2write()
Pair-Programmed-With: Arvid Requate <requate@univention.de>

metze

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2011-11-16 19:42:45 -08:00
Stefan Metzmacher
805304d3f8 lib/winbd: fix wind_ucs2write with WIND_RW_LE
Pair-Programmed-With: Arvid Requate <requate@univention.de>

metze

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2011-11-16 19:42:44 -08:00
Stefan Metzmacher
dcd34e5967 lib/wind: fix wind_ucs4utf8() and wind_ucs2utf8()
Pair-Programmed-With: Arvid Requate <requate@univention.de>

metze

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2011-11-16 19:42:44 -08:00
Linus Nordberg
2e35198908 Add version-script.map to _DEPENDENCIES.
Added to 11 out of 14 directories with map files.  Not lib/ntlm,
lib/hcrypto and kdc which have the map file as an explicit dependency
to _OBBJECTS.

Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2011-07-24 14:07:59 -07:00
Love Hörnquist Åstrand
12403a31ce sprinkle more windows files 2011-07-23 11:18:21 -07:00
Love Hörnquist Åstrand
7aaba443bc add NTMakefile and windows directories 2011-07-17 12:16:59 -07:00
Love Hornquist Astrand
0879b9831a remove trailing whitespace 2011-05-21 11:57:31 -07:00
Love Hornquist Astrand
f5f9014c90 Warning fixes from Christos Zoulas
- shadowed variables
- signed/unsigned confusion
- const lossage
- incomplete structure initializations
- unused code
2011-04-29 20:25:05 -07:00
Asanka C. Herath
6d662f71d7 Windows: Fix export lists 2010-11-29 10:53:49 -05:00