src


Log

Author Commit Date CI Message
Guillem Jover 00b538ff 2022-11-23T23:28:34 build: Terminate lists in variables with «# EOL» This means we can add a trailing «\» to every element, so that they can be removed without requiring modification of other lines, and can be easily sorted. Replace the old usage of $(nil) which could possibly end up with junk added if such variable is ever defined, in the environment.
Guillem Jover 28298ac0 2022-10-05T01:35:08 doc: Switch references from pkg-config to pkgconf The former used to be the reference implementation, but it has been stagnant to the point of not showing much signs of life. Switch to the currently active and more complete implementation for references.
Guillem Jover be327c6e 2022-08-24T01:58:58 fgetwln: Add comment about lack of getwline(3) for recommendation Ideally we'd recommend getwline(3), but unfortunately even though it was part of the ISO/IEC TR 24731-2:2010 draft, it did not make it into C11 and is not widely implemented.
Guillem Jover a14612d9 2022-08-23T23:49:34 setmode: Dot not use saveset after free While we are only doing a pointer difference and not dereferencing it, it's easier and more correct to do the pointer difference before passing it to reallocarray(). Warned-by: gcc
Guillem Jover 1f6a48b2 2022-08-03T02:03:05 Sync arc4random(3) implementation from OpenBSD Closes: #12
Fabrice Fontaine 873639eb 2022-06-07T19:27:13 Fix ELF support for big endian SH Fix the following build failure with big endian SH (e.g. sh4aeb): ,--- In file included from nlist.c:44: nlist.c: In function '__elf_is_okay__': local-elf.h:223:25: error: 'ELFDATA2LMSB' undeclared (first use in this function); did you mean 'ELFDATA2LSB'? 223 | #define ELF_TARG_DATA ELFDATA2LMSB | ^~~~~~~~~~~~ `--- Fixes: http://autobuild.buildroot.org/results/2980fb79c208454195d77383f1ece9afbd7f981b Closes: !19 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover 5f213075 2022-03-31T20:46:56 getentropy: Fix function cast for getauxval() Fix also the Hurd implementation, missed in the original fix. Extends: commit 72a82ee262795c9162e712885381a111fcf988bc Warned-by: gcc
WANG Xuerui 15200ec7 2021-09-11T12:54:28 Add LoongArch support to nlist() Closes: !13 Signed-off-by: WANG Xuerui <git@xen0n.name> Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guilherme Janczak e5ed5fdd 2021-12-31T08:25:08 Remove arc4random() OpenBSD support The arc4random() support for OpenBSD does not build. The intention was to include any portability code so that the library could be easily ported to such systems, but it makes little sense to build it on OpenBSD where most of the functionality will be already present, or the software would have been ported anyway. [guillem@hadrons.org: Reword commit message to add rationale. ] Closes: !15 Signed-off-by: Guillem Jover <guillem@hadrons.org>
Duncan Overbruck ba3c46b3 2022-01-25T20:32:30 fpurge: Make it work with non fd based FILEs Streams opened with for example open_memstream(3) will have no associated file descriptor, and fileno(3) will fail. Signed-off-by: Guillem Jover <guillem@hadrons.org>
Sam James f11ab672 2022-01-23T15:36:55 build: Respect $(OBJDUMP) We already search for it in `./configure` so let's respect the result of that search. This helps with cross-compilation and any other cases where one might want to choose a different toolchain. Closes: !16 Bug: https://bugs.gentoo.org/831863 Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover 48107fc8 2021-11-28T23:19:16 build: Clarify link-time warnings Mention the involved function instead of stating an implicit "this function". Mention libbsd when proposing using an alternative libmd to make the context clear.
Guillem Jover e7cf8c57 2021-11-28T22:44:08 Switch md5 compatibility logic back to direct linking When using the recent dlsym() based wrapper, we are not requiring any symbol from libmd, as we resolve those dynamically at run-time. We were ending up linking against libmd because in another part of the code we require (depending on the architecture) the SHA512 functions for the getentropy() local implementation. But that function might be provided by the system libc on some systems, which means we end up not linking against libmd at all. To solve this we go back to the previous simpler solution of linking directly, which had the main drawback of then making programs fail to link when not specifying -lmd (on platforms that need it). And then switch the .so link point from a symlink to a linker script, so that we can inject the -lmd library as-needed. This is similar to what glibc is doing. Fixes: commit 31f034e3862debda8615a449b1c11c4d6920dcc7
Guillem Jover 25d35625 2021-11-28T22:40:58 build: Split libmd dependency due to MD5 functions from SHA requirements To be able to rework the md5 deprecation logic, we need to detangle when we depend on libmd due to requiring MD5 functions, which might be otherwise provided by libc, or when we require SHA functions for the internal getentropy() implementation.
Guillem Jover 500b3080 2021-11-28T22:34:59 build: Add new libbsd_symver_weak() macro We will use it for the reworked md5 deprecation logic.
Guillem Jover 8ad7570c 2021-11-27T21:07:00 getentropy: Add missing prototype for BSD variant Warned-by: gcc
Guillem Jover 43a82703 2021-11-27T20:26:05 nlist: Remove condition which is always true The nlist() function is limited to handle ELF binaries of the same class as size as the size_t of the architecture built. In addition the SIZE_T_MAX macro is BSD specific, and was falling back to the wrong constant on most 64-bit non-BSD systems. Warned-by: gcc
Guillem Jover 6a71b24b 2021-11-27T22:52:28 build: Append __ after __attribute and __typeof keywords Be consistent with other usages in the code base.
Victor Westerhuis 54f87456 2021-11-26T20:01:18 build: Enable .init_array support when building with LTO Because these symbols are not otherwise referenced, GCC would like to remove them. Signed-off-by: Guillem Jover <guillem@hadrons.org>
Alexander Miller c7a5d780 2021-09-30T03:39:57 build: Allow building with -flto on gcc-10 and newer Global asm statements (like .symver directives) do not work reliably in gcc with link time optimization. Use the symver attribute introduced with gcc-10 to set symbol versions instead, if available. [guillem@hadrons.org: - Simplify by using __has_attribute fallback from <sys/cdefs.h>. - Coding style changes. ] Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover 731b0a77 2021-08-17T02:59:59 build: Detect sed at configure time Check whether sed is available and use the implementation matching the requirements via the SED variable.
Guillem Jover 50b50a43 2021-03-02T05:18:04 vis: Add prototypes for strnvis() and strnunvis() variants Warned-by: gcc
Guillem Jover 04a8fb24 2021-03-02T00:48:02 Add missing prototypes to functions Warned-by: gcc
Guillem Jover 8f59221c 2021-02-19T06:51:18 nlist: Remove repeated shadowing variable declaration Warned-by: gcc
Guillem Jover 72a82ee2 2021-02-20T22:22:54 getentropy: Fix function cast for getauxval() Warned-by: gcc
Guillem Jover 25278891 2021-02-19T06:49:24 Mark local functions as static Warned-by: gcc
Guillem Jover e35d9141 2021-02-11T04:41:46 Add link-time warnings to MD5 wrapper functions Let's get the word out that these functions are deprecated and should be switched away from.
Guillem Jover 4feda870 2021-02-11T04:40:48 Require a semicolon for libbsd_link_warning() macro Remove the semicolon in the macro definition to force adding one on the call sites, to make the code look like an actual function.
Guillem Jover c0d86a64 2021-02-09T08:35:36 build: Add a Libs.private field to overlay pkg-config file We need to list all internal libraries there so that we can statically link. Fixes: commit 2374f409defb380d0c5c07f28b9c166ef8bdc742
Guillem Jover 31f034e3 2021-02-09T05:57:37 Switch libmd wrapper to use dlsym() Switch from the previous versioned symbol implementation which required users to also link against the message digest provider explicitly, or they would fail to find the symbols, to an implementation that loads the symbols from the linked library providing the functions using dlsym(), thus preserving backwards compatibility.
Guillem Jover 2374f409 2021-02-09T05:56:49 build: Add a Libs.private field to pkg-config file We need to list all internal libraries there so that we can statically link.
Guillem Jover a4e0db2b 2021-02-09T06:04:38 build: Use a single variable to track libraries to link against Using various variables means we have to keep these in sync in various places. Just use a single variable that we can use anywhere where this is needed.
Guillem Jover e832b768 2021-02-08T03:45:06 closefrom: Use close_range() on Linux when available Closes: !11 Based-on-patch-by: cptpcrd <cptpcrd.git@gmail.com> Signed-off-by: Guillem Jover <guillem@hadrons.org>
cptpcrd c4fca5bb 2021-02-07T14:22:21 closefrom: Handle lowfd < 0 properly More important if close_range() is going to be used, since casting negative values to 'unsigned int' might hide the errors. [guillem@hadrons.org: Minor coding style fix. ] Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover a1f79978 2021-02-08T02:52:50 closefrom: Import some changes from sudo Take most of the changes done in sudo, but preserve the existing local changes and refactoring. In addition, refactor pstat implementation into closefrom_pstat(), so that the code is easier to read, and requires no conditional declarations.
Guillem Jover d54ceb37 2021-02-07T00:09:45 Update copyright claims
Guillem Jover 847e682f 2021-02-07T00:09:30 Use libmd hashing function implementations instead of embedding our own This splits the implementation responsibilities, and reduces embedded code copies, which was one of the driving points with this project to start with, so it's nice to give a good example.
Aaron Dierking 68f980c9 2018-07-05T14:47:47 Provide a default progname on Windows [guillem@hadrons.org: - Remove .exe extension from default program name. - Call reallocarray() once by switching to a «do {} while» loop. - Minor coding style fixes. ] Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover 37a9b56c 2021-02-06T23:43:12 Import pwcache module from OpenBSD
Faidon Liambotis 01f0d1ea 2020-12-31T12:46:03 Add recallocarray() and freezero() from OpenBSD Add recallocarray(), introduced in OpenBSD 6.1, and freezero(), introduced in OpenBSD 6.2. The former is imported as-is from OpenBSD, while the latter is the non-malloc-internal branch of the same code (and also the OpenSSH portable variant). Both of these originated in OpenBSD, but have also been implemented by IllumOS, cf. https://www.illumos.org/issues/8546 Documentation for these functions is in malloc(3) upstream, the relevant parts of which were previously imported in reallocarray(3bsd). Update reallocarray(3bsd) with the changes that were introduced since, and add the relevant bits for recallocarray() and freezero(), plus aliases. [guillem@hadrons.org: Update copyright in COPYING. ] Closes: !10 Signed-off-by: Guillem Jover <guillem@hadrons.org>
Seth R Johnson 9c85d828 2019-11-14T07:26:41 Fix ELF detection on Intel compilers The Intel compiler does not define __amd64__ on x86_64 platforms; instead, like other compilers, it defines __x86_64__ . Closes: !8 Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover cfeafeab 2020-08-16T21:58:04 funopen: Fix memory leak in funopen_close() when closefn is NULL We need to free the cookiewrap even when the closefn method is NULL. Warned-by: gcc ASAN
Guillem Jover 3d6b6ead 2019-11-16T00:04:18 build: Detect support for --version-script in ld
Guillem Jover eb445425 2019-08-12T23:52:10 Do not define SIZE_T_MAX if already defined
Guillem Jover 3548c5f6 2019-08-26T05:39:17 Add missing strnvisx() to the symbols script Fixes: commit 2d7de186e9cb19a756c0630ee85cb3f2d29b3484.
Guillem Jover 5745ca03 2019-08-06T15:49:41 err: Add err(), warn(), errx() and warnx() familiy of functions Some systems such as Windows or musl-libc based ones do not have these BSD extensions. In addition libbsd itself is making use of the warnx() functions, so we better provide these interfaces in case they are missing.
Guillem Jover 9628798d 2019-08-06T15:37:43 err: Rewrite warnc() and errc() family functions to be standalone Do not depend on the system vwarn() and verr() functions to implement the *c() variants, as the system might actually lack any of the <err.h> BSD extensions.
Michael Shigorin 72c68868 2019-08-07T00:02:09 Add e2k support for nlist() This is a Russian 64-bit LE VLIW architecture named Elbrus (formerly Elbrus 2000). [guillem@hadrons.org: - Place the entry in alphabetical order. ] Signed-off-by: Guillem Jover <guillem@hadrons.org>
Frank Schaefer a4323f2b 2019-05-28T16:04:54 Add AArch64 ILP32 support to nlist() Closes: !7 Signed-off-by: Guillem Jover <guillem@hadrons.org>
Rosen Penev 4997efa5 2019-05-17T01:44:56 Add ARC support to nlist() Closes: !6 Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover 96202c6c 2019-08-07T00:00:15 Add a comment to note the ELF entries are sorted alphabetically This should help people wanting to add new entries.
Guillem Jover 9d917aad 2019-08-07T22:58:30 nlist: Fix out-of-bounds read on strtab When doing a string comparison for a symbol name from the string table, we should make sure we do a bounded comparison, otherwise a non-NUL terminated string might make the code read out-of-bounds. Warned-by: coverity
Aaron Dierking f99b8ea5 2018-06-14T11:38:33 build: Disable CRT warnings on Windows These warnings are not helpful for libbsd. [guillem@hadrons.org: - Rename WINDOWS conditional to OS_WINDOWS. - Add a nil terminator to the AM_CPPFLAGS. ] Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover 2e071c3c 2019-08-06T19:14:29 build: Support platforms without symbol versioning The .symver directive is ELF-specific. On non-ELF platforms, work around this with __attribute__((__alias__)) for the default symbol, and ignore the variant versioned symbols. Based-on-patch-by: Aaron Dierking <aarond@fb.com> Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover 890699a7 2019-08-06T18:51:45 build: Abstract symbol versioning via new libbsd_symver_* macros This makes it more obvious what they are doing. It will make it easier to make these directives more portable, as they are really ELF specific.
Guillem Jover 18662cad 2019-06-15T14:33:32 nlist: Fix unbounded malloc() calls There are a couple of malloc() calls with unbounded size arguments, coming from the parsed file. We need to make sure the size is not larger than the file being parsed, otherwise we might end up with out of memory conditions. Reported-by: Daniel Hodson <daniel@elttam.com.au> Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover ce53f7c2 2019-06-15T14:33:32 nlist: Fix pread() return value check We should check for partial reads, and not continue in those cases, as we are not retrying them, otherwise we might end up operating on uninitialized data. Reported-by: Daniel Hodson <daniel@elttam.com.au> Based-on-patch-by: Daniel Hodson <daniel@elttam.com.au> Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover 24d1f4dd 2019-06-15T14:33:32 nlist: Check whether sh_link is within bounds The sh_link members should be >= e_shnum, otherwise we might do out of bounds read accesses on the shdr array. Reported-by: Daniel Hodson <daniel@elttam.com.au> Based-on-patch-by: Daniel Hodson <daniel@elttam.com.au> Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover e9529d9b 2019-06-15T14:33:32 nlist: Check that e_shnum and e_shentsize are within bounds The e_shnum must not be 0, otherwise we will do a zero sized allocation and further processing of the executable will lead to out of bounds read/write accesses. The e_shentsize must be equal to sizeof(Elf_Shdr), otherwise we will perform out of bounds read accesses on the shdr array. Reported-by: Daniel Hodson <daniel@elttam.com.au> Based-on-patch-by: Daniel Hodson <daniel@elttam.com.au> Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover 3aaedb12 2019-06-15T14:33:32 nlist: Check whether the nl argument is not NULL This prevents programming errors. Reported-by: Daniel Hodson <daniel@elttam.com.au> Based-on-patch-by: Daniel Hodson <daniel@elttam.com.au> Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover b0ebb0d4 2019-08-06T23:16:42 build: Use __register_atfork() only if really available This is a glibc-specific symbol that has no public declaration. But is being used by the OpenBSD and this implementation as a hack to avoid having to link against the pthread library. This interface is at least included in LSB 5.0 [L], and using pthread_atfork() is otherwise problematic anyway [P]. [L] <https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/baselib---register-atfork.html> [P] <http://austingroupbugs.net/view.php?id=851> One problem is that we were using it whenever __GLIBC__ is defined, which is supposed to be defined only on an actual glibc, but uClibc defines that macro, but it does not provide the symbol on its noMMU variant. We add a new configure check that will try to link a program that uses that symbol to make sure it is present. Closes: !2 Reported-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Aaron Dierking 7cfa2d45 2018-06-14T11:38:31 Correct Clang feature detection Clang's __GNUC__ and __GNUC_MINOR__ definitions are not reliable and may not be defined at all when targeting the MSVC ABI. Use feature-checking macros when possible or check for __clang__. [guillem@hadrons.org: Update for __ protected keyword change. ] Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover 574c7a13 2018-06-18T00:36:44 Protect C language extensions with two leading and trailing underscores This should make their usage safer against user macros.
Aaron Dierking 2ebe6d5a 2018-06-14T11:38:32 Windows support for inet_net_pton() Signed-off-by: Guillem Jover <guillem@hadrons.org>
Aaron Dierking aeea1f40 2018-06-14T11:38:32 Windows support for HASHFileChunk() <io.h> provides the necessary file I/O functions. [guillem@hadrons.org: Move include before <hashinc>. ] Signed-off-by: Guillem Jover <guillem@hadrons.org>
Aaron Dierking b9dee9f6 2018-06-14T11:38:31 Use CHAR_BIT instead of NBBY in strnvis() <sys/param.h> is not available on Windows. Signed-off-by: Guillem Jover <guillem@hadrons.org>
Aaron Dierking 81c3c3e4 2018-06-14T11:38:31 Replace reintroduced legacy u_* type usage in strnvis() and strnunvis() This fixes a regression caused by 2d7de18. These types are not available on all systems. Fixes: commit 2d7de186e9cb19a756c0630ee85cb3f2d29b3484 Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover 5e0998fa 2018-06-09T00:08:14 Remove dead code in vis The loop only executes while len > 0, and the trinary operator in the function argument is checking against len >= 1 which will always be true. Warned-by: coverity
Guillem Jover 8e2d5504 2018-06-06T05:41:34 Fix vis family of functions to not leak The code uses an internal helper function to avoid code repetition. But to get there, the function takes a pointer to a pointer, so that the few functions that require returning an allocated buffer can get hold of it this way. The problem is that the user might pass a NULL pointer and trigger an internal allocation even if the functions are not expected to do so. Add a new internal helper for non-allocations, that will assert that condition, and make any other function that requires this behavior call this one instead. Warned-by: coverity
Baruch Siach 13c32916 2018-06-05T19:21:46 flopen: Add missing <fcntl.h> include Commit 993828d84ee (Add flopenat() function from FreeBSD) dropped the fcntl.h header. This breaks the build with musl libc: flopen.c: In function ‘vflopenat’: flopen.c:60:14: error: ‘O_CREAT’ undeclared (first use in this function) if (flags & O_CREAT) { ^~~~~~~ Restore the fcntl.h header include to fix the build. Fixes: commit 993828d84eed0468c6c15b2818e534e6b134b8e4 Submitted-also-by: parazyd <parazyd@dyne.org> Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover e4e15ed2 2018-05-22T13:50:44 Fix strnvis() and strnunvis() NetBSD ABI break The NetBSD implementations have different prototypes to the ones coming from OpenBSD, which will break builds, and have caused segfaults at run-time. We provide now both interfaces with different prototypes as different version nodes allow selecting them at compile-time, defaulting for now to the OpenBSD one to avoid build-time breakage, while emitting a compile-time warning. Later on, in 0.10.0, we will be switching the compile-time default to the NetBSD version. Ref: http://gnats.netbsd.org/44977 Fixes: https://bugs.debian.org/899282
Guillem Jover 3cabf46b 2018-05-21T03:15:59 Deprecate fgetwln() This function has the same problems as fgetln() which is already marked as deprecated.
Guillem Jover 6eebc1f2 2018-05-21T03:10:12 Fix typo in fgetln() linker warning
Guillem Jover a1730c10 2018-05-15T00:55:02 Add Windows support for getentropy() and arc4random() Import from OpenBSD.
Guillem Jover 6f68c930 2018-05-21T00:22:38 Switch strtonum() implementation from strtoll() to strtoi() Import from NetBSD.
Guillem Jover e13b1a33 2018-05-21T00:20:49 Import strtoi() and strtou() functions from NetBSD
Guillem Jover ef5faeb5 2018-05-20T19:20:33 Update few RCS keyword contents to match BSD originals This will slightly reduce the delta, and makes it easier to compare the sources.
Guillem Jover 2d7de186 2018-05-21T03:09:05 Update vis/unvis modules from NetBSD
Guillem Jover 3efad641 2018-05-21T01:56:33 Update readpassphrase() from OpenBSD
Guillem Jover a6f407ab 2018-05-21T01:34:17 Update heapsort() from OpenBSD
Guillem Jover 21edbb4f 2018-05-21T00:31:15 Update fmtcheck() from NetBSD
Guillem Jover e3979d1a 2018-05-20T19:22:16 Update humanize_number() from FreeBSD Implements HN_IEC_PREFIXES.
Guillem Jover facbddb6 2018-05-20T19:18:18 Update pidfile module from FreeBSD Use EINVAL instead of EDOOFUS. Add a missing synopsis for pidfile_fileno() in the man page. Move the definition of struct pidfh from libutil.h into pidfile.c following upstream change.
Guillem Jover 3d88c999 2018-05-15T00:41:26 Update arc4random() headers from OpenBSD Split Linux support into its own header separate from the generic Unix to fix a Linux-specific issue with clone(). Reset rsp to NULL on failure.
Guillem Jover e42381dc 2018-05-15T00:41:26 Update getentropy() code from OpenBSD Includes changes to handle the Linux syscall blocking when there is not enough entropy during boot, by switching it to non-blocking mode and falling back to the alternative implementations. Man page URL reference fixes. Build fixes for Mac OS X. Fixes: https://bugs.debian.org/898088
Guillem Jover 993828d8 2018-05-21T01:11:46 Add flopenat() function from FreeBSD
Baruch Siach f6ed7c27 2018-04-03T20:10:14 Fix build for openrisc with uClibc uClibc defines EM_OR1K instead of EM_OPENRISC for the OpenRISC ELF e_machine ID. Use EM_OR1K when EM_OPENRISC is not defined. This fixes the following build failure: In file included from nlist.c:44:0: nlist.c: In function ‘__elf_is_okay__’: local-elf.h:224:23: error: ‘EM_OPENRISC’ undeclared (first use in this function) #define ELF_TARG_MACH EM_OPENRISC ^ nlist.c:77:26: note: in expansion of macro ‘ELF_TARG_MACH’ if (ehdr->e_machine == ELF_TARG_MACH && ^ Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover 5ba8c5ba 2018-03-05T00:37:47 progname: Port to Windows Define the directory separator depending on the system targetted. Reported-by: Progyan Bhattacharya <progyanb@acm.org>
Guillem Jover 0093ca2b 2018-03-05T00:02:34 Handle SPARC V8+ on Sun Studio compiler
James Clarke 0b65d439 2018-03-04T23:44:52 Add support for ELF machine EM_SPARC32PLUS 32-bit SPARC on V8+ uses a different ELF machine type. Fixes: https://bugs.gentoo.org/634550 Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover 2a8514d8 2017-07-17T00:57:07 Fix handling of non-contiguous argv + envp in setproctitle() The two arrays might not reference contiguous memory, and assuming they are does break at least now on GNU/Hurd, which contains an unmapped memory block between the memory used by the two arrays. Just check that each element is strictly after the previous one, so that we know there are no unmapped memory blocks inbetween.
James Cowgill b480b7a3 2017-06-19T21:38:40 Fix ELF definitions for MIPS in local-elf.h Add a check for _MIPS_SIM inside the __mips__ #elif to detect mips64el and use ELFCLASS64 in that case. Note that we can't use defined(__mips64) here because that is also defined when the n32 ABI is in use, which uses ELFCLASS32. Fixes: https://bugs.debian.org/865091 Signed-off-by: Guillem Jover <guillem@hadrons.org>
James Cowgill 4cc20e23 2017-06-19T21:37:14 Fix ELF definitions for PowerPC in local-elf.h * ppc64el defines both __powerpc__ and __powerpc64__ but since the __powerpc64__ #elif is below the __powerpc__ one, it will never be hit. * Both assumed that powerpc* was big-endian. Fixes: https://bugs.debian.org/865091 Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover 8e8834d8 2017-06-14T02:53:35 Remove RCSID tags These are obsolete markers, and in some cases they repeat the information already present in the comment header.
Guillem Jover 47013bc9 2017-06-14T01:49:25 Fix broken mmap() usage in nlist() by switching to pread() The offset is not page aligned, which makes mmap() return EINVAL on Linux. Switch to use pread() which handles unaligned offset and non-page sized reads, and because we are already loading parts of the executable by read() calls, so there's not much point in using mmap() anyway.
Guillem Jover e8d340de 2017-06-05T05:30:27 Remove a.out support from nlist() Some libc libraries do not have an <a.out.h> header. And a.out as an executable format is very much obsolete on pretty much all currently supported systems, even if they might still support loading such objects. Remove the a.out support to increase portability.
Igor Gnatenko 7aede6a9 2016-06-27T09:21:43 Make strlcpy()/strlcat() slightly easier to read Backport new changes from OpenBSD. [guillem@hadrons.org: - Update copyright years in COPYING. ] References: https://svnweb.freebsd.org/base?view=revision&revision=281135 Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com> Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover 07c76b66 2017-06-05T06:17:27 Do not use legacy BSD u_* types Some systems do not have these types available, and they are simply convenience aliases. Instead use the expanded versions which are more portable. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=101192
Guillem Jover d6c35f61 2017-01-10T04:33:15 Do not provide funopen() on musl Fixes: https://bugs.debian.org/818246
Guillem Jover 088f147e 2017-02-08T01:49:48 Add support for RISC-V