autoupdate: print policy warning when disabling

It may be a violation of the user's IT policy to disable automatic
updates because of the security implications of an out-of-date system.
Print a warning when the user does this.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
This commit is contained in:
Matthew Johnson
2018-07-13 15:56:19 -07:00
parent c441ae6b33
commit 076cd0a73d
+7
View File
@@ -81,6 +81,12 @@ err:
return false;
}
static void policy_warn(void)
{
fprintf(stderr, "Warning: disabling automatic updates may take you "
"out of compliance with your IT policy\n\n");
}
int autoupdate_main(int argc, char **argv)
{
if (!parse_options(argc, argv)) {
@@ -103,6 +109,7 @@ int autoupdate_main(int argc, char **argv)
} else if (disable) {
int rc;
check_root();
policy_warn();
fprintf(stderr, "Running systemctl to disable updates\n");
rc = system("/usr/bin/systemctl mask --now swupd-update.service swupd-update.timer > /dev/null");
if (rc != -1) {