strlcat(tz_target_path, "/", TZNAME_MAX);
strlcat(tz_target_path, proposed_tz, TZNAME_MAX);
- g_printf("%s\n", tz_target_path);
+ if(strstr(tz_target_path, "../")) {
+
+ g_dbus_method_invocation_return_dbus_error(invoc, "org.freedesktop.timedate1.Error.EBADF", "Provided timezone is invalid.");
+ return FALSE;
+ }
if(!statbuf)
return FALSE;
GDBusMethodInvocation *invoc,
const gchar *greet,
gpointer data) {
- return FALSE;
+
+ g_dbus_method_invocation_return_dbus_error(invoc, "org.freedesktop.timedate1.Error.ENODEV", "Unix RTC must be in UTC.");
+ return TRUE;
}
static gboolean
return ret;
}
+/* Unix time must be in UTC. */
gboolean
our_get_local_rtc() {