summaryrefslogtreecommitdiff
path: root/usr.bin/cvs
AgeCommit message (Collapse)Author
2023-08-11cvs_file_copy() used futimes(), but only set the tv_sec fields,Philip Guenther
which presumably meant passing stack garbage in the tv_usec and failing with EINVAL, whee. Switch to futimens() and set the full timespecs from the incoming struct stat ok millert@
2023-03-08Delete obsolete /* ARGSUSED */ lint comments.Philip Guenther
ok miod@ millert@
2022-12-26spelling fixes; from paul tagliamonteJason McIntyre
amendments to his diff are noted on tech
2021-11-28Stop using MAXBSIZE to eliminate sys/param.h including (which injects aTheo de Raadt
ton of namespace intrusion). Create local sizes, and refactor some code along the way. ok millert
2021-10-25do not need a temporary one time use variable which befuddlesTheo de Raadt
2021-10-24For open/openat, if the flags parameter does not contain O_CREAT, theTheo de Raadt
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
2021-04-13Fix merging of files that lack a final \n at EOF after a block of common lines.Stefan Sperling
Problem reported by Josh Rickmar. ok millert@
2021-01-27fix -fno-common issues; ok mortimerTheo de Raadt
2020-10-19Accommodate POSIX basename(3) that takes a non-const parameter andChristian Weisgerber
may modify the string buffer. ok florian@ millert@
2020-06-26Fix merging of files that lack newlines for diff(3), OpenRCS, and OpenCVS.Stefan Sperling
Merges with a file that lacks newlines (\n) were triggering a fatal error. This could be easily reproduced with merge(1) and diff3(1): $ echo foo > foo $ echo bar > bar $ echo -n baz > baz $ merge -p foo bar baz merge: failed to merge $ diff3 -E foo bar baz 1a ======= diff3prog: logic error $ Fix this by properly handling short reads from the third file argument. Only the third file argument triggered the problem. The other input files were already handled correctly. ok millert@
2019-06-28When system calls indicate an error they return -1, not some arbitraryTheo de Raadt
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.
2019-06-28asprintf returns -1, not an arbitrary value < 0. Also upon error theTheo de Raadt
(very sloppy specification) leaves an undefined value in *ret, so it is wrong to inspect it, the error condition is enough. discussed a little with nicm, and then much more with millert until we were exasperated
2018-12-30Delete unnecessary <libgen.h> #includesPhilip Guenther
ok deraadt@
2018-12-05fix incorrect usage of the .Bx macro;Ingo Schwarze
one case reported by Fabio Scotoni <fabio at esse dot ch>, the rest found with regress/usr.bin/mandoc/db/dbm_dump
2018-07-14don't run cvs_client_sendfile() if its file_type is CVS_DIR, but do notJoris Vink
depend on it being CVS_FILE explicitly. unbreaks remote operations on removed files.
2017-08-28fix const related warnings; ok millert@Otto Moerbeek
2017-08-28Use xasprintf() instead of calloc() + strlcpy() + memcpy() toTodd C. Miller
generate the log line. Fixes a clang warning about using the wrong size argument in strlcpy(). The existing code was safe but not good strlcpy() practice. OK otto@
2017-08-21When executing ssh, use "--" to indicate end of arguments before theTodd C. Miller
host name. Adapted from a MirBSD diff by Thorsten Glaser.
2017-07-20Add missing <time.h> header.Okan Demirmen
ok joris@
2017-06-01If CVS_LOCK_REPO is set only attempt to unlock the repo if we're local.Joris Vink
Otherwise we end up calling cvs_repository_unlock() with garbage from the stack if we're dealing with a remote cvsroot.
2017-06-01Don't look at file_type until after cvs_remote_classify_file() was called.Joris Vink
The file status may be unknown until after that call.
2017-06-01Stop looking at current_cvsroot->cr_method to figure out if we're remote or not.Joris Vink
Instead use cvsroot_is_local() and cvsroot_is_remote().
2017-05-31Do not use CVS_LOCK_REPO for committing.Joris Vink
This flag tells our file recursion code that for each directory entered we should lock it. Commit however locks all relevant directories on its own when it is about to make changes and should not depend on the file recursion code to do so.
2017-05-31Plug memleak in rcs_translate_tag() that was causing havoc on large repos.Joris Vink
2017-05-31When unlocking a directory only unlock the given one rather then all repo_locks.Joris Vink
2017-05-31fix indentationJoris Vink
2017-05-31Fix opencvs tag so it does not attempt to to local operations in a remote setup.Joris Vink
While here make sure the "up-to-date" check (-c) works as one expects.
2017-05-29cvs_file_classify() was making the mistake of only taking over a stickyJoris Vink
tag from Entries for a given file if the sticky tag is present. while changing this we can simplify some logic in update.c on how it decides what tag to use for file classification.
2017-05-28Let opencvs show ignored files on import, not showing them is just confusing.Joris Vink
ok stsp@
2017-05-28Don't allow opencvs to commit towards tags that are not branches.Joris Vink
Gets rid of the old logic that wasn't working and replaced it with a simplified version. ok stsp@
2017-05-28Teach opencvs status to display the sticky tag according to what it reallyJoris Vink
represents if it is a branch or a revision. ok stsp@
2017-05-28Bring the opencvs log message template inline with other cvs implementations.Joris Vink
ok stsp@
2016-11-03Don't use ce_time if we are running as a server, it won't be present.Joris Vink
2016-10-27minor whitespace fixes.Joris Vink
2016-10-18Using bitwise OR along with two assignments in the conditional ofTodd C. Miller
a while() loop is a trap for the unwary programmer (albeit a clever trap). Break this up into two separate assignments and using boolean OR for clarity. OK otto@
2016-10-18Add the branch revision to the status output much like GNU cvs does.Joris Vink
OK millert@
2016-10-16Remove useless n=n assignment in the first parse of a for().Todd C. Miller
It was already removed from the rcs version by nicm@.
2016-10-15Quiet compiler warnings. OK tomc@ tb@Todd C. Miller
2016-10-14Fix update -r and -A.Frederic Cambus
In certain cases update -r and update -A would not properly set or reset the sticky tag for file(s). From Joris Vink. OK millert@
2016-10-13rcsnum_free() -> free() cleanups. From Michael W. Bombardieri.Frederic Cambus
OK millert@
2016-10-13Fix revision lookups for branches. Properly perform a revisionTodd C. Miller
lookup so update -r actually works again, as a bonus throw a more correct error when the revision could not be found. From Joris Vink.
2016-10-12When allocating the h_table array use the size of struct hash_head,Todd C. Miller
not the size of a pointer. From Joris Vink. OK fcambus@
2016-10-12Use the correct type for p. From Joris Vink.Frederic Cambus
OK tb@
2016-09-04Add missing getpw pledgeTheo Buehler
ok deraadt
2016-08-16When the commit message is empty, don't default to c)ontinueTheo Buehler
(committing without log message) but a)bort. Also, accept the uppercase versions of the choices. Matches the corresponding change of behavior of GNU cvs. suggested by & ok jcs
2015-12-24more e-mail -> emailmmcc
2015-12-22commited -> committedmmcc
2015-12-09Remove NULL-checks before free(). ok tb@mmcc
2015-11-19opencvs can use pledge "stdio rpath wpath cpath fattr proc exec".Theo de Raadt
I have not looked into adding stricter pledges later in the code.
2015-11-17Merge xmalloc.[ch] files across base, skipping OpenSSH for now.Tobias Stoeckmann
ok nicm