Closed
Bug 601806
Opened 15 years ago
Closed 15 years ago
Make it less easy to divulge the schedulerdb password/improve cancellator.py
Categories
(Release Engineering :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: lsblakk, Assigned: bear)
Details
Attachments
(1 file, 3 obsolete files)
|
3.18 KB,
patch
|
catlee
:
review+
bear
:
checked-in+
|
Details | Diff | Splinter Review |
It's been leaked a couple of times now because we use it in the cancellator command. This can end up in wikis, bugs, irc channels too easily. It seems like it would make the password safer if it was not part of the cancellator command but instead cancellator prompted for it, or read from file on the master.
Comment 1•15 years ago
|
||
i think each master has a file, passwords.py, with a variable "BBDB_URL". Could we install cancellator as a file in the master directory and do
from passwords import BBDB_URL
| Assignee | ||
Comment 2•15 years ago
|
||
nothing fancy - just add a step to the loading of command line option parsing to populate a defaults dictionary with the contents of a config file.
the config file is brute-force parsed for lines that are "option=value" formatted.
Comment 3•15 years ago
|
||
(In reply to comment #3)
> It's been leaked a couple of times now because we use it in the cancellator
> command. This can end up in wikis, bugs, irc channels too easily. It seems
> like it would make the password safer if it was not part of the cancellator
> command but instead cancellator prompted for it, or read from file on the
> master.
+1
(I also leaked it once!)
OS: Mac OS X → All
| Assignee | ||
Updated•15 years ago
|
Attachment #480919 -
Flags: review?(bhearsum)
Comment 5•15 years ago
|
||
Comment on attachment 480919 [details] [diff] [review]
modify cancellator.py to load option defaults from a config file
Why not use ConfigParser? Why are you deleting the found = True line?
| Assignee | ||
Comment 6•15 years ago
|
||
I wanted to avoid ConfigParser until it is shown that a more complicated parsing requirement is present. Getting default values for ConfigParser via a file is not, afaik, an easy task and right now we only need the password.
I removed the found=True from outside of the loop because it's immediately overwritten just at the top of the loop and to me that is wrong. If the loop type changes to have the possibility of not being entered then it can go back - but it will always be run once so variable instantiation should be at the top of the loop IMO
Comment 7•15 years ago
|
||
can't you set the defaults by passing in a dictionary of defaults into the configparser?
| Assignee | ||
Comment 8•15 years ago
|
||
sure can - I even have helper code that does that automagically for my personal projects.
but this was someone else's code and I didn't know all of the params so I wanted to get the default value from a file and not get too fancy for a bug fix.
Comment 9•15 years ago
|
||
(In reply to comment #6)
> I wanted to avoid ConfigParser until it is shown that a more complicated
> parsing requirement is present. Getting default values for ConfigParser via a
> file is not, afaik, an easy task and right now we only need the password.
Ah, fair enough. r=me.
Updated•15 years ago
|
Attachment #480919 -
Flags: review?(bhearsum) → review+
| Assignee | ||
Updated•15 years ago
|
Attachment #480919 -
Flags: review?(catlee)
Comment 10•15 years ago
|
||
Comment on attachment 480919 [details] [diff] [review]
modify cancellator.py to load option defaults from a config file
Pretty sure that you need to expand the ~ in _config_file with os.path.expanduser prior using it as a path name.
You've also got an extra parser.add_option line that appears to be doing nothing.
I find parser.set_defaults(...) cleaner than setting a default per add_option call. Maybe parser.set_defaults(**defaults) will work?
Attachment #480919 -
Flags: review?(catlee) → review-
| Assignee | ||
Comment 11•15 years ago
|
||
(In reply to comment #10)
> Comment on attachment 480919 [details] [diff] [review]
> modify cancellator.py to load option defaults from a config file
>
> Pretty sure that you need to expand the ~ in _config_file with
> os.path.expanduser prior using it as a path name.
>
> You've also got an extra parser.add_option line that appears to be doing
> nothing.
oops - that's what I get for doing whitespace cleanup *after* testing
> I find parser.set_defaults(...) cleaner than setting a default per add_option
> call. Maybe parser.set_defaults(**defaults) will work?
The reason I by habit use default per add_option is that in my personal library I actually have an outside dictionary that stores everything needed for the options and then call a helper routine to build the parser. I'll try the set_defaults() call given that your not using my helper libs :)
| Assignee | ||
Comment 12•15 years ago
|
||
changed patch to use set_defaults(), removed errant add_option and added os.path.abspath() to convert ~/ to full path
Attachment #480919 -
Attachment is obsolete: true
Attachment #483284 -
Flags: review?(catlee)
| Assignee | ||
Comment 13•15 years ago
|
||
oh poo - during dinner it hit me: it's os.path.expanduser() not abspath()
| Assignee | ||
Comment 14•15 years ago
|
||
/me writes on chalkboard...
os.path.expanduser() os.path.expanduser() os.path.expanduser() os.path.expanduser() os.path.expanduser() os.path.expanduser() os.path.expanduser() os.path.expanduser() os.path.expanduser() os.path.expanduser() os.path.expanduser() os.path.expanduser() os.path.expanduser() os.path.expanduser() os.path.expanduser() os.path.expanduser() os.path.expanduser() os.path.expanduser()
Attachment #483284 -
Attachment is obsolete: true
Attachment #483380 -
Flags: review?(catlee)
Attachment #483284 -
Flags: review?(catlee)
Comment 15•15 years ago
|
||
Comment on attachment 483380 [details] [diff] [review]
modify cancellator.py to load option defaults from a config file
>+ if os.path.isfile(os.path.expanduser(_config_file)):
>+ for line in open(_config_file, 'r').readlines():
open() needs to be using the expanded path too.
Attachment #483380 -
Flags: review?(catlee) → review-
| Assignee | ||
Comment 16•15 years ago
|
||
apologies for 1) being dense and 2) lagging in making this simple change
Attachment #487548 -
Flags: review?(catlee)
| Assignee | ||
Updated•15 years ago
|
Attachment #483380 -
Attachment is obsolete: true
Updated•15 years ago
|
Attachment #487548 -
Flags: review?(catlee) → review+
| Assignee | ||
Comment 17•15 years ago
|
||
Comment on attachment 487548 [details] [diff] [review]
modify cancellator.py to load option defaults from a config file
buildbot-related/cancellator.py
committed changeset 22:c6985e4e645b
Attachment #487548 -
Flags: checked-in+
| Assignee | ||
Comment 18•15 years ago
|
||
production-master02 updated (after fixing two glitches found after doing sanity checks)
marking as closed
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Comment 19•15 years ago
|
||
Fixed paths to older masters and added pm03 in
http://hg.mozilla.org/build/braindump/rev/e18c6225fcbd
Updated pm02.
Updated•12 years ago
|
Product: mozilla.org → Release Engineering
You need to log in
before you can comment on or make changes to this bug.
Description
•