Bug 11484 - rpm 3.0.4 %* not working in macros
rpm 3.0.4 %* not working in macros
Product: Red Hat Raw Hide
Classification: Retired
Component: rpm (Show other bugs)
All Linux
medium Severity high
: ---
: ---
Assigned To: Jeff Johnson
Depends On:
  Show dependency treegraph
Reported: 2000-05-17 12:44 EDT by Stepan Kasal
Modified: 2008-05-01 11:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-05-18 13:41:23 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
bugfix -- grabArgs() cleaned up (4.38 KB, patch)
2000-05-17 12:47 EDT, Stepan Kasal
no flags Details | Diff
bugfix -- this one works, the previous was wrong (4.44 KB, patch)
2000-05-18 13:41 EDT, Stepan Kasal
no flags Details | Diff

  None (edit)
Description Stepan Kasal 2000-05-17 12:44:52 EDT
In construct like
%{?amacro:%{amacro -f}}
the %amacro inside gets %* macro pointing to an uninitialised memory,
ie. %* expands to a garbage.

Though it can be fixed by an assignment like *be='\0',
I decided to clean up whole grabArgs() function in rpm-3.0.4/lib/macro.c

Patch follows, I hope.
Comment 1 Stepan Kasal 2000-05-17 12:47:59 EDT
Created attachment 247 [details]
bugfix -- grabArgs() cleaned up
Comment 2 Jeff Johnson 2000-05-17 13:00:59 EDT
Can you include the defininition of the macro suse_update_config? Thanks.
Comment 3 Stepan Kasal 2000-05-18 03:17:59 EDT
The bug does not depend on macro definition.

%amacro(f) \
  echo %*


%amacro(f) \
   echo %{?*}

should be enough.

Then call

%{?amacro:%{amacro -f}}

The macro %* is always defined but in this situation (macro call isn't
terminated by \n, eg.) the %* replacement text point's to an uninitialised
memory.  This is why the bug is not deterministic.

Please read whole patch--it also deletes several unused variables.
Comment 4 Stepan Kasal 2000-05-18 13:41:59 EDT
Created attachment 255 [details]
bugfix -- this one works, the previous was wrong
Comment 5 Jeff Johnson 2000-06-21 19:33:03 EDT
Fixed in rpm-4.0-0.43 and rpm-3.0.5-0.4. Thanks for the patch, the cleanup
has been overdue for a long time now ...

Note You need to log in before you can comment on or make changes to this bug.