[SERVER-7051] dbshell (mongo/mongo.exe) should read/write a .dbshell file if it fails to open one in the home folder Created: 17/Sep/12  Updated: 10/May/22

Status: Backlog
Project: Core Server
Component/s: Shell
Affects Version/s: 2.0.7, 2.2.0
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Justin Dearing Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Unresolved Votes: 0
Labels: move-sa, neweng, platforms-re-triaged
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Tested on windows 7


Operating System: ALL
Participants:

 Description   

With mongo 2.0.7 on windows do the follwing:
SET HOME= %USERPROFILE% then %HOME% is " C:\users\jdearing"

With mongo 2.2.0 on windows do the follwing:
SET USERPROFILE= %USERPROFILE% then %USERPROFILE% is " C:\users\jdearing"

Note the prepended space in both cases. Now if I run mongo it calls CreateFile on "C:\Users\jdearing\Documents\deleteme\ C:\Users\jdearing\.dbshell" as illustrated by procmon:

9:20:32.8800465 PM mongo.exe 8784 CreateFile C:\Users\jdearing\Documents\deleteme\ C:\Users\jdearing\.dbshell mongo NAME INVALID Desired Access: Generic Read, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: N, ShareMode: Read, Write, AllocationSize: n/a

It doesn't attempt to open a local copy of .dbshell. It probably should.



 Comments   
Comment by Steven Vannelli [ 10/May/22 ]

Moving this ticket to the Backlog and removing the "Backlog" fixVersion as per our latest policy for using fixVersions.

Comment by Justin Dearing [ 17/Sep/12 ]

Excellent point. A warning would be good.

Comment by Scott Hernandez (Inactive) [ 17/Sep/12 ]

If you give it a bad directory as either variable it fails. Do you want it creating files all over the place?

If the correct file can't be open/created then it should not be created in your working directory. We could print a warning maybe...

Generated at Thu Feb 08 03:13:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.