Fix handling /etc/localtime hardlink
If /etc/localtime in dom0 is a hardlink to zoneinfo file (instead of symlink) and more than one zoneinfo file is hardlinked to this inode, appVMs will get invalid timezone, e.g. "Europe/Warsaw\x0aPoland". Reported by @yaqu, fix provided by @yaqu Fixes QubesOS/qubes-issues#1315
This commit is contained in:
parent
18edf4946c
commit
350e279f4f
@ -1008,8 +1008,9 @@ class QubesVm(object):
|
|||||||
return None
|
return None
|
||||||
if tz_info.st_nlink > 1:
|
if tz_info.st_nlink > 1:
|
||||||
p = subprocess.Popen(['find', '/usr/share/zoneinfo',
|
p = subprocess.Popen(['find', '/usr/share/zoneinfo',
|
||||||
'-inum', str(tz_info.st_ino)],
|
'-inum', str(tz_info.st_ino),
|
||||||
stdout=subprocess.PIPE)
|
'-print', '-quit'],
|
||||||
|
stdout=subprocess.PIPE)
|
||||||
tz_path = p.communicate()[0].strip()
|
tz_path = p.communicate()[0].strip()
|
||||||
return tz_path.replace('/usr/share/zoneinfo/', '')
|
return tz_path.replace('/usr/share/zoneinfo/', '')
|
||||||
return None
|
return None
|
||||||
|
Loading…
Reference in New Issue
Block a user