Accepting request 94123 from home:olta:haiku-admin
Add cgit-fix-more-read_tree_recursive.diff, this time with 'Changed'-entry. OBS-URL: https://build.opensuse.org/request/show/94123 OBS-URL: https://build.opensuse.org/package/show/devel:tools:scm/cgit?expand=0&rev=11
This commit is contained in:
parent
1932761b62
commit
402f09ab38
54
cgit-fix-more-read_tree_recursive-invocations.diff
Normal file
54
cgit-fix-more-read_tree_recursive-invocations.diff
Normal file
@ -0,0 +1,54 @@
|
||||
--- ui-blob.c
|
||||
+++ ui-blob.c
|
||||
@@ -37,11 +37,14 @@ int cgit_print_file(char *path, const char *head)
|
||||
return -1;
|
||||
type = sha1_object_info(sha1, &size);
|
||||
if(type == OBJ_COMMIT && path) {
|
||||
+ struct pathspec pathspec;
|
||||
commit = lookup_commit_reference(sha1);
|
||||
match_path = path;
|
||||
matched_sha1 = sha1;
|
||||
found_path = 0;
|
||||
- read_tree_recursive(commit->tree, "", 0, 0, paths, walk_tree, NULL);
|
||||
+ init_pathspec(&pathspec, paths);
|
||||
+ read_tree_recursive(commit->tree, "", 0, 0, &pathspec, walk_tree, NULL);
|
||||
+ free_pathspec(&pathspec);
|
||||
if (!found_path)
|
||||
return -1;
|
||||
type = sha1_object_info(sha1, &size);
|
||||
@@ -80,10 +83,13 @@ void cgit_print_blob(const char *hex, char *path, const char *head)
|
||||
type = sha1_object_info(sha1, &size);
|
||||
|
||||
if((!hex) && type == OBJ_COMMIT && path) {
|
||||
+ struct pathspec pathspec;
|
||||
commit = lookup_commit_reference(sha1);
|
||||
match_path = path;
|
||||
matched_sha1 = sha1;
|
||||
- read_tree_recursive(commit->tree, "", 0, 0, paths, walk_tree, NULL);
|
||||
+ init_pathspec(&pathspec, paths);
|
||||
+ read_tree_recursive(commit->tree, "", 0, 0, &pathspec, walk_tree, NULL);
|
||||
+ free_pathspec(&pathspec);
|
||||
type = sha1_object_info(sha1,&size);
|
||||
}
|
||||
|
||||
--- ui-plain.c
|
||||
+++ ui-plain.c
|
||||
@@ -145,6 +145,7 @@ void cgit_print_plain(struct cgit_context *ctx)
|
||||
unsigned char sha1[20];
|
||||
struct commit *commit;
|
||||
const char *paths[] = {ctx->qry.path, NULL};
|
||||
+ struct pathspec pathspec;
|
||||
|
||||
if (!rev)
|
||||
rev = ctx->qry.head;
|
||||
@@ -165,7 +166,9 @@ void cgit_print_plain(struct cgit_context *ctx)
|
||||
}
|
||||
else
|
||||
match_baselen = basedir_len(paths[0]);
|
||||
- read_tree_recursive(commit->tree, "", 0, 0, paths, walk_tree, NULL);
|
||||
+ init_pathspec(&pathspec, paths);
|
||||
+ read_tree_recursive(commit->tree, "", 0, 0, &pathspec, walk_tree, NULL);
|
||||
+ free_pathspec(&pathspec);
|
||||
if (!match)
|
||||
html_status(404, "Not found", 0);
|
||||
else if (match == 2)
|
12
cgit.changes
12
cgit.changes
@ -1,3 +1,15 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Nov 28 14:04:00 CET 2011 - zooey@hirschkaefer.de
|
||||
|
||||
- Add patch cgit-fix-more-read_tree_recursive-invocations.diff:
|
||||
|
||||
There are more incorrect invocations of read_tree_recursive(),
|
||||
one example can be seen when visiting one of the 'plain' links
|
||||
in the tree view (contents of the wrong file are shown).
|
||||
|
||||
This time I did what I should have done last time and checked
|
||||
and adjusted all invocations of read_tree_recursive().
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Nov 22 09:24:35 UTC 2011 - saschpe@suse.de
|
||||
|
||||
|
@ -34,6 +34,7 @@ Patch: cgit-optflags.diff
|
||||
Patch1: cgit-git-1.7.6_build_fix.patch
|
||||
Patch2: cgit-CVE-2011-2711-fix.diff
|
||||
Patch3: cgit-fix-print-tree.diff
|
||||
Patch4: cgit-fix-more-read_tree_recursive-invocations.diff
|
||||
# Requirements for cgit
|
||||
BuildRequires: gnu-crypto libopenssl-devel libzip-devel
|
||||
# Requirements for cgitrc man page generation
|
||||
@ -55,6 +56,7 @@ Authors:
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3
|
||||
%patch4
|
||||
rm -rf git
|
||||
mv git-%{git_version} git
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user