No functional change, just refactoring.
return log_error_errno(errno_or_else(EINVAL), "Failed to UNIX hash secret key: %m");
r = sd_json_buildo(&e,
- SD_JSON_BUILD_PAIR("uri", SD_JSON_BUILD_STRING(uri)),
- SD_JSON_BUILD_PAIR("data", SD_JSON_BUILD_BASE64(encrypted_key, encrypted_key_size)),
- SD_JSON_BUILD_PAIR("hashedPassword", SD_JSON_BUILD_STRING(hashed)));
+ SD_JSON_BUILD_PAIR_STRING("uri", uri),
+ SD_JSON_BUILD_PAIR_BASE64("data", encrypted_key, encrypted_key_size),
+ SD_JSON_BUILD_PAIR_STRING("hashedPassword", hashed));
if (r < 0)
return log_error_errno(r, "Failed to build encrypted JSON key object: %m");
assert(hashed);
r = sd_json_buildo(&e, SD_JSON_BUILD_PAIR("type", JSON_BUILD_CONST_STRING("modhex64")),
- SD_JSON_BUILD_PAIR("hashedPassword", SD_JSON_BUILD_STRING(hashed)));
+ SD_JSON_BUILD_PAIR_STRING("hashedPassword", hashed));
if (r < 0)
return log_error_errno(r, "Failed to build recover key JSON object: %m");
r = sd_json_variant_set_fieldbo(
&arg_identity_extra_rlimits, t,
- SD_JSON_BUILD_PAIR("cur", SD_JSON_BUILD_VARIANT(jcur)),
- SD_JSON_BUILD_PAIR("max", SD_JSON_BUILD_VARIANT(jmax)));
+ SD_JSON_BUILD_PAIR_VARIANT("cur", jcur),
+ SD_JSON_BUILD_PAIR_VARIANT("max", jmax));
if (r < 0)
return log_error_errno(r, "Failed to set %s field: %m", rlimit_to_string(l));
if (r < 0)
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Failed to parse JSON secret record at %u:%u: %m", line, column);
- r = sd_json_buildo(&full, SD_JSON_BUILD_PAIR("secret", SD_JSON_BUILD_VARIANT(v)));
+ r = sd_json_buildo(&full, SD_JSON_BUILD_PAIR_VARIANT("secret", v));
if (r < 0)
return r;
disk_ceiling = USER_DISK_SIZE_MAX;
r = sd_json_buildo(&status,
- SD_JSON_BUILD_PAIR("state", SD_JSON_BUILD_STRING(home_state_to_string(state))),
+ SD_JSON_BUILD_PAIR_STRING("state", home_state_to_string(state)),
SD_JSON_BUILD_PAIR("service", JSON_BUILD_CONST_STRING("io.systemd.Home")),
SD_JSON_BUILD_PAIR("useFallback", SD_JSON_BUILD_BOOLEAN(!HOME_STATE_IS_ACTIVE(state))),
SD_JSON_BUILD_PAIR("fallbackShell", JSON_BUILD_CONST_STRING(BINDIR "/systemd-home-fallback-shell")),
return r;
return sd_json_buildo(ret,
- SD_JSON_BUILD_PAIR("record", SD_JSON_BUILD_VARIANT(augmented->json)),
- SD_JSON_BUILD_PAIR("incomplete", SD_JSON_BUILD_BOOLEAN(augmented->incomplete)));
+ SD_JSON_BUILD_PAIR_VARIANT("record", augmented->json),
+ SD_JSON_BUILD_PAIR_BOOLEAN("incomplete", augmented->incomplete));
}
static bool home_user_match_lookup_parameters(LookupParameters *p, Home *h) {
assert(!FLAGS_SET(g->mask, USER_RECORD_SECRET));
assert(!FLAGS_SET(g->mask, USER_RECORD_PRIVILEGED));
- return sd_json_buildo(ret, SD_JSON_BUILD_PAIR("record", SD_JSON_BUILD_VARIANT(g->json)));
+ return sd_json_buildo(ret, SD_JSON_BUILD_PAIR_VARIANT("record", g->json));
}
static bool home_group_match_lookup_parameters(LookupParameters *p, Home *h) {
r = sd_json_buildo(
&h->json,
- SD_JSON_BUILD_PAIR("userName", SD_JSON_BUILD_STRING(user_name)),
+ SD_JSON_BUILD_PAIR_STRING("userName", user_name),
SD_JSON_BUILD_PAIR_CONDITION(!!rr, "realm", SD_JSON_BUILD_STRING(realm)),
SD_JSON_BUILD_PAIR("disposition", JSON_BUILD_CONST_STRING("regular")),
SD_JSON_BUILD_PAIR("binding", SD_JSON_BUILD_OBJECT(
SD_JSON_BUILD_PAIR(SD_ID128_TO_STRING(mid), SD_JSON_BUILD_OBJECT(
- SD_JSON_BUILD_PAIR("imagePath", SD_JSON_BUILD_STRING(image_path)),
- SD_JSON_BUILD_PAIR("homeDirectory", SD_JSON_BUILD_STRING(hd)),
- SD_JSON_BUILD_PAIR("storage", SD_JSON_BUILD_STRING(user_storage_to_string(storage))),
- SD_JSON_BUILD_PAIR("uid", SD_JSON_BUILD_UNSIGNED(uid)),
- SD_JSON_BUILD_PAIR("gid", SD_JSON_BUILD_UNSIGNED(gid)))))));
+ SD_JSON_BUILD_PAIR_STRING("imagePath", image_path),
+ SD_JSON_BUILD_PAIR_STRING("homeDirectory", hd),
+ SD_JSON_BUILD_PAIR_STRING("storage", user_storage_to_string(storage)),
+ SD_JSON_BUILD_PAIR_UNSIGNED("uid", uid),
+ SD_JSON_BUILD_PAIR_UNSIGNED("gid", gid))))));
if (r < 0)
return r;
r = sd_json_buildo(
&g->json,
- SD_JSON_BUILD_PAIR("groupName", SD_JSON_BUILD_STRING(un)),
+ SD_JSON_BUILD_PAIR_STRING("groupName", un),
SD_JSON_BUILD_PAIR_CONDITION(!!rr, "realm", SD_JSON_BUILD_STRING(rr)),
- SD_JSON_BUILD_PAIR("description", SD_JSON_BUILD_STRING(description)),
+ SD_JSON_BUILD_PAIR_STRING("description", description),
SD_JSON_BUILD_PAIR("binding", SD_JSON_BUILD_OBJECT(
SD_JSON_BUILD_PAIR(SD_ID128_TO_STRING(mid), SD_JSON_BUILD_OBJECT(
SD_JSON_BUILD_PAIR("gid", SD_JSON_BUILD_UNSIGNED(user_record_gid(h))))))),
r = sd_json_buildo(
&new_binding_entry,
- SD_JSON_BUILD_PAIR("blobDirectory", SD_JSON_BUILD_STRING(blob)),
+ SD_JSON_BUILD_PAIR_STRING("blobDirectory", blob),
SD_JSON_BUILD_PAIR_CONDITION(!!image_path, "imagePath", SD_JSON_BUILD_STRING(image_path)),
SD_JSON_BUILD_PAIR_CONDITION(!sd_id128_is_null(partition_uuid), "partitionUuid", SD_JSON_BUILD_STRING(SD_ID128_TO_UUID_STRING(partition_uuid))),
SD_JSON_BUILD_PAIR_CONDITION(!sd_id128_is_null(luks_uuid), "luksUuid", SD_JSON_BUILD_STRING(SD_ID128_TO_UUID_STRING(luks_uuid))),