SQ snapper: change time type dbus args to signed
authorDavid Disseldorp <ddiss@samba.org>
Thu, 24 Jan 2013 14:42:30 +0000 (15:42 +0100)
committerDavid Disseldorp <ddiss@samba.org>
Mon, 15 Apr 2013 16:15:22 +0000 (18:15 +0200)
Upstream snapper now passes signed values over dbus, the signature must
reflect this on our side.

source3/modules/vfs_snapper.c

index 62eecf7af8c0944d89163e35e5abdb13c987c5ea..f1137872ec3dff2b72252d5f0e6958f54a802d1c 100644 (file)
@@ -28,7 +28,7 @@
 #include "smbd/smbd.h"
 #include "lib/util/tevent_ntstatus.h"
 
-#define SNAPPER_SIG_LIST_SNAPS_RSP "a(uqutussa{ss})"
+#define SNAPPER_SIG_LIST_SNAPS_RSP "a(uquxussa{ss})"
 #define SNAPPER_SIG_LIST_CONFS_RSP "a(ssa{ss})"
 #define SNAPPER_SIG_CREATE_SNAP_RSP "u"
 #define SNAPPER_SIG_DEL_SNAPS_RSP ""
@@ -43,7 +43,7 @@ struct snapper_snap {
        uint32_t id;
        uint16_t type;
        uint32_t pre_id;
-       uint64_t time;
+       int64_t time;
        uint32_t creator_uid;
        char *desc;
        char *cleanup;
@@ -474,7 +474,7 @@ static NTSTATUS snapper_snap_struct_unpack(TALLOC_CTX *mem_ctx,
        }
 
        dbus_message_iter_next(&st_iter);
-       status = snapper_type_check_get(&st_iter, DBUS_TYPE_UINT64,
+       status = snapper_type_check_get(&st_iter, DBUS_TYPE_INT64,
                                        &snap_out->time);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
@@ -529,15 +529,15 @@ static void snapper_snap_array_print(int32_t num_snaps,
                DEBUG(10, ("id: %u, "
                           "type: %u, "
                           "pre_id: %u, "
-                          "time: %lu, "
+                          "time: %ld, "
                           "creator_uid: %u, "
                           "desc: %s, "
                           "cleanup: %s\n",
-                          snaps[i].id,
-                          snaps[i].type,
-                          snaps[i].pre_id,
-                          snaps[i].time,
-                          snaps[i].creator_uid,
+                          (unsigned int)snaps[i].id,
+                          (unsigned int)snaps[i].type,
+                          (unsigned int)snaps[i].pre_id,
+                          (long int)snaps[i].time,
+                          (unsigned int)snaps[i].creator_uid,
                           snaps[i].desc,
                           snaps[i].cleanup));
                snapper_dict_array_print(snaps[i].num_user_data,
@@ -880,12 +880,12 @@ static NTSTATUS snapper_list_snaps_at_time_pack(const char *snapper_conf,
                return NT_STATUS_NO_MEMORY;
        }
 
-       if (!dbus_message_iter_append_basic(&args, DBUS_TYPE_UINT64,
+       if (!dbus_message_iter_append_basic(&args, DBUS_TYPE_INT64,
                                            &time_lower)) {
                return NT_STATUS_NO_MEMORY;
        }
 
-       if (!dbus_message_iter_append_basic(&args, DBUS_TYPE_UINT64,
+       if (!dbus_message_iter_append_basic(&args, DBUS_TYPE_INT64,
                                            &time_upper)) {
                return NT_STATUS_NO_MEMORY;
        }