Prevent qvm-clock-sync permissions exception
qvm-clock-sync fails with a python subprocess error on line 43 when the `date ... -s ...` fails due to insufficient privileges to set the date. This commit checks to see if the program has effective UID root before attempting to set the date.
This commit is contained in:
parent
b168c4a6d7
commit
65435dce78
@ -20,12 +20,15 @@
|
||||
#
|
||||
#
|
||||
import sys
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
from qubesadmin import Qubes
|
||||
|
||||
def main():
|
||||
|
||||
if os.geteuid() != 0:
|
||||
sys.stderr.write('This program must be run as root to set the date.')
|
||||
sys.exit(1)
|
||||
app = Qubes()
|
||||
clockvm = app.clockvm
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user