mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-13 08:01:09 +00:00
* manage-credentials: Tighted security by making credentials files and
folder world unreadable.
This commit is contained in:
parent
2446993726
commit
743154a9c8
5
debian/changelog
vendored
5
debian/changelog
vendored
@ -1,6 +1,7 @@
|
|||||||
ubuntu-dev-tools (0.56) jaunty; urgency=low
|
ubuntu-dev-tools (0.56) UNRELEASED; urgency=low
|
||||||
|
|
||||||
* Changes go here.
|
* manage-credentials: Tighted security by making credentials files and
|
||||||
|
folder world unreadable.
|
||||||
|
|
||||||
-- Jonathan Davies <jpds@ubuntu.com> Thu, 15 Jan 2009 12:35:12 +0000
|
-- Jonathan Davies <jpds@ubuntu.com> Thu, 15 Jan 2009 12:35:12 +0000
|
||||||
|
|
||||||
|
@ -101,15 +101,21 @@ def create_credentials(options):
|
|||||||
credentials = launchpad.credentials
|
credentials = launchpad.credentials
|
||||||
|
|
||||||
if options.output:
|
if options.output:
|
||||||
f = file(options.output, "w")
|
filepath = options.output
|
||||||
else:
|
else:
|
||||||
if not os.path.isdir(os.path.expanduser("~/.cache/lp_credentials")):
|
credentialsDir = os.path.expanduser("~/.cache/lp_credentials")
|
||||||
mkdir(os.path.expanduser("~/.cache/lp_credentials/"))
|
if not os.path.isdir(credentialsDir):
|
||||||
filepath = os.path.expanduser("~/.cache/lp_credentials/%s-%s.txt" % \
|
mkdir(credentialsDir)
|
||||||
(options.consumer, str(options.level).lower()))
|
os.chmod(credentialsDir, 0700)
|
||||||
f = file(filepath, "w")
|
filepath = os.path.expanduser("%s/%s-%s.txt" % \
|
||||||
|
(credentialsDir, options.consumer, str(options.level).lower()))
|
||||||
|
|
||||||
|
f = open(filepath, "w")
|
||||||
|
# Make credentials file non-world readable.
|
||||||
|
os.chmod(filepath, 0600)
|
||||||
credentials.save(f)
|
credentials.save(f)
|
||||||
|
f.close()
|
||||||
|
|
||||||
print "Credentials sucessfully written to %s." % filepath
|
print "Credentials sucessfully written to %s." % filepath
|
||||||
|
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user