[SERVER-2673] repair creates a directory with dollarsign in its name Created: 03/Mar/11  Updated: 12/Jul/16  Resolved: 12/Sep/11

Status: Closed
Project: Core Server
Component/s: Admin
Affects Version/s: None
Fix Version/s: 2.1.0

Type: Bug Priority: Minor - P4
Reporter: Richard Kreuter (Inactive) Assignee: Mathias Stearn
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

The repair command creates a directory whose name starts with a dollarsign (e.g., $tmp_repairDatabase_0), which is a Unix shell metacharacter. In case an operator wants to get rid of that directory for some reason (e.g., a failed repair or something), the consequences of failing to escape or quote that dollarsign can be maximally bad, e.g.,

rm -r ./$tmp_repairDatabase_0 # will blow away the contents of cwd
rm -r $tmp_repairDatabase_0/ # will blow away the entire file system

Ideally, no filename should ever include shell metacharacters. A trivial fix that ought to suffice would be to change the repair directory's name to start with something like an underscore.



 Comments   
Comment by auto [ 12/Sep/11 ]

Author:

{u'login': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: Change repair path not to include $ SERVER-2673
Branch: master
https://github.com/mongodb/mongo/commit/7f12a2f1cead70815e2ca3a153c56daa693336be

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