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

Bug 99418

Summary: dispatch-conf truncate config file when i type q in sdfiff
Product: Portage Development Reporter: Xuefer <Xuefer>
Component: ToolsAssignee: Portage Tools Team <tools-portage>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Catches error code of 'merge' command

Description Xuefer 2005-07-18 04:46:43 UTC
i have no idea on how dispatch-conf working internally, but it looks like it's 
not safe for use.

there should be a more safe check to avoid such. any truncate or empty conf 
result by "half operation" of sdiff should be rejected by dispatch-conf, 
although i have no idea if there's a way to do so within the arch of dispatch-
conf.

(btw, there should be more document on what to do if one have problem with it. 
e.g.: how to roll back to exactly same as before the conf is merged)

Reproducible: Always
Steps to Reproduce:
1. emerge -u world
2. dispatch-conf
3. press 'm' to merge
4. when it show and let me merge side by side, press 'q', (ctrl+c seems no 
effect)
5. ls -l /etc/yourconfig, and see it's 0 byte
Actual Results:  
config file is truncated (or be empty)

Expected Results:  
file safely merged
Comment 1 Jason Stubbs (RETIRED) gentoo-dev 2005-07-18 05:19:33 UTC
Created attachment 63691 [details, diff]
Catches error code of 'merge' command

dispatch-conf is ignoring the error code of the merge command and assuming that
all went okay. Catching the error code will fix this problem.

I haven't tested this patch yet, but it should work okay.
Comment 2 Alec Warner (RETIRED) archtester gentoo-dev Security 2005-12-07 20:21:09 UTC
This appears to be merged in...I am not sure when that happened, but I was 
fixing other "we don't check error messages" and noted this was already there.