qubes/app: don't fail on saving qubes.xml when 'qubes' group isn't there
This commit is contained in:
parent
da3eed582b
commit
2a4af124f8
@ -809,8 +809,12 @@ class Qubes(qubes.PropertyHolder):
|
|||||||
lxml.etree.ElementTree(self.__xml__()).write(
|
lxml.etree.ElementTree(self.__xml__()).write(
|
||||||
fh_new, encoding='utf-8', pretty_print=True)
|
fh_new, encoding='utf-8', pretty_print=True)
|
||||||
fh_new.flush()
|
fh_new.flush()
|
||||||
os.chmod(fh_new.name, 0o660)
|
try:
|
||||||
os.chown(fh_new.name, -1, grp.getgrnam('qubes').gr_gid)
|
os.chown(fh_new.name, -1, grp.getgrnam('qubes').gr_gid)
|
||||||
|
os.chmod(fh_new.name, 0o660)
|
||||||
|
except KeyError: # group 'qubes' not found
|
||||||
|
# don't change mode if no 'qubes' group in the system
|
||||||
|
pass
|
||||||
os.rename(fh_new.name, self._store)
|
os.rename(fh_new.name, self._store)
|
||||||
|
|
||||||
# update stored mtime, in case of multiple save() calls without
|
# update stored mtime, in case of multiple save() calls without
|
||||||
|
Loading…
Reference in New Issue
Block a user