Initial commit

This commit is contained in:
2026-03-21 12:43:00 -05:00
commit 83bf16823c
438 changed files with 33617 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
The last test of t4129 creates a directory and expects its setgid bit
(g+s) to be off. But this makes the test fail when the parent directory
has the bit set, as setgid's state is inherited by newly created
subdirectories. Make the test more robust by accepting the presence of
the setgid bit on the created directory. We only allow 'S' (setgid on
but no executable permission) and not 's' (setgid on with executable
permission) because the previous 'umask 0077' shouldn't allow the second
scenario to happen.
Note that only subdirectories inherit this bit, so we don't have to make
the same change for the regular file that is also created by this test.
But checking the permissions using grep instead of test_cmp makes the
test a little simpler, so let's use it for the regular file as well.
Also note that the sticky bit (+t) and the setuid bit (u+s) are not
inherited, so we don't have to worry about those.
Reported-by: Kevin Daudt <me@ikke.info>
Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
---
t/t4129-apply-samemode.sh | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/t/t4129-apply-samemode.sh b/t/t4129-apply-samemode.sh
index 41818d8315..3818398ca9 100755
--- a/t/t4129-apply-samemode.sh
+++ b/t/t4129-apply-samemode.sh
@@ -90,12 +90,10 @@ test_expect_success POSIXPERM 'do not use core.sharedRepository for working tree
rm -rf d f1 &&
git apply patch-f1-and-f2.txt &&
- echo "-rw-------" >f1_mode.expected &&
- echo "drwx------" >d_mode.expected &&
- test_modebits f1 >f1_mode.actual &&
- test_modebits d >d_mode.actual &&
- test_cmp f1_mode.expected f1_mode.actual &&
- test_cmp d_mode.expected d_mode.actual
+ test_modebits f1 >f1_mode &&
+ test_modebits d >d_mode &&
+ grep "^-rw-------$" f1_mode &&
+ grep "^drwx--[-S]---$" d_mode
)
'
--
2.29.2
+19
View File
@@ -0,0 +1,19 @@
# conf.d file for git-daemon
#
# Please check man 1 git-daemon for more information about the options
# git-daemon accepts. You MUST edit this to include your repositories you wish
# to serve.
#
# Some of the meaningful options are:
# --syslog --- Enables syslog logging
# --verbose --- Enables verbose logging
# --export-all --- Exports all repositories
# --port=XXXX --- Starts in port XXXX instead of 9418
#
GITDAEMON_OPTS="--syslog --base-path=/var/git"
# To run an anonymous git safely, the following user should be able to only
# read your Git repositories. It should not be able to write to anywhere on
# your system, esp. not the repositories.
GIT_USER="nobody"
GIT_GROUP="nobody"
+13
View File
@@ -0,0 +1,13 @@
#!/sbin/openrc-run
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
pidfile="/var/run/git-daemon.pid"
command="/usr/bin/git"
command_args="daemon ${GITDAEMON_OPTS}"
start_stop_daemon_args="-e HOME= -e XDG_CONFIG_HOME= -b -m -p ${pidfile} -u ${GIT_USER:-nobody}:${GIT_GROUP:-nobody}"
depend() {
use logger
}
+63
View File
@@ -0,0 +1,63 @@
[build]
type = "autotools"
[build.flags]
configure = [
"--with-gitconfig=/etc/gitconfig",
"--with-python=python3",
"--with-libpcre2",
]
post_install = [ "install -Dm755 $DEPOT_SPECDIR/git-daemon.initd $DESTDIR/etc/init.d/git-daemon", "install -Dm644 $DEPOT_SPECDIR/git-daemon.confd $DESTDIR/etc/conf.d/git-daemon", "install -Dm644 contrib/completion/git-completion.bash $DESTDIR/usr/share/bash-completion/completions/git", "install -Dm644 contrib/completion/git-prompt.sh $DESTDIR/usr/share/git-core/git-prompt.sh" ]
make_install_vars = [ "perllibdir=/usr/lib/perl5/5.42/site_perl" ]
keep = [ "etc/conf.d/*" ]
[dependencies]
build = ["python"]
optional = [
"less",
"libsecret",
"man-db",
"openssh",
"org.freedesktop.secrets",
"perl-authen-sasl",
"perl-cgi",
"perl-io-socket-ssl",
"perl-libwww",
"python",
"perl-term-readkey",
"tk",
"subversion",
]
runtime = [
"curl",
"expat",
"grep",
"openssl",
"pcre2",
"perl",
"perl-error",
"perl-mailtools",
"shadow",
"zlib-ng",
]
test = ["openssh"]
[[manual_sources]]
files = [
"fix-t4219-with-sticky-bit.patch",
"git-daemon.initd",
"git-daemon.confd",
]
[package]
description = "the fast distributed version control system"
homepage = "https://git-scm.com/"
license = "GPL-2.0-only"
name = "git"
version = "2.53.0"
[[source]]
extract_dir = "$name-$version"
patches = ["fix-t4219-with-sticky-bit.patch"]
sha256 = "5818bd7d80b061bbbdfec8a433d609dc8818a05991f731ffc4a561e2ca18c653"
url = "https://www.kernel.org/pub/software/scm/git/git-$version.tar.xz"