[Rpm-maint] [rpm-software-management/rpm] %defattr(644, root, root, 755) -> %_defaultdocdir gets perm 644 (#162)

2017-02-20 Thread Dominique Leuenberger
There seems to be a weird regression in rpm 4.13.

If a package contains

```
%files
%defattr*644,root,root,755)
%doc README
```

then the file README is copied to %{_defaultdocdir}/%{name} as expected, but 
said directory is assigned permission 644 (instead of 755). This used to work 
correct with rpm 4.12

rpm 4.12:
```
rpm -qlvp test-0-0.x86_64.rpm
drwxr-xr-x2 rootroot0 Feb 20 23:13 
/usr/share/doc/packages/test
-rw-r--r--1 rootroot   11 Feb 20 23:13 
/usr/share/doc/packages/test/dummy
```
rpm 4.13:
```
rpm -qlvp test-0-0.x86_64.rpm 
drw-r--r--2 rootroot0 Feb 20 23:19 
/usr/share/doc/packages/test
-rw-r--r--1 rootroot   11 Feb 20 23:19 
/usr/share/doc/packages/test/dummy
```
 


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/162___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Bounds check strings to print correctly in %trace mode. (#160)

2017-02-20 Thread Peter Jones
It's not completely clear to me why the Jenkins check here failed, but it looks 
like it has to do with Jenkins, not with this patch.  Given that 
https://github.com/rpm-software-management/rpm/pull/161 worked, I think this is 
fine.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/160#issuecomment-281162118___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] Bounds check strings to print correctly in %trace mode. (#160)

2017-02-20 Thread Peter Jones
In %trace mode, evaluating a macro which is undefined causes an invalid
read of 1 byte when searching for the end of the string:

trillian:~$ valgrind rpmspec --eval '%trace' --eval '%{?myUndefinedMacro}'
==21534== Memcheck, a memory error detector
==21534== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==21534== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==21534== Command: rpmspec --trace --eval %{?myUndefinedMacro}
==21534==

  1>   %{?myUndefinedMacro}^==21534== Invalid read of size 1
==21534==at 0x55018D4: printMacro (macro.c:296)
==21534==by 0x5502DFC: expandMacro (macro.c:1077)
==21534==by 0x5503710: doExpandMacros (macro.c:1280)
==21534==by 0x5504AB6: rpmExpand (macro.c:1629)
==21534==by 0x508F59A: rpmcliAllArgCallback (poptALL.c:120)
==21534==by 0x6DAF71D: invokeCallbacksOPTION (popt.c:156)
==21534==by 0x6DAF75B: invokeCallbacksOPTION (popt.c:139)
==21534==by 0x6DB1428: poptGetNextOpt (popt.c:1515)
==21534==by 0x508F912: rpmcliInit (poptALL.c:302)
==21534==by 0x1095B2: main (rpmspec.c:63)
==21534==  Address 0x8a010f3 is 0 bytes after a block of size 19 alloc'd
==21534==at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
==21534==by 0x5507C17: rmalloc (rpmmalloc.c:44)
==21534==by 0x5502788: expandMacro (macro.c:927)
==21534==by 0x5503710: doExpandMacros (macro.c:1280)
==21534==by 0x5504AB6: rpmExpand (macro.c:1629)
==21534==by 0x508F59A: rpmcliAllArgCallback (poptALL.c:120)
==21534==by 0x6DAF71D: invokeCallbacksOPTION (popt.c:156)
==21534==by 0x6DAF75B: invokeCallbacksOPTION (popt.c:139)
==21534==by 0x6DB1428: poptGetNextOpt (popt.c:1515)
==21534==by 0x508F912: rpmcliInit (poptALL.c:302)
==21534==by 0x1095B2: main (rpmspec.c:63)
==21534==

  1>   %{?_transaction_color}^
  1>   %{?_prefer_color}^
  1>   %{_netsharedpath}^
  1>   %{_install_langs}^
==21534==
==21534== HEAP SUMMARY:
==21534== in use at exit: 7,183 bytes in 71 blocks
==21534==   total heap usage: 7,811 allocs, 7,740 frees, 3,500,361 bytes 
allocated
==21534==
==21534== LEAK SUMMARY:
==21534==definitely lost: 19 bytes in 1 blocks
==21534==indirectly lost: 0 bytes in 0 blocks
==21534==  possibly lost: 0 bytes in 0 blocks
==21534==still reachable: 7,164 bytes in 70 blocks
==21534== suppressed: 0 bytes in 0 blocks
==21534== Rerun with --leak-check=full to see details of leaked memory
==21534==
==21534== For counts of detected and suppressed errors, rerun with: -v
==21534== ERROR SUMMARY: 5 errors from 1 contexts (suppressed: 0 from 0)
trillian:~$

This can easily be avoided by checking the first byte as well as the
second for our sentinal value (NUL).

Signed-off-by: Peter Jones 
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/160

-- Commit Summary --

  * Bounds check strings to print correctly in %trace mode.

-- File Changes --

M rpmio/macro.c (2)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/160.patch
https://github.com/rpm-software-management/rpm/pull/160.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/160
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: Do-what-I-mean semantics for macros in spec comments (#158)

2017-02-20 Thread Vít Ondruch
> There's a certain difference between build-time scriptlets and install-time 
> scriptlets, please try to be specific which ones you're talking about.

Not sure what you mean? Is that because you can choose interpreter of the 
install time scripts while you can't do it for build time scripts?

Either way, I don't see this relevant for the first approximation, e.g. first 
case to solve is expansion of the macros outside of scriptlets ... and 
changelog actually, since there should not be expansion at all IMO.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/158#issuecomment-281021477___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint