Bug 11484 - rpm 3.0.4 %* not working in macros
Summary: rpm 3.0.4 %* not working in macros
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: rpm (Show other bugs)
(Show other bugs)
Version: 1.0
Hardware: All Linux
medium
high
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-05-17 16:44 UTC by Stepan Kasal
Modified: 2008-05-01 15:37 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-05-18 17:41:23 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
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 16:47 UTC, Stepan Kasal
no flags Details | Diff
bugfix -- this one works, the previous was wrong (4.44 KB, patch)
2000-05-18 17:41 UTC, Stepan Kasal
no flags Details | Diff

Description Stepan Kasal 2000-05-17 16:44:52 UTC
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 16:47:59 UTC
Created attachment 247 [details]
bugfix -- grabArgs() cleaned up

Comment 2 Jeff Johnson 2000-05-17 17:00:59 UTC
Can you include the defininition of the macro suse_update_config? Thanks.

Comment 3 Stepan Kasal 2000-05-18 07:17:59 UTC
The bug does not depend on macro definition.
defining

%amacro(f) \
  echo %*

or

%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 17:41:59 UTC
Created attachment 255 [details]
bugfix -- this one works, the previous was wrong

Comment 5 Jeff Johnson 2000-06-21 23:33:03 UTC
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.