Commits
- Commit:
232c0ac1b26d38add9148b4e0382fc86c0cabd37
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
remove dependency of gitwrapper, gotctl, and gotsh on object_parse.c
Move some functions from object_parse.c into hash.c. These functions either
require hash.c code anyway or contain object ID implementation internals.
Add a new file object_qid.c, for got_object_id_queue and got_object_qid.
This new file must be linked to virtually every program.
- Commit:
4fccd2fe0ffbbc668b66abe63614470635f92f1b
- From:
- Thomas Adam <thomas@xteddy.org>
- Date:
portable: configure: split out dependencies
Rather than assume all dependencies are required for all programs, split
them out.
This will make packaging easier, as well as splitting the code to use
subprojects.
Note that due to the use of config.h semantics, in most cases the
got_compat.h header file is now at the top of the .c file it is included
in, so that it can handle the system header inclusion properly.
- Commit:
98670ba726486c39efff220ab1e074c62023aae7
- From:
- Thomas Adam <thomas@xteddy.org>
- Date:
portable: rework SHA detection
Simply the SHA detection by not predicating on libcrypto, but instead
checking individual header files.
- Commit:
4680f704353811c8bb6ce65eac3714d1bd200c26
- From:
- Thomas Adam <thomas@xteddy.org>
- Date:
portable: remove sha1.h; found portably
Remove sha1.h as this is found portably across systems.
- Commit:
c8ae092d079ca1c9f5f2a7e44c73948cd55454e7
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
provide functions to parse/serialize different hashes
it abstracts over the hash type and ensures that object ids are zero'ed
before their sha1 digest is written. Needed by the incoming sha256
support.
ok stsp@
- Commit:
be288a59f42e0b5e203e2c5545bf3e042ff4b79f
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
rename lib/sha1.c to lib/hash.c
It will soon grow functions to deal with sha256 too. stsp@ agrees.
- Commit:
588a8092bc282294ee23585991e81586905a8fd4
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
include sha2.h too where sha1.h is included
In preparation for wide sha256 support; stsp@ agrees. Change done
mechanically with
find . -iname \*.[cy] -exec sam {} +
X ,x/<sha1\.h>/i/\n#include <sha2.h>
- Commit:
01986ce9001e81cf428f546081a6888c518a54cc
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
introduce got_object_id_hex to replace some got_sha1_digest_to_str()
It's an analogous to got_object_id_str but writes to the given buffer.
ok + improvements by stsp@
- Commit:
ebe6ec920b98ddf1b63687d78857f37af34b691f
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
use a caller-specified size limit for mapped files in got_object_raw_alloc()
Without this we end up being confused about whether a raw object has
been mapped into memory, leading to crashes.
ok op@
- Commit:
1eda26823a5463fc2e82f0a05f454faf2ac46e65
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
adjust a misleading error message in got_object_raw_alloc()
ok op@
- Commit:
ae30b714638faafc5075b3a69696149f4a129630
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
provide a getline-style function for blobs
ok jamsek
- Commit:
a5f70c45170231fc53fcfe00069abd2dc295b49c
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
add got_object_blob_is_binary function
needed for future use by gotwebd. ok stsp@
- Commit:
aa75acde9c5f406b658c54827bc596cf96d7c64e
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
check size before calling mmap(2)
It's only a preparatory step, as checking whether a size_t is less than
SIZE_MAX is moot. In a follow-up commit, however, the `filesize' field
of the struct got_pack will become off_t and these checks will kick in.
This also makes consistent how we guard mmap(2) against empty files.
ok and improvements stsp@
- Commit:
3efd8e3122b7d03a046d23fd5eed22c1b78f8ceb
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
introduce gotd(8), a Git repository server reachable via ssh(1)
This is an initial barebones implementation which provides the absolute
minimum of functionality required to serve got(1) and git(1) clients.
Basic fetch/send functionality has been tested and seems to work here,
but this server is not yet expected to be stable.
More testing is welcome. See the man pages for setup instructions.
The current design uses one reader and one writer process per repository,
which will have to be extended to N readers and N writers in the future.
At startup, each process will chroot(2) into its assigned repository.
This works because gotd(8) can only be started as root, and will then
fork+exec, chroot, and privdrop.
At present the parent process runs with the following pledge(2) promises:
"stdio rpath wpath cpath proc getpw sendfd recvfd fattr flock unix unveil"
The parent is the only process able to modify the repository in a way
that becomes visible to Git clients. The parent uses unveil(2) to
restrict its view of the filesystem to /tmp and the repositories
listed in the configuration file gotd.conf(5).
Per-repository chroot(2) processes use "stdio rpath sendfd recvfd".
The writer defers to the parent for modifying references in the
repository to point at newly uploaded commits. The reader is fine
without such help, because Git repositories can be read without
having to create any lock-files.
gotd(8) requires a dedicated user ID, which should own repositories
on the filesystem, and a separate secondary group, which should not
have filesystem-level repository access, and must be allowed access
to the gotd(8) socket.
To obtain Git repository access, users must be members of this
secondary group, and must have their login shell set to gotsh(1).
gotsh(1) connects to the gotd(8) socket and speaks Git-protocol
towards the client on the other end of the SSH connection.
gotsh(1) is not an interactive command shell.
At present, authenticated clients are granted read/write access to
all repositories and all references (except for the "refs/got/" and
the "refs/remotes/" namespaces, which are already being protected
from modification).
While complicated access control mechanism are not a design goal,
making it possible to safely offer anonymous Git repository access
over ssh(1) is on the road map.
- Commit:
4e5e98e8510dc01d4848f809792357a7ea446baf
- From:
- Thomas Adam <thomas@xteddy.org>
- Date:
portable: remove sha1.h include
This is searched for portably.
- Commit:
405ceee385e4537e9878f8e24a6c3be0640bcd5b
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
remove unnecessary includes of got_lib_privsep.h
- Commit:
b61ceafcc71b10ab2295bf09b9ddb34a07666f73
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
move functions which open objects into new file object_open_privsep.c
For the future, this will make it possible to provide alternative
implementations of functions now stored in object_open_privsep.c.
This will probably be needed by future gotd(8) which runs inside
a chroot(2) environment and without the "exec" pledge(2) promise,
making it impossible to run libexec helpers on the fly.
Details of this design are not yet settled, but moving functions
into a separate compilation unit won't hurt in any case.
- Commit:
6f6c25d65e82e60c44877d2aa05bcbdbc48e65b3
- From:
- Mark Jamsek <mark@jamsek.dev>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
drop unconventional got_object_commit_dup() routine
Replace with got_object_commit_retain() to increment commit object
reference counter.
suggested by and ok stsp@
- Commit:
7e8004bac7c582235903e2d61b6e7b59f96244ea
- From:
- Mikhail <mp39590@gmail.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
tog: add new log view limit feature to filter commits
Use the & key map to enter a pattern with which to limit the displayed commits
to those matching the provided pattern; similar to less(1) and mutt's limit
feature. Includes various tweaks from op.
ok plus fixes from op@
- Commit:
35eabca99227d5245619972d35e5229c63c248db
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
plug leak in resolve_symlink
ok stsp@
- Commit:
b6b86fd1b9828e38d59915e62fddce62952b8b75
- From:
- Josiah Frentsos <jfrent@tilde.team>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
remove trailing whitespace; patch by Josiah Frentsos
- Commit:
8b925c6ccd3968917253ea191906a1710c40ed2d
- From:
- Thomas Adam <thomas@xteddy.org>
- Date:
portable: add back sys/queue.h
Now that the handling of including sys/queue.h is better, there's no
need to remove those lines from the source. Copy the location of those
original sys/queue.h lines from upstream at the same line number, so as
to avoid any conflicts in the future.
- Commit:
19a6a6b5eea7ed2df9eaaba2364d18ee05678ddd
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
move got_opentempfd() out of lib/diff.c again
ok tracey
- Commit:
acb9e3ea2ed831226f75eb7606ecd06a0711b131
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
pass the correct file to fdopen(); ok tracey
- Commit:
f9bba04a89d0b706fe1b4d95cfe16b75b70097e1
- From:
- Tracey Emery <tracey@traceyemery.net>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
fix missed dup in open_blob per stsp@