From 370bf9bec714747244da00a7fd793da04c49c523 Mon Sep 17 00:00:00 2001 In-Reply-To: References: From: =?UTF-8?q?Andr=C3=A9=20Batista?= Date: Tue, 17 May 2022 19:18:49 -0300 Subject: [PATCH] guix/git: Disable owner validation when updating cache. To: 55399@debbugs.gnu.org Cc: maximedevos@telenet.be --- gnu/packages/guile.scm | 40 +++++++++++++++++++++++++++++++++++++++- guix/git.scm | 3 +++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index 9d58c8d4cd..b120f3eefe 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -816,6 +816,44 @@ (define-public guile-git (sha256 (base32 "11a51acibwi2hpaygmrpn6nwbr4lqalc87ihrgj3mhz6swbsk9n7")) + (modules '((guix build utils))) + (snippet + '(begin + (substitute* "git/settings.scm" + (("set-user-agent!))") + (string-append "set-user-agent!\n" + " set-owner-validation!))")) + (("GIT_OPT_ENABLE_STRICT_OBJECT_CREATION 14)" m) + (string-append m "\n" "(define GIT_OPT_ENABLE_STRICT_SYMBOLIC_REF_CREATION 15)")) + + (("(GIT_OPT_SET_SSL_CIPHERS).*" _ m) + (string-append m " 16)\n")) + + (("(GIT_OPT_GET_USER_AGENT).*" _ m) + (string-append m " 17)\n" + "(define GIT_OPT_ENABLE_OFS_DELTA 18)\n" + "(define GIT_OPT_ENABLE_FSYNC_GITDIR 19)\n" + "(define GIT_OPT_GET_WINDOWS_SHAREMODE 20)\n" + "(define GIT_OPT_SET_WINDOWS_SHAREMODE 21)\n" + "(define GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION 22)\n" + "(define GIT_OPT_SET_ALLOCATOR 23)\n" + "(define GIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY 24)\n" + "(define GIT_OPT_GET_PACK_MAX_OBJECTS 25)\n" + "(define GIT_OPT_SET_PACK_MAX_OBJECTS 26)\n" + "(define GIT_OPT_DISABLE_PACK_KEEP_FILE_CHECKS 27)\n" + "(define GIT_OPT_ENABLE_HTTP_EXPECT_CONTINUE 28)\n" + "(define GIT_OPT_GET_MWINDOW_FILE_LIMIT 29)\n" + "(define GIT_OPT_SET_MWINDOW_FILE_LIMIT 30)\n" + "(define GIT_OPT_SET_ODB_PACKED_PRIORITY 31)\n" + "(define GIT_OPT_SET_ODB_LOOSE_PRIORITY 32)\n" + "(define GIT_OPT_GET_EXTENSIONS 33)\n" + "(define GIT_OPT_SET_EXTENSIONS 34)\n" + "(define GIT_OPT_GET_OWNER_VALIDATION 35)\n" + "(define GIT_OPT_SET_OWNER_VALIDATION 36)\n\n" + "(define set-owner-validation!\n" + " (let ((proc (libgit2->procedure* \"git_libgit2_opts\" (list int int))))\n" + " (lambda* (owner-validation)\n" + " (proc GIT_OPT_SET_OWNER_VALIDATION owner-validation))))\n"))))) (patches (search-patches "guile-git-adjust-for-libgit2-1.2.0.patch")))) (build-system gnu-build-system) diff --git a/guix/git.scm b/guix/git.scm index 53e7219c8c..ced6a9c62c 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -23,6 +23,7 @@ (define-module (guix git) #:use-module (git) #:use-module (git object) + #:use-module (git settings) #:use-module (git submodule) #:use-module (guix i18n) #:use-module (guix base32) @@ -463,6 +464,8 @@ (define canonical-ref (repository (if cache-exists? (repository-open cache-directory) (clone/swh-fallback url ref cache-directory)))) + ;; Disable owner validation for local repos see #55399 + (set-owner-validation! 0) ;; Only fetch remote if it has not been cloned just before. (when (and cache-exists? (not (reference-available? repository ref)))