tedu
97919939ff
zero tmpout too. reminded by related diff from tim
4 years ago
tedu
030f5c6e7b
overwrite the key in failure modes in case the caller doesn't check.
ok deraadt
4 years ago
tb
f189080779
Adjust whitespace, so Ta macros are aligned vertically as already done in
ober_add_string.3 and as it was before the ber -> ober rename.
5 years ago
tb
c7e739d82b
The ber_* namespace is used by liblber since time immemorial,
so move our BER API to the unused ober_* prefix to avoid some
breakage in ports.
Problem diagnosed by jmatthew with ber_free() in samba, but
there are many others as pointed out by sthen.
tests & ok rob
ok sthen (who had an almost identical diff for libutil)
"go head hit it" deraadt
5 years ago
deraadt
fd9d083e20
uucplock(3) is incorrectly named in some places, it is actually uu_lock(3)
(more unclear is if anything in ports uses this, as our base no longer does)
5 years ago
martijn
742a87c636
Revert previous. There were some users of the quirky behaviour that were
missed during code scan.
5 years ago
martijn
9a09cc0ee9
Fix argument list for ber_set_writecallback
OK claudio@
5 years ago
jmc
f057789eb2
wonky comma;
5 years ago
martijn
e78f6151d9
Document that ber_scanf_elements' 'p' and 't' attribute don't eat the
current ber element.
OK claudio@
Seems sensible to deraadt@
5 years ago
martijn
8eab0e4153
Make ber_scanf_elements's 'e' attribute eat the element.
Right now all consumers use 'e' at the end of the list, so no regressions
should be introduced.
OK claudio@
Seems sensible to deraadt@
5 years ago
martijn
89ee3aeaf4
Make sure that ber in ber_scanf_elements is not NULL before parsing format
where ber is utilized. This also allows us to remove the ber->be_next
check, which can cause weird behaviour, because a NULL be_next would result
in parsing the last element twice.
OK claudio@ on previous version
OK rob@
5 years ago
martijn
738a1a7927
Don't use a 0 element to determine the end of an OID when comparing two
OIDS. This can result in false equality matches.
OK claudio@
5 years ago
martijn
0802062d3c
There's no reason why the first digit of an OID can't be 0.
OK claudio@
"Good find" deraadt@
5 years ago
deraadt
74b2c8400a
snprintf/vsnprintf return < 0 on error, rather than -1.
5 years ago
schwarze
c3832ee06f
Actually, the C standard only guarantees that atexit(3) returns non-zero
on error, so tweak previous to test "atexit(...) != 0" for portability.
"OK ok ok sorry backwards" deraadt@
5 years ago
deraadt
e5e55cd690
When system calls indicate an error they return -1, not some arbitrary
value < 0. errno is only updated in this case. Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.
5 years ago
deraadt
ebbe8d8121
atexit() returns -1 on failure
5 years ago
rob
9d258bd6e0
Limit maximum number of length octets to platform independent sizeof(int32_t).
Problem noticed by bluhm@. Discussed on hackers.
ok claudio@
5 years ago
rob
5ea11244b8
whitespace
5 years ago
rob
459d3403bc
Cleanup some residual markup from the ber.3 days.
ok jmc@, schwarze@
5 years ago
schwarze
f6ecccdd17
add various missing information
and remove the lie that these functions would set errno;
tweaks and OK jmc@; OK rob@ on the previous version
5 years ago
rob
509ea037e6
Add XXX to a comment.
5 years ago
rob
8e14404ce3
Correct errno markup. Noticed by schwarze.
Discussed with schwarze and jmc. ok schwarze
5 years ago
jmc
e2a13c2289
sort SEE ALSO;
5 years ago
schwarze
a870edacf8
add substantial amounts of missing information;
OK rob@
5 years ago
rob
4a2c8d4050
Consistently make errno a .Vt
5 years ago
schwarze
0b50432670
delete some duplicate words
5 years ago
rob
b43f7ed0ff
Split ber.3 into logical parts. Further tweaking will be done in tree.
Discussed with and ok jmc@, schwarze@, claudio@
5 years ago
rob
b02b4b32b0
Enable support for the writting of BITSTRING by treating it as an OCTETSTRING.
ok claudio@
5 years ago
rob
b6f67bd097
Enforce smallest number of contents octets for int (and enum).
ok claudio@
5 years ago
rob
f90a0d7af2
Mention #include of <sys/types.h> in synopsis.
Discussed with claudio@ and tedu@.
5 years ago
rob
cbfc875695
Fail early if a (universal) primitive type identifies as constructed, or if a
boolean has a contents length other than 1.
ok claudio@
5 years ago
rob
d7ff82d34b
Enforce minimal number of octets for tag > 30.
"sure" claudio@
5 years ago
rob
b3f85186e0
In long form encoding, explicitly prohibit an initial length octet of 0xff
which is reserved for future use.
ok claudio@
5 years ago
rob
ad393dcd5f
The BER API is currently used by ldap, ldapd, ldapctl, ypldap, snmpd, and
snmpctl. Separate copies of ber.[ch] have existed and been maintained in sync
in ldap, ldapd, ypldap and snmpd.
This commit moves the BER API into /usr/lib/libutil. All current consumers
already link libutil. ldapd and snmpd regress passes, and release builds.
With help from tb@ and guenther@.
ok deraadt@, tb@
5 years ago
schwarze
28c4796b19
missing dots after ".%P pp"; the case of btree(3) was
reported by Fabio Scotoni <fabio at esse dot ch>;
also garbage collect one .Tn while here
5 years ago
millert
47165904cf
I am retiring my old email address; replace it with my OpenBSD one.
5 years ago
bcook
101f48a3de
Change imsg header definitions to use standard types.
ok deraadt@ claudio@
5 years ago
bluhm
df4fda1761
Calling llabs(LLONG_MIN) is undefined behavior, llvm 7.0.1 does not
work with our old code. In fmt_scaled() move the check before
calling llabs().
found by regress/lib/libutil/fmt_scaled; OK deraadt@ millert@ tedu@
5 years ago
jmc
c1931faa11
explicitly mention local processes; from geoff hill
ok nicm
6 years ago
deraadt
68d7aa0670
delete volatile intended to silence whiny old compilers around vfork.
This variable is only used in the parent context so there is no issue.
ok kettenis
6 years ago
djm
468ab01728
constrain fractional part to [0-9] (less confusing to static analysis); ok ian@
6 years ago
nicm
2c571a29e6
Fix function argument names, from Abel Abraham Camarillo Ojeda via jmc@.
6 years ago
deraadt
3bfb6d03b3
Adjust references for sysctl(3) to sysctl(2)
6 years ago
kettenis
0566b09422
Make a few internal symbols static and add a Symbols.map version script
to control which symbols are exported from the shared library.
ok guenther@, deraadt@, jca@
6 years ago
zhuk
8d93985924
It's the imsg_compose(3) who accepts 'fd' argument, not imsg_create(3).
6 years ago
reyk
9b036c42f9
spacing (in EXAMPLES code)
7 years ago
jmc
e471403169
add previous to NAME;
7 years ago
nicm
cddf1b0fbc
Add getptmfd(), fdopenpty(), fdforkpty() functions. These allow programs
to separate the open(/dev/ptm) from the ioctl(PTMGET) for privilege
separation or pledge().
Based on a diff from reyk@.
ok deraadt millert
7 years ago
deraadt
f94fcc6e0f
use freezero() instead of explicit_bzero+free
7 years ago