1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
| | From 88091a17f8276b03c95837b422adf5b0b7eda79e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Batista?= <nandre@riseup.net>
Date: Thu, 19 May 2022 09:47:36 -0300
Subject: [PATCH] settings: Add 'set-owner-validation!'.
To: guile-git@gitlab.com
* git/settings.scm: (set-owner-validation!): New procedure.
---
git/settings.scm | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/git/settings.scm b/git/settings.scm
index 4621f43..f6857d5 100644
--- a/git/settings.scm
+++ b/git/settings.scm
@@ -20,7 +20,8 @@
(define-module (git settings)
#:use-module (system foreign)
#:use-module (git bindings)
- #:export (set-tls-certificate-locations!
+ #:export (set-owner-validation!
+ set-tls-certificate-locations!
set-user-agent!))
;; 'git_libgit2_opt_t' enum defined in <git2/common.h>.
@@ -62,6 +63,12 @@
(define GIT_OPT_GET_OWNER_VALIDATION 35)
(define GIT_OPT_SET_OWNER_VALIDATION 36)
+(define set-owner-validation!
+ (let ((proc (libgit2->procedure* "git_libgit2_opts" (list int int))))
+ (lambda (owner-validation)
+ "Boolean: enable/disable owner validation checks. See CVE 2022-24765."
+ (proc GIT_OPT_SET_OWNER_VALIDATION (if owner-validation 1 0)))))
+
(define set-tls-certificate-locations!
(let ((proc (libgit2->procedure* "git_libgit2_opts" (list int '* '*))))
(lambda* (directory #:optional file)
--
2.36.0
|