Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 99418 - dispatch-conf truncate config file when i type q in sdfiff
Summary: dispatch-conf truncate config file when i type q in sdfiff
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-18 04:46 UTC by Xuefer
Modified: 2005-12-07 20:21 UTC (History)
0 users

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


Attachments
Catches error code of 'merge' command (dispatch-conf_failed_merge.patch,754 bytes, patch)
2005-07-18 05:19 UTC, Jason Stubbs (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.