Bug 1219419

Summary: system broken after distrobox-export --bin sudo
Product: [openSUSE] openSUSE Aeon Reporter: Marco Trauffler <marco.trauffler>
Component: DistroboxAssignee: Richard Brown <rbrown>
Status: RESOLVED UPSTREAM QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: marco.trauffler
Version: Current   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE Tumbleweed   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Marco Trauffler 2024-01-31 19:17:32 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0
Build Identifier: 

sudo is not working anymore
entering distrobox with --root is not working anymore
in both cases command does not return anymore, memory is incrementing, CPU is working heavily
system must be rebooted within 2 minutes before memory is full!


Reproducible: Didn't try

Steps to Reproduce:
1. create a container with distrobox create --name NAME --image IMAGE --root 
2. enter the container with distrobox enter NAME --root
3. inside the container run: distrobox-export --bin sudo
note: unable to reproduce on my machine because system nearly unusable, hope I do not need to reinstall.
Actual Results:  
I do not know any solution to get sudo working again outside the container
I do not know any solution to enter the container with --root anymore
note: all not --root containers are still working
note: rollback to previous state does not help
what to do as my system gets unusable with above problems

Expected Results:  
behaviour expected: use sudo outside of distrobox
still beeing able to enter distrobox with --root
actual behaviour: 
sudo outside of distrobox hangs and doesn't return anymore. the CPU usage is high and the memory is incrementing until full.
same bahaviour when trying distrobox enter --root
Comment 1 Marco Trauffler 2024-02-05 10:05:23 UTC
problem can be solved be removing /home/user/.local/bin/sudo

anyhow exporting sudo wasn't a good idea i agree, but maybe freezing problem should be addressed anyhow.
Comment 2 Richard Brown 2024-02-05 10:45:59 UTC
(In reply to Marco Trauffler from comment #1)
> problem can be solved be removing /home/user/.local/bin/sudo
> 
> anyhow exporting sudo wasn't a good idea i agree, but maybe freezing problem
> should be addressed anyhow.

I'm glad there's a workaround for the 'problem', but I'd still love to know WHY you'd want to export sudo while using sudo (distrobox --root uses sudo)

My suggestion to distrobox upstream may be to prohibit the exporting of any binaryname that can already be resolved in the users $PATH

Probably should never be exporting stuff that is already available on the host anyhow
Comment 3 Marco Trauffler 2024-02-05 11:14:59 UTC
Hi, I fully agree with your analysis
the reasons were:
- I installed ddrescue in distrobox and wanted to use it from outside distrobox by exporting its bin
- then by mistake I thought that sudo doesn't exist either outside distrobox as used to be in Vanilla distribution, and I exported it as well ;-)
I was however astonished that it had such heavy impact because now sudoing wasn't possible at all.
Took me a while to find that the work around was easy :-(
Anyhow thank you and please note : I am a big fan of your distro!
Regards,
Marco
Comment 4 Richard Brown 2024-02-05 11:21:19 UTC
and I'm a huge fan of this bug :) Just going to need a little time working with distrobox upstream to find a robust way of avoiding such stuff in the future
Comment 5 Richard Brown 2024-02-05 12:25:12 UTC
Exporting stuff that doesn’t need to be exported is bad.. and distrobox should probably stop it
Comment 6 Richard Brown 2024-05-22 10:54:40 UTC
Needs to be fixed upstream in distrobox, not Aeon specific (Though hilariously scary)