Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 889922

Summary: net-misc/netifrc: adapt macchanger.sh to look in /usr/bin (was: net-analyzer/macchanger-1.7.0_p5_p4 -> p5_p4-r1 moves /sbin/macchanger and/or link needed for netifrc script)
Product: Gentoo Linux Reporter: 7e3
Component: Current packagesAssignee: netifrc Team <netifrc>
Status: RESOLVED FIXED    
Severity: normal CC: 7e3, netmon, robbat2, sam, vivo75
Priority: Normal Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=886121
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 906089    
Bug Blocks:    
Attachments: possible patch

Description 7e3 2023-01-06 07:06:53 UTC
Seemingly from net-analyzer/macchanger-1.7.0_p5_p4 to net-analyzer/macchanger-1.7.0_p5_p4-r1 relocated binary from /sbin/macchanger to /usr/bin/macchanger (previously a softlink back to sbin) which stops the netifrc /lib/netifrc/net/macchanger.sh script from working which stops netifrc starting/restarting interface

Reproducible: Always

Steps to Reproduce:
1.Restart/start network interface using netifrc script (net-misc/netifrc 0.7.3)
2.macchanger syntax in /etc/conf.d/net e.g:mac_wlpXsX="random-ending"
3.Using latest macchanger version 1.7.0_p5_p4-r1
Actual Results:  
Rather than macchanger being executed via requisite config in /etc/conf.d/net it gives an error suggesting install macchanger and fails to start/restart interface

Error 1:
"Jan  6 12:00:00 localhost /etc/init.d/net.wlpXsX[10001]: For changing MAC addresses, emerge net-analyzer/macchanger"

and
Error 2:
"Jan  6 12:00:01 localhost /etc/init.d/net.wlpXsX[10003]: ERROR: net.wlpXsX failed to start"

Expected Results:  
netifrc script to restart network interface while using macchanger functionality requested in config of /etc/conf.d/net

netifrc macchanger.sh script either needs to point to /usr/bin/macchanger rather than /sbin/macchanger (twice in script, one producing error above) or a link has to be made from /sbin/macchanger to /usr/bin/macchanger (probably not likely as it was moved out of 'sbin' for a reason?) or install location change
Comment 1 7e3 2023-01-06 07:41:22 UTC
Created attachment 847622 [details, diff]
possible patch

Possible patch to /lib/netifrc/net/macchanger.sh
Comment 2 Larry the Git Cow gentoo-dev 2023-01-06 08:00:24 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=492cbcf30217641a3625cbf8c53e00c27ae0c369

commit 492cbcf30217641a3625cbf8c53e00c27ae0c369
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-01-06 07:59:36 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-01-06 08:00:01 +0000

    net-analyzer/macchanger: add USE=split-usr for netifrc
    
    Fixes: 955b84bad9b4a6003e132afd18b557215534eb73
    Bug: https://bugs.gentoo.org/889922
    Bug: https://bugs.gentoo.org/886121
    Signed-off-by: Sam James <sam@gentoo.org>

 ...7.0_p5_p4-r1.ebuild => macchanger-1.7.0_p5_p4-r2.ebuild} | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
Comment 3 Francesco Riosa 2023-01-07 11:03:47 UTC
Additionally the package fail to emerge in merged usr with the following error message:

* Package 'net-analyzer/macchanger-1.7.0_p5_p4-r2' has internal
* collisions between non-identical files (located in separate
* directories in the installation image (${D}) corresponding to merged
* directories in the target filesystem (${ROOT})):
*
*         /usr/bin/macchanger
*                 /sbin/macchanger
*                 /usr/bin/macchanger
*                         Differences: type, mode
*
* Package 'net-analyzer/macchanger-1.7.0_p5_p4-r2' NOT merged due to
* internal collisions between non-identical files. If necessary, refer
* to your elog messages for the whole content of the above message.
*
* The following package has failed to build, install, or execute postinst:
*
*  (net-analyzer/macchanger-1.7.0_p5_p4-r2:0/0::gentoo, ebuild scheduled for merge), Log file:
*   '/var/log/portage/build/net-analyzer/macchanger-1.7.0_p5_p4-r2:20230107-092712.log.gz'
*
* After world updates, it is important to remove obsolete packages with
* emerge --depclean. Refer to `man emerge` for more information.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-01-07 11:06:21 UTC
Sorry, right, I'll fix that bit again.
Comment 5 Larry the Git Cow gentoo-dev 2023-01-15 01:53:51 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=bd50c2ce076f2a6a5b0f884287a7940cd29cc6db

commit bd50c2ce076f2a6a5b0f884287a7940cd29cc6db
Author:     7e3f <122086774+7e3f@users.noreply.github.com>
AuthorDate: 2023-01-06 10:20:09 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-01-15 01:52:46 +0000

    net/macchanger.sh: Update path to macchanger to /usr
    
    Proposing changes in diff from bug #889922, net-analyzer/macchanger-1.7.0_p5_p4
    to net-analyzer/macchanger-1.7.0_p5_p4-r1 changed softlink and binary location due
    to #886121.
    
    There was a temporary tidy up in net-analyzer/macchanger-1.7.0_p5_p4-r2, but
    proposing macchanger.sh change to allow netifrc to work with macchanger
    binary location.
    
    Bug: https://bugs.gentoo.org/886121
    Bug: https://bugs.gentoo.org/889922
    Closes: https://github.com/gentoo/netifrc/pull/42
    Signed-off-by: Sam James <sam@gentoo.org>

 net/macchanger.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-01-15 01:57:25 UTC
(In reply to Francesco Riosa from comment #3)
> Additionally the package fail to emerge in merged usr with the following
> error message:
>

I can't reproduce this. Please include the full build.log. If you're on a merged-usr system, please make sure that split-usr is off and masked (the profiles do this).
Comment 7 Larry the Git Cow gentoo-dev 2023-04-17 04:41:43 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=04e95bd55dcb4d638c5b8814c994904308926598

commit 04e95bd55dcb4d638c5b8814c994904308926598
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-04-17 04:39:50 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-04-17 04:41:25 +0000

    net-misc/netifrc: add 0.7.4
    
    Closes: https://bugs.gentoo.org/904422
    Closes: https://bugs.gentoo.org/893290
    Closes: https://bugs.gentoo.org/890238
    Closes: https://bugs.gentoo.org/889922
    Signed-off-by: Sam James <sam@gentoo.org>

 net-misc/netifrc/Manifest             |  1 +
 net-misc/netifrc/netifrc-0.7.4.ebuild | 74 +++++++++++++++++++++++++++++++++++
 2 files changed, 75 insertions(+)