From cf17ee3bbc7074c7336379425932aa9e18c8848217391be8720b59d5bef87d2a Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Wed, 6 Jul 2022 11:25:01 +0000 Subject: [PATCH] Accepting request 984716 from home:gmbr3:Active - Add attr.patch to fix: * Avoid assigning %attr's to symlinks which causes rpmbuild spam * Change perms mask to 07777 to ensure SUID/SGID is copied over - Add lang.patch to support %lang OBS-URL: https://build.opensuse.org/request/show/984716 OBS-URL: https://build.opensuse.org/package/show/Base:System/pesign-obs-integration?expand=0&rev=113 --- attr.patch | 28 +++++++++++++++++++++++ lang.patch | 41 ++++++++++++++++++++++++++++++++++ pesign-obs-integration.changes | 8 +++++++ pesign-obs-integration.spec | 2 ++ 4 files changed, 79 insertions(+) create mode 100644 attr.patch create mode 100644 lang.patch diff --git a/attr.patch b/attr.patch new file mode 100644 index 0000000..e056fe0 --- /dev/null +++ b/attr.patch @@ -0,0 +1,28 @@ +From 118395dd551022faea75debac0dca30515f03949 Mon Sep 17 00:00:00 2001 +From: Callum Farmer +Date: Wed, 22 Jun 2022 14:41:34 +0100 +Subject: [PATCH] Fix %attr issues + +1) Avoid assigning %attr's to symlinks which causes rpmbuild spam +2) Change perms mask to 07777 to ensure SUID/SGID is copied over +--- + pesign-gen-repackage-spec | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/pesign-gen-repackage-spec b/pesign-gen-repackage-spec +index 688c375..e5c961a 100755 +--- a/pesign-gen-repackage-spec ++++ b/pesign-gen-repackage-spec +@@ -416,8 +416,10 @@ sub print_files { + $attrs .= "\%dir "; + utime($f->{mtime}, $f->{mtime}, $path); + } +- $attrs .= sprintf('%%attr(%04o, %s, %s) ', ($f->{mode} & 0777), +- $f->{owner}, $f->{group}); ++ unless (-l "$path") { ++ $attrs .= sprintf('%%attr(%04o, %s, %s) ', ($f->{mode} & 07777), ++ $f->{owner}, $f->{group}); ++ } + if ($f->{flags} & $filetypes{config}) { + $attrs .= "%config "; + my @cfg_attrs; diff --git a/lang.patch b/lang.patch new file mode 100644 index 0000000..8a0f974 --- /dev/null +++ b/lang.patch @@ -0,0 +1,41 @@ +From bce11d8c51c7298887a5c576ba0f577cac80eb5e Mon Sep 17 00:00:00 2001 +From: Callum Farmer +Date: Thu, 23 Jun 2022 13:20:37 +0100 +Subject: [PATCH] Support %lang + +--- + pesign-gen-repackage-spec | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/pesign-gen-repackage-spec b/pesign-gen-repackage-spec +index 688c375..3d1e1d2 100755 +--- a/pesign-gen-repackage-spec ++++ b/pesign-gen-repackage-spec +@@ -166,7 +166,7 @@ sub load_package { + $res{$tag} = query_single($rpm, $tag); + } + my @files; +- my @list = query_array($rpm, qw(filenames fileflags filemodes fileusername filegroupname filesizes filemtimes filelinktos fileverifyflags)); ++ my @list = query_array($rpm, qw(filenames fileflags filemodes fileusername filegroupname filesizes filemtimes filelinktos fileverifyflags filelangs)); + for my $file (@list) { + my $new = { + name => $file->[0], +@@ -178,6 +178,7 @@ sub load_package { + mtime => $file->[6], + target => $file->[7], + verify => $file->[8], ++ lang => $file->[9], + }; + push(@files, $new); + if ($new->{name} =~ /\.ko$/ && S_ISREG($new->{mode})) { +@@ -462,7 +463,9 @@ sub print_files { + if ($verify_attrs) { + $attrs .= "%verify(not $verify_attrs) "; + } +- ++ if ($f->{lang} ne "") { ++ $attrs .= sprintf('%%lang(%s) ', $f->{lang}); ++ } + if ($compress ne "" && + $f->{name} =~ /\.ko$/ && S_ISREG($f->{mode})) { + chmod($f->{mode}, $path); diff --git a/pesign-obs-integration.changes b/pesign-obs-integration.changes index 18e74b4..cd84df0 100644 --- a/pesign-obs-integration.changes +++ b/pesign-obs-integration.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Jun 22 20:02:36 UTC 2022 - Callum Farmer + +- Add attr.patch to fix: + * Avoid assigning %attr's to symlinks which causes rpmbuild spam + * Change perms mask to 07777 to ensure SUID/SGID is copied over +- Add lang.patch to support %lang + ------------------------------------------------------------------- Wed Jun 15 11:13:51 UTC 2022 - gmbr3@opensuse.org diff --git a/pesign-obs-integration.spec b/pesign-obs-integration.spec index 765f83b..51b9d4e 100644 --- a/pesign-obs-integration.spec +++ b/pesign-obs-integration.spec @@ -26,6 +26,8 @@ Group: Development/Tools/Other URL: https://en.opensuse.org/openSUSE:UEFI_Image_File_Sign_Tools Source: %{name}-%{version}.tar.gz Patch: order.patch +Patch1: attr.patch +Patch2: lang.patch BuildRequires: openssl Requires: fipscheck Requires: mozilla-nss-tools