History log of /openbsd-src/usr.bin/patch/util.c (Results 1 – 25 of 46)
Revision Date Author Comments
# b7041c07 24-Oct-2021 deraadt <deraadt@openbsd.org>

For open/openat, if the flags parameter does not contain O_CREAT, the
3rd (variadic) mode_t parameter is irrelevant. Many developers in the past
have passed mode_t (0, 044, 0644, or such), which mig

For open/openat, if the flags parameter does not contain O_CREAT, the
3rd (variadic) mode_t parameter is irrelevant. Many developers in the past
have passed mode_t (0, 044, 0644, or such), which might lead future people
to copy this broken idiom, and perhaps even believe this parameter has some
meaning or implication or application. Delete them all.
This comes out of a conversation where tb@ noticed that a strange (but
intentional) pledge behaviour is to always knock-out high-bits from
mode_t on a number of system calls as a safety factor, and his bewilderment
that this appeared to be happening against valid modes (at least visually),
but no sorry, they are all irrelevant junk. They could all be 0xdeafbeef.
ok millert

show more ...


# 5fbd5e42 02-Dec-2019 jca <jca@openbsd.org>

Use getline(3) to handle lines longer than 8192 bytes in patch files

Spotted by jsg@ when working on mesa. Diff tested by sthen@ in
a partial i386 bulk. Input from and ok jsg@ millert@


# 34060d49 17-Aug-2019 deraadt <deraadt@openbsd.org>

signal handlers should not call exit() due to possibility of reentering
libc (stdio etc), instead do the unlink tasks then call _exit() instead
ok millert


# 3aaa63eb 28-Jun-2019 deraadt <deraadt@openbsd.org>

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

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.

show more ...


# ef80df5c 30-Dec-2018 guenther <guenther@openbsd.org>

Delete unnecessary <libgen.h> #includes

ok deraadt@


# e7f942e8 07-Apr-2018 anton <anton@openbsd.org>

Remove unused pathnames.h header since patch was refactoring into not invoking
ed back in 2015; ok millert@ tb@ tobias@


# 7e39cfac 26-Jul-2015 millert <millert@openbsd.org>

Remove support for automatically checking files out of RCS. The
behavior is confusing to users and even GNU patch no longer does
it by default. OK krw@ guenther@


# b9fc9a72 16-Jan-2015 deraadt <deraadt@openbsd.org>

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> lines with their current reasons. Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_N

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> lines with their current reasons. Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution. These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)

show more ...


# 71847ebd 13-Dec-2014 tobias <tobias@openbsd.org>

The function savestr allows NULL return values during Plan A patching so in
case of out of memory conditions, Plan B can step in. In many cases, NULL
value is not properly handled, so use xstrdup he

The function savestr allows NULL return values during Plan A patching so in
case of out of memory conditions, Plan B can step in. In many cases, NULL
value is not properly handled, so use xstrdup here (it's outside Plan A/B
patching, which means that even Plan B relies on successful operations).

show more ...


# 0529800e 22-Nov-2014 tobias <tobias@openbsd.org>

Remove SCCS support. For this to work, we would need "get", which we don't
even have in ports. XSI functionality of POSIX, therefore optional.

ok deraadt, schwarze, tedu


# 6cd4fad2 26-Nov-2013 deraadt <deraadt@openbsd.org>

unsigned char casts for ctype
ok krw


# f081e678 24-Jul-2010 ray <ray@openbsd.org>

Send normal output to stdout instead of everything to stderr. This
is currently done in the latest versions of GNU patch.

Please watch out for output appearing out-of-order.

Discussed with millert

Send normal output to stdout instead of everything to stderr. This
is currently done in the latest versions of GNU patch.

Please watch out for output appearing out-of-order.

Discussed with millert and deraadt.

OK deraadt

show more ...


# 22b1adc4 08-Jan-2010 oga <oga@openbsd.org>

Don't leak memory after strdup() in makedirs().

From Igor Zinovik; thanks!

ok stsp@, millert@


# 043fbe51 27-Oct-2009 deraadt <deraadt@openbsd.org>

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(th

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms

show more ...


# 5e2529bc 11-Mar-2006 otto <otto@openbsd.org>

type police and assorted cleanup. From Lionel Fourquaux; ok ray@


# 6fd3743f 20-Jun-2005 otto <otto@openbsd.org>

umask juggling not needed; with Lionel Fourquaux.
ok millert@ espie@


# a6dfabda 16-May-2005 espie <espie@openbsd.org>

Do not call out mkdir -p, but reuse the code from mkdir(1).

Removes the possibility of nasty stuff happening thanks to unquoted
arguments in system(1).

Also plug a small memory leak.

Problems noti

Do not call out mkdir -p, but reuse the code from mkdir(1).

Removes the possibility of nasty stuff happening thanks to unquoted
arguments in system(1).

Also plug a small memory leak.

Problems noticed by Lionel Fourquaud.

okay millert@, deraadt@

show more ...


# ede00281 19-Nov-2004 otto <otto@openbsd.org>

Allow for path names containing spaces and other funny chars (except
tab) by scanning for the tab that separates the date from the
pathname. If no tab is found, revert back to the old behaviour.
Pos

Allow for path names containing spaces and other funny chars (except
tab) by scanning for the tab that separates the date from the
pathname. If no tab is found, revert back to the old behaviour.
Posix says there should be a space between the pathname and the
date, but all known implementations of diff(1) use a tab.
ok kurt@ deraadt@

show more ...


# ec347eb8 05-Aug-2004 deraadt <deraadt@openbsd.org>

spacing


# 53900eee 31-Oct-2003 millert <millert@openbsd.org>

o fairly major man page reorganization
o add --posix option for strict POSIX conformance
o change filename determination to match GNU patch
Tested by various people, including a full ports build by n

o fairly major man page reorganization
o add --posix option for strict POSIX conformance
o change filename determination to match GNU patch
Tested by various people, including a full ports build by naddy@

show more ...


# ddf7b806 15-Aug-2003 otto <otto@openbsd.org>

Add license from patch.c to original source files missing a license.

ok deraadt@


# 0e9f50d8 01-Aug-2003 otto <otto@openbsd.org>

- use stdbool.h instead of roll-your-own booleans
- fix some -Wall warnings
- fix asserts: in some cases remove them, in other cases they have
become Internal errors or detection of malformed patch f

- use stdbool.h instead of roll-your-own booleans
- fix some -Wall warnings
- fix asserts: in some cases remove them, in other cases they have
become Internal errors or detection of malformed patch files.
- fix some free() related code

ok millert@ tedu@

show more ...


# d2b2c547 31-Jul-2003 otto <otto@openbsd.org>

Unbreak relative directory handling. Tweak from millert@

ok millert@


# 8fcd42c2 30-Jul-2003 millert <millert@openbsd.org>

Make prompting POSIX-compliant. POSIX states "The patch utility
shall write a prompt to standard output and request a filename
interactively from the controlling terminal (for example, /dev/tty)."
O

Make prompting POSIX-compliant. POSIX states "The patch utility
shall write a prompt to standard output and request a filename
interactively from the controlling terminal (for example, /dev/tty)."
OK deraadt@ and otto@

show more ...


# beb0e89a 29-Jul-2003 millert <millert@openbsd.org>

o add pathnames.h
o ignore empty TMPDIR environment variable
o strip any trailing slashes from TMPDIR
otto@ OK


12