Fix 'ldapvi --in' issue with base64 encoded dn when (len_dn % 3) == 0
Fix 'ldapvi --in' bug in ldapvi/base64.c read_base64(..) that cause a missing
'\0' terminator when decoding base64 encoded DNs which don't end with
padding (i.e. when (len_decoded_dn % 3) == 0).
Recipe to reproduce the issue without the fix:
Example LDIF file (test.ldif):
--
# dn of 'ou=abc,dc=example,dc=com' (length 24) gets base64 encoded
# without padding
dn:: b3U9YWJjLGRjPWV4YW1wbGUsZGM9Y29t
objectclass: organizationalUnit
ou: abc
--
Running:
VISUAL=cat ldapvi --in --add test.ldif 2>/dev/null
results in the following output (note the 'sZGM9Y29t' suffix after 'add
ou=abc,dc=example,dc=com'):
--
# -*- coding: utf-8 -*- vim:fileencoding=utf-8:
# http://www.lichteblau.com/ldapvi/manual#syntax
add ou=abc,dc=example,dc=comsZGM9Y29t
objectclass: organizationalUnit
ou: abc
--
Don’t switch off canonical mode.
I am not sure what's the point, but certainly it leads to password
showing up in the audit log.
fix use-after-free in sasl code
==20127== Invalid read of size 4
==20127== at 0x412AC4: finish_sasl_redirection (sasl.c:67)
==20127== by 0x406901: rebind (ldapvi.c:611)
==20127== by 0x407843: do_connect (ldapvi.c:732)
==20127== by 0x4042F3: main (ldapvi.c:1739)
==20127== Address 0x4c6498c is 28 bytes inside a block of size 40 free'd
==20127== at 0x4A077E6: free (vg_replace_malloc.c:446)
==20127== by 0x4068EE: rebind (ldapvi.c:609)
==20127== by 0x407843: do_connect (ldapvi.c:732)
==20127== by 0x4042F3: main (ldapvi.c:1739)
Originally filed as a resolution of
https://bugzilla.redhat.com/show_bug.cgi?id=949157
Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Adds .gitignore to ignore all built files
Fixed 64bit-portability-issue
Correct text of GPLv2
Correct the outdated GPL v2 license text carried by the package.
return 0 instead of nothing
declare some void functions to be really void
Use $(DESTDIR) for packaging with rpm (and I suspect Debian as well).
Handle pager commands with arguments
This handles PAGER in the same way the last commit handled EDITOR.
Signed-off-by: Anders Kaseorg <andersk at mit.edu>
Handle editor commands with arguments
Previously when the EDITOR environment variable is set to a command
with arguments, such as ?emacsclient --alternate-editor emacs?, ldapvi
would fail to launch the editor:
$ ldapvi
26 entries read
error (misc.c line 180): No such file or directory
editor died
error (ldapvi.c line 83): No such file or directory
Fix this by launching the editor via /bin/sh.
Signed-off-by: Anders Kaseorg <andersk at mit.edu>
Cast the trailing NULL on execl() calls
From exec(3): ?The list of arguments must be terminated by a NULL
pointer, and, since these are variadic functions, this pointer must be
cast (char *) NULL.?
This prevents crashes on 64-bit systems, where 0 is a 32-bit integer
and (char *) NULL is a 64-bit pointer.
Signed-off-by: Anders Kaseorg <andersk at mit.edu>
Remove the misguided encoding option for VIM
use @docdir@, patch by Tom Canich
use putenv rather than setenv for old solaris versions
use $DESTDIR, thanks to Gavin Henry
FreeBSD install patch, thanks to Ulrich Spoerlein