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
|
||||
if tz_info.st_nlink > 1:
|
||||
p = subprocess.Popen(['find', '/usr/share/zoneinfo',
|
||||
'-inum', str(tz_info.st_ino)],
|
||||
stdout=subprocess.PIPE)
|
||||
'-inum', str(tz_info.st_ino),
|
||||
'-print', '-quit'],
|
||||
stdout=subprocess.PIPE)
|
||||
tz_path = p.communicate()[0].strip()
|
||||
return tz_path.replace('/usr/share/zoneinfo/', '')
|
||||
return None
|
||||
|
Loading…
Reference in New Issue
Block a user