Skip to content

Commit dd8e65a

Browse files
Merge pull request #134 from timvaillancourt/mongodump_no_cmdline_passwd
1.0.2: Warn users if their password is on the mongodump command line (mongodump too old)
2 parents b919328 + 803ec9d commit dd8e65a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

mongodb_consistent_backup/Backup/Mongodump/Mongodump.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def choose_compression(self):
4747
if self.compression() == 'auto':
4848
logging.info("Mongodump binary supports gzip compression, auto-enabling gzip compression")
4949
self.compression('gzip')
50-
elif self.compression() == 'gzip':
50+
elif self.compression() == 'gzip':
5151
raise OperationError("mongodump gzip compression requested on binary that does not support gzip!")
5252

5353
def can_gzip(self):

mongodb_consistent_backup/Backup/Mongodump/MongodumpThread.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ def mongodump_cmd(self):
116116
mongodump_flags.extend(["-u", self.user, "-p", '""'])
117117
self.do_stdin_passwd = True
118118
else:
119+
logging.warning("Mongodump is too old to set password securely! Upgrade to mongodump >= 3.2.0 to resolve this")
119120
mongodump_flags.extend(["-u", self.user, "-p", self.password])
120121
mongodump_cmd.extend(mongodump_flags)
121122
return mongodump_cmd

0 commit comments

Comments
 (0)