Permalink
Browse files

Fix permissions of config file to allow updating of access token when…

… printing
  • Loading branch information...
simoncadman committed Jan 26, 2014
1 parent 09842e4 commit 0defe93f98d8d0b995e68bfebf7c9d40e87d0e6f
Showing with 16 additions and 11 deletions.
  1. +2 −2 auth.py
  2. +1 −1 backend.py
  3. +1 −1 deleteaccount.py
  4. +1 −1 dynamicppd.py
  5. +1 −1 listcloudprinters.py
  6. +1 −1 listdrivefiles.py
  7. +1 −1 reportissues.py
  8. +1 −1 setupcloudprint.py
  9. +1 −1 submitjob.py
  10. +6 −1 upgrade.py
View
@@ -89,7 +89,7 @@ def AddAccount(storage, userid=None): # pragma: no cover
# fix permissions
try:
- os.chmod(Auth.config, 0640)
+ os.chmod(Auth.config, 0660)
os.chown(Auth.config, 0, Auth.GetLPID())
except:
sys.stderr.write("DEBUG: Cannot alter file permissions\n")
@@ -156,7 +156,7 @@ def SetupAuth(interactive=False, permissions=['https://www.googleapis.com/auth/c
# fix permissions
if modifiedconfig: # pragma: no cover
try:
- os.chmod(Auth.config, 0640)
+ os.chmod(Auth.config, 0660)
os.chown(Auth.config, 0, Auth.GetLPID())
except:
sys.stderr.write("DEBUG: Cannot alter file permissions\n")
View
@@ -20,7 +20,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140126 213803"
+ CCPVersion = "20140126 215144"
print "CUPS Cloud Print CUPS Backend Version " + CCPVersion
sys.exit(0)
View
@@ -21,7 +21,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140126 213803"
+ CCPVersion = "20140126 215144"
print "CUPS Cloud Print Delete Account Script Version " + CCPVersion
sys.exit(0)
View
@@ -19,7 +19,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140126 213803"
+ CCPVersion = "20140126 215144"
print "CUPS Cloud Print Dynamic PPD Generator Version " + CCPVersion
sys.exit(0)
View
@@ -28,7 +28,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140126 213803"
+ CCPVersion = "20140126 215144"
print "CUPS Cloud Print Printer Lister Version " + CCPVersion
sys.exit(0)
View
@@ -21,7 +21,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140126 213803"
+ CCPVersion = "20140126 215144"
print "CUPS Cloud Print Printer Drive Lister Version " + CCPVersion
sys.exit(0)
View
@@ -19,7 +19,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140126 213803"
+ CCPVersion = "20140126 215144"
print "CUPS Cloud Print Issue Reporting Script Version " + CCPVersion
sys.exit(0)
View
@@ -21,7 +21,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140126 213803"
+ CCPVersion = "20140126 215144"
print "CUPS Cloud Print Setup Script Version " + CCPVersion
sys.exit(0)
View
@@ -29,7 +29,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140126 213803"
+ CCPVersion = "20140126 215144"
print "CUPS Cloud Print Submit Job Version " + CCPVersion
sys.exit(0)
View
@@ -41,7 +41,7 @@
sys.stderr.write("If you are upgrading from version 20131013 or earlier you should be aware that the scripts have moved from /usr/lib/cloudprint-cups to /usr/share/cloudprint-cups\n")
# line below is replaced on commit
-CCPVersion = "20140126 213803"
+CCPVersion = "20140126 215144"
if len(sys.argv) == 2 and sys.argv[1] == 'version':
print "CUPS Cloud Print Upgrade Script Version " + CCPVersion
@@ -57,6 +57,11 @@
cupsprinters = connection.getPrinters()
if os.path.exists(Auth.config):
+ try:
+ os.chmod(Auth.config, 0660)
+ except Exception, e:
+ logging.error("Unable to fix config file permissions: %s", str(e))
+
try:
content_file = open(Auth.config, 'r')
content = content_file.read()

0 comments on commit 0defe93

Please sign in to comment.