From: Luca Boccassi Date: Tue, 14 Oct 2025 19:14:39 +0000 (+0100) Subject: mountfsd: json format unsigned types as unsigned X-Git-Tag: v259-rc1~322^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d29a2cd2d4f2712475e87ce2a0941ec79ddd1c37;p=thirdparty%2Fsystemd.git mountfsd: json format unsigned types as unsigned sizes/offsets are unsigned ints, so use the appropriate macros to build the json messages, otherwise UINT64T_MAX is sent as -1 --- diff --git a/src/mountfsd/mountwork.c b/src/mountfsd/mountwork.c index 74b97d7371a..77d93025b09 100644 --- a/src/mountfsd/mountwork.c +++ b/src/mountfsd/mountwork.c @@ -561,8 +561,8 @@ static int vl_method_mount_image( SD_JSON_BUILD_PAIR_CONDITION(!sd_id128_is_null(pp->uuid), "partitionUuid", SD_JSON_BUILD_UUID(pp->uuid)), SD_JSON_BUILD_PAIR("fileSystemType", SD_JSON_BUILD_STRING(dissected_partition_fstype(pp))), SD_JSON_BUILD_PAIR_CONDITION(!!pp->label, "partitionLabel", SD_JSON_BUILD_STRING(pp->label)), - SD_JSON_BUILD_PAIR("size", SD_JSON_BUILD_INTEGER(pp->size)), - SD_JSON_BUILD_PAIR("offset", SD_JSON_BUILD_INTEGER(pp->offset)), + SD_JSON_BUILD_PAIR("size", SD_JSON_BUILD_UNSIGNED(pp->size)), + SD_JSON_BUILD_PAIR("offset", SD_JSON_BUILD_UNSIGNED(pp->offset)), SD_JSON_BUILD_PAIR("mountFileDescriptor", SD_JSON_BUILD_INTEGER(fd_idx)), JSON_BUILD_PAIR_STRV_NON_EMPTY("mountPoint", l)); if (r < 0) @@ -575,8 +575,8 @@ static int vl_method_mount_image( link, SD_JSON_BUILD_PAIR("partitions", SD_JSON_BUILD_VARIANT(aj)), SD_JSON_BUILD_PAIR("imagePolicy", SD_JSON_BUILD_STRING(ps)), - SD_JSON_BUILD_PAIR("imageSize", SD_JSON_BUILD_INTEGER(di->image_size)), - SD_JSON_BUILD_PAIR("sectorSize", SD_JSON_BUILD_INTEGER(di->sector_size)), + SD_JSON_BUILD_PAIR("imageSize", SD_JSON_BUILD_UNSIGNED(di->image_size)), + SD_JSON_BUILD_PAIR("sectorSize", SD_JSON_BUILD_UNSIGNED(di->sector_size)), SD_JSON_BUILD_PAIR_CONDITION(!sd_id128_is_null(di->image_uuid), "imageUuid", SD_JSON_BUILD_UUID(di->image_uuid))); }