已开启
Want::Marshalling 在 broker 进程不应启用 UTF8 扩展格式 #1227
m0_65533854创建于  8 天前
m0_65533854
m0_65533854
8 天前 创建

问题描述

Want::Marshalling(interfaces/kits/native/want/src/want.cpp)中,当 Want 参数设置了 PARAM_STRING_TRANS_FORMAT_UTF8 时,会无条件给 action 附加 PARAM_WANT_EXPANSION_TAG 前缀并对 parameters 设置扩容标志(512K 扩展格式)。

broker 进程(Anco 跨端代理,uid=5557)作为新旧版本交互的边界,其对端无法识别该扩展格式标记,导致解析异常。

期望行为

broker 进程(selfUID == BROKER_UID, 5557)Marshalling 时不启用 UTF8 扩展格式,回落到旧序列化格式;非 broker 进程行为保持不变。

参考实现:ability_runtime uri_permission_manager_client.cppCheckUseRawData()(broker can't use raw data)的同类 uid 判断模式,BROKER_UID = 5557 与 ability_runtime/huks 现有常量同源。

修复方案

Want::MarshallingPARAM_STRING_TRANS_FORMAT_UTF8 分支条件上追加 selfUID != BROKER_UID(selfUID = getuid())。

likedislike
openharmony_ci
openharmony_ci成员
8 天前 评论:

感谢提交Issue!关于Issue的交互操作,请访问OpenHarmony社区支持命令清单。如果有问题,请联系 [@jayleehw](https://gitcode.com/jayleehw) [@uniquexch](https://gitcode.com/uniquexch) [@littlejerry1](https://gitcode.com/littlejerry1) [@ccllee1](https://gitcode.com/ccllee1) [@yangxuguang-huawei](https://gitcode.com/yangxuguang-huawei) 。如果需要调整订阅PR、Issue的变更状态,请访问链接


Thanks for submitting the issue. For more commands, please visit OpenHarmony Command List. If you have any questions, please refer to committer gitcode for help. If you need to change the subscription of a Pull Request or Issue, please visit the link.

likedislike
openharmony_ciopenharmony_ci成员
8 天前 添加了label:waiting_for_assign
m0_65533854m0_65533854
8 天前 关联了pull request:Skip utf8 trans format expansion in Want::Marshalling for broker process