Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 540728 - net-misc/netifrc: macchanger.sh invokes macchanger without the required -m parameter
Summary: net-misc/netifrc: macchanger.sh invokes macchanger without the required -m pa...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: netifrc Team
URL:
Whiteboard: netifrc:macchanger
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-20 07:09 UTC by kfm
Modified: 2016-10-26 22:55 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
netifrc-0.2.2-macchanger-fix.patch (netifrc-0.2.2-macchanger-fix.patch,1.45 KB, patch)
2015-02-20 07:31 UTC, kfm
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description kfm 2015-02-20 07:09:55 UTC
I do not use the the MAC changing feature but discovered this through assisting somebody affected. Invoking macchanger like so:

# macchanger <mac> <interface>

... will always result in the following error:

[ERROR] Set device name: No such device

This holds true for both 1.6.0 and 1.7.0 - the only versions available in portage.

The correct syntax is as follows:

# macchanger -m <mac> <interface>

I also spent time independently discovering that the sed expression to capture the newly assigned MAC address is broken, resulting in macchanger.sh falsely concluding that the operation failed. That was before I discovered bug 504458 which is marked as RESOLVED/FIXED and, thus, failed to show up in a standard bugzilla search.

It is not helpful for bugs to be resolved and close where, in reality, the current stable keyworded versions of a given package remain defective. Ergo, while on the subject of macchanger.sh being broken, I would point out that bug 504458 was 'resolved' in April 2014, yet netifrc-0.2.2 - the current stable version - remains broken to the present day.

For that matter, the code in question seems brittle. The purpose of capturing the new MAC is purely cosmetic as only a single einfo statement will subsequently use it. I would suggest that the exit status be tested instead.
Comment 1 kfm 2015-02-20 07:31:53 UTC
Created attachment 397028 [details, diff]
netifrc-0.2.2-macchanger-fix.patch

A patch for netifrc-0.2.2 that addresses both bug 540728 and bug 504458. It uses the exit status to determine whether macchanger has failed, as opposed to the parsed output.
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2016-10-24 23:16:59 UTC
[master edd5210] net/macchanger: support newer macchanger tool.
 1 file changed, 13 insertions(+), 13 deletions(-)
Comment 3 kfm 2016-10-26 22:55:42 UTC
Thanks, Robin.