Bug 103902 - Going to non-existent directory when selecting files puts minicom into inconstistent state
Summary: Going to non-existent directory when selecting files puts minicom into incons...
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: minicom   
(Show other bugs)
Version: 9
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Eido Inoue
QA Contact: Brock Organ
Depends On:
TreeView+ depends on / blocked
Reported: 2003-09-06 21:02 UTC by David Costanzo
Modified: 2007-04-18 16:57 UTC (History)
0 users

Fixed In Version: 2.00.0-17
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-09-12 21:33:26 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
patch to handle going to a non-existent directory gracefully (2.60 KB, patch)
2003-09-06 23:26 UTC, David Costanzo
no flags Details | Diff

Description David Costanzo 2003-09-06 21:02:59 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312

Description of problem:
When you select a file for upload (CTRL+A - S) you are given a choice of
protocols.  After you select a protocol, you are given a file selction dialog.

One of the options in the file selection dialog is "Goto", which allows you to
select a directory.

If you type in a directory that doesn't exist (for example, if you mistype a
directory that does exist), minicom gets into a bad state where it thinks its in
the non-existent directory.  It will put the non-existent directory in the
"Directory" field and any attempt to walk the directory structure will using the
arrows and space will fail.

You can get minicom back into a good state by changing to a valid directory with
the "Goto" option.

The cause of the bug is file.c:new_filedir() does not check the return value of
chdir.  Likewise, the functions that call new_filedir() set the work_dir global
variable before calling new_fildir, do not check for errors, and do not restore
the old working directory on error.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.CTRL+A - S (for sending files)
2.Select "z-modem"
3.Press G (for goto dialog box)
4.Enter a nonexistent directory, like "/nonexistentdir"


Actual Results:  The working directory changes to the "/nonexistentdir"

Expected Results:  An error message tells you that "/nonexistentdir" does not
exist, and the working directory does not change.

Additional info:

Comment 1 David Costanzo 2003-09-06 23:26:51 UTC
Created attachment 94281 [details]
patch to handle going to a non-existent directory gracefully

This patch checks the return value of chdir and, if non-zero does restors
work_dir to the current working directory.  This patch is careful not to change
the contents of prev_dir when chdir fails.

Comment 2 Eido Inoue 2003-09-12 21:33:26 UTC
thanks again for the patch. are these fixes in minicom 2.1?

Note You need to log in before you can comment on or make changes to this bug.