!100 [sync] PR-99: Modify parameter in backport-CVE-2022-23521-attr-fix-silently-splitting-up-lines-longer-than-204.patch

From: @openeuler-sync-bot 
Reviewed-by: @openeuler-basic 
Signed-off-by: @openeuler-basic
This commit is contained in:
openeuler-ci-bot 2023-01-31 06:28:48 +00:00 committed by Gitee
commit d7f80d1e6d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 9 additions and 10 deletions

View File

@ -51,7 +51,7 @@ index a9f7063cfc..41657479ff 100644
+ while (strbuf_getline(&buf, fp) != EOF) { + while (strbuf_getline(&buf, fp) != EOF) {
+ if (!lineno && starts_with(buf.buf, utf8_bom)) + if (!lineno && starts_with(buf.buf, utf8_bom))
+ strbuf_remove(&buf, 0, strlen(utf8_bom)); + strbuf_remove(&buf, 0, strlen(utf8_bom));
+ handle_attr_line(res, buf.buf, path, ++lineno, macro_ok); + handle_attr_line(res, buf.buf, path, ++lineno, flags);
} }
+ +
fclose(fp); fclose(fp);

View File

@ -45,7 +45,7 @@ index 38ecd2fff3..f9316d14ba 100644
if (flags & READ_ATTR_NOFOLLOW) if (flags & READ_ATTR_NOFOLLOW)
fd = open_nofollow(path, O_RDONLY); fd = open_nofollow(path, O_RDONLY);
@@ -725,12 +725,22 @@ static struct attr_stack *read_attr_from_file(const char *path, unsigned flags) @@ -725,6 +725,16 @@ static struct attr_stack *read_attr_from_file(const char *path, unsigned flags)
return NULL; return NULL;
} }
fp = xfdopen(fd, "r"); fp = xfdopen(fd, "r");
@ -62,13 +62,6 @@ index 38ecd2fff3..f9316d14ba 100644
CALLOC_ARRAY(res, 1); CALLOC_ARRAY(res, 1);
while (strbuf_getline(&buf, fp) != EOF) { while (strbuf_getline(&buf, fp) != EOF) {
if (!lineno && starts_with(buf.buf, utf8_bom))
strbuf_remove(&buf, 0, strlen(utf8_bom));
- handle_attr_line(res, buf.buf, path, ++lineno, macro_ok);
+ handle_attr_line(res, buf.buf, path, ++lineno, flags);
}
fclose(fp);
@@ -730,13 +745,18 @@ static struct attr_stack *read_attr_from_index(const struct index_state *istate, @@ -730,13 +745,18 @@ static struct attr_stack *read_attr_from_index(const struct index_state *istate,
struct attr_stack *res; struct attr_stack *res;
char *buf, *sp; char *buf, *sp;

View File

@ -1,7 +1,7 @@
%global gitexecdir %{_libexecdir}/git-core %global gitexecdir %{_libexecdir}/git-core
Name: git Name: git
Version: 2.33.0 Version: 2.33.0
Release: 7 Release: 8
Summary: A popular and widely used Version Control System Summary: A popular and widely used Version Control System
License: GPLv2+ or LGPLv2.1 License: GPLv2+ or LGPLv2.1
URL: https://git-scm.com/ URL: https://git-scm.com/
@ -331,6 +331,12 @@ make %{?_smp_mflags} test
%{_mandir}/man7/git*.7.* %{_mandir}/man7/git*.7.*
%changelog %changelog
* Tue Jan 31 2023 fuanan <fuanan3@h-partners.com> - 2.33.0-8
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:Modify parameter in backport-CVE-2022-23521-attr-fix-silently-splitting-up-lines-longer-than-204.patch
* Sat Jan 28 2023 fuanan <fuanan3@h-partners.com> - 2.33.0-7 * Sat Jan 28 2023 fuanan <fuanan3@h-partners.com> - 2.33.0-7
- Type:CVE - Type:CVE
- ID:CVE-2022-41953 - ID:CVE-2022-41953