Permalink
Browse files

Exclude groups that cant be correct for cups group

  • Loading branch information...
simoncadman committed Feb 23, 2014
1 parent 8408547 commit 505988fa3c7ab5526721d57cd5b9c148fa0b39f8
Showing with 19 additions and 9 deletions.
  1. +1 −1 backend.py
  2. +11 −1 ccputils.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 upgrade.py
View
@@ -22,7 +22,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140223 171747"
+ CCPVersion = "20140223 173441"
print "CUPS Cloud Print CUPS Backend Version " + CCPVersion
sys.exit(0)
View
@@ -98,11 +98,21 @@ def which(program):
which = staticmethod(which)
def GetLPID(default='lp', alternative='cups', useFiles=True):
+ blacklistedGroups = [ 'adm', 'wheel', 'root' ]
+ blacklistedGroupIds = []
+ for group in blacklistedGroups:
+ try:
+ blacklistedGroupIds.append( grp.getgrnam(group).gr_gid )
+ except:
+ logging.debug("Group " + group + " not found" )
+ pass
+
if useFiles:
# check files in order
for cupsConfigFile in [ '/var/log/cups/access_log', '/etc/cups/ppd', '/usr/local/etc/cups/ppd' ]:
if os.path.exists(cupsConfigFile):
- return os.stat(cupsConfigFile).st_gid
+ if os.stat(cupsConfigFile).st_gid not in blacklistedGroupIds:
+ return os.stat(cupsConfigFile).st_gid
# try lp first, then cups
lpgrp = None
View
@@ -22,7 +22,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140223 171747"
+ CCPVersion = "20140223 173441"
print "CUPS Cloud Print Delete Account Script Version " + CCPVersion
sys.exit(0)
View
@@ -20,7 +20,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140223 171747"
+ CCPVersion = "20140223 173441"
print "CUPS Cloud Print Dynamic PPD Generator Version " + CCPVersion
sys.exit(0)
View
@@ -26,7 +26,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140223 171747"
+ CCPVersion = "20140223 173441"
print "CUPS Cloud Print Printer Lister Version " + CCPVersion
sys.exit(0)
View
@@ -22,7 +22,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140223 171747"
+ CCPVersion = "20140223 173441"
print "CUPS Cloud Print Printer Drive 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 = "20140223 171747"
+ CCPVersion = "20140223 173441"
print "CUPS Cloud Print Issue Reporting Script Version " + CCPVersion
sys.exit(0)
View
@@ -22,7 +22,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140223 171747"
+ CCPVersion = "20140223 173441"
print "CUPS Cloud Print Setup Script Version " + CCPVersion
sys.exit(0)
View
@@ -34,7 +34,7 @@
printerItem = Printer(requestors)
# line below is replaced on commit
- CCPVersion = "20140223 171747"
+ CCPVersion = "20140223 173441"
if len(sys.argv) == 2 and sys.argv[1] == 'version':
print "CUPS Cloud Print Upgrade Script Version " + CCPVersion

0 comments on commit 505988f

Please sign in to comment.