Age | Commit message (Collapse) | Author |
|
amendments to his diff are noted on tech
|
|
if `first_guess' is zero then main() assumes that locate_hunk has failed
and aborts the patch operation. Instead, make sure to return 1 (the
line number) so that the patch operation can continue.
Issue originally found by Neels Hofmeyr in the regress suite of the diff
implementation for got, where the tests assume that applying a diff with
`patch' and then again with `patch -R' yields back the original file.
ok stsp@
|
|
patch(1) fails to recognize the reversal application of a patch that
cerates a file. since an empty context always matches, the idea is to
run the dwim ("do what I mean") code also when locate_hunk succeeds but
the patch would create a file and the match is on the first line.
fixes the (disabled) test t3.
ok stsp@
|
|
jmc@ dislikes a comma before "then" in a conditional, so leave those
untouched.
ok jmc@
|
|
person. Rewrite or use singular they.
ok thfr@ sthen@ daniel@ ian@ job@ kmos@ jcs@ ratchov@ phessler@ and
others I'm likely missing on an earlier version.
feedback tj@, feedback and ok jmc@
|
|
fixing an omission pointed out by chrisz@;
OK jmc@ deraadt@ chrisz@
|
|
ok millert
|
|
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
|
|
may modify the string buffer. From Joerg Sonnenberger for DragonFly BSD.
ok millert@
|
|
Also:
- sort declarations in the same order as definitions in pch.c
- delete an extra pfetch() declaration
ok tobias@
|
|
|
|
|
|
Spotted by jsg@ when working on mesa. Diff tested by sthen@ in
a partial i386 bulk. Input from and ok jsg@ millert@
|
|
libc (stdio etc), instead do the unlink tasks then call _exit() instead
ok millert
|
|
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.
|
|
|
|
ok deraadt@
|
|
FreeBSD and NetBSD has this for a while, and GNU patch got it even earlier
than we got -C.
input from sthen@ & jca@; okay sthen@, jca@ and deraadt@.
|
|
Delete a bunch of unnecessary #includes and sort to match style(9)
while doing the above cleanup.
ok deraadt@ krw@
|
|
okay tb@ and benno@
|
|
ed back in 2015; ok millert@ tb@ tobias@
|
|
six letters if they actually match "--- a/" and "+++ b/" instead of
laxer checks.
ok tom, tedu, millert
|
|
ok millert
|
|
Found the hard way be me, OK tedu
|
|
prepended to filenames. detect this condition and attempt to correct it.
ok openbsd
|
|
doesn't get dribbled with known contents.
ok otto millert tobias
|
|
with the global by the same name, so rename it "lines_allocatedp".
|
|
If the last line of a file is removed, the line cache is erroneously
considered empty, which means that changed lines are added at the top.
spotted by and okay otto@
|
|
Happens in bulf build where no tty is available.
ok sthen@ naddy@ $(jot -b yes 1000) landry@
|
|
ok krw
|
|
misbehaviour is triggered with 'c' and 'i' commands on empty buffers.
Spotted and fixed by Martin Natano <natano at natano dot net>.
ok millert@
|
|
ok tb@
|
|
OK tb@ jsg@
|
|
as a test idiom, either when pledge was young or during the transition
to strings.... dunno
|
|
|
|
ok deraadt
|
|
|
|
(adding proc exec), now that "exec" has arrived in the kernel. This
permits the dangerous game of feeding ed-style diffs with popen() via
/bin/ed. Shocked yet? Your mission, should you choose to accept it,
is to replace this code with an builtin ed-style patcher, maybe cribbing
code from ed itself.
I'm sorry, but we can't fix the entire world all at once. Noone loves
deprecating standarized features as much as we do, but there are some
lines. Maybe if people become aware of how crappy the implimentations
of some standard features are, they could help decide the path.
|
|
fork+execve, and execve is not going to become available in this fashion.
ed diffs should be handled using a built-in handler, and various folks
have been discussing this behind the scenes.
|
|
/bin/ed. This is RETARDED. Nothing learned from the last year?
Add tame "proc" until that is fixed, to allow fork+exec.
I beg for someone to cross-link the guts of ed directly into patch, or
write a ed-subset which can do the job.
|
|
in case of exploitation, no more network access, fork, execve, etc.
I wonder if we could use whitepath lists here - if it is reasonable to
limit operation in directories known early on?
|
|
commands might contain a newline in the replacement pattern (escaped
with a backslash before it), causing patch's understanding of the
state the ed child process is in to diverge from reality. This can
lead to patch unwillingly feeding '!' (execute shell command) lines
to ed. From Martin Natano. OK deraadt@
|
|
behavior is confusing to users and even GNU patch no longer does
it by default. OK krw@ guenther@
|
|
"and" and "or" to join sentence clauses, and you can use commas, but both hinders
reading;
|
|
|
|
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)
|
|
Prevents arbitrary ed command executions in following lines.
ok millert
|
|
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).
|
|
by supporting arbitrarily long lines just like Plan A does.
ok tedu
|
|
|