已合并
fix get networkid #12521
fix get networkid #12521
已合并
liu-qiang12创建于 14 天前
共 1 个文件变更+9-11
@@ -1291,9 +1291,8 @@ static int32_t CheckAndGenerateSinkSessionKey(ProxyChannelInfo *chan)
1291 return SOFTBUS_OK;1291 return SOFTBUS_OK;
1292 }1292 }
1293 (void)LnnGetNetworkIdByUuid(chan->appInfo.peerData.deviceId, chan->appInfo.peerNetWorkId, NETWORK_ID_BUF_LEN);1293 (void)LnnGetNetworkIdByUuid(chan->appInfo.peerData.deviceId, chan->appInfo.peerNetWorkId, NETWORK_ID_BUF_LEN);
1294- int32_t osType = 0;1294+ GetOsTypeByNetworkId(chan->appInfo.peerNetWorkId, &chan->appInfo.osType);
1295- GetOsTypeByNetworkId(chan->appInfo.peerNetWorkId, &osType);1295+ if (chan->appInfo.osType != OH_OS_TYPE) {
1296- if (osType != OH_OS_TYPE) {
1297 DisableCapabilityBit(&chan->appInfo.channelCapability, TRANS_CHANNEL_SINK_GENERATE_KEY_OFFSET);1296 DisableCapabilityBit(&chan->appInfo.channelCapability, TRANS_CHANNEL_SINK_GENERATE_KEY_OFFSET);
1298 }1297 }
1299 if (GetCapabilityBit(chan->appInfo.channelCapability, TRANS_CHANNEL_SINK_GENERATE_KEY_OFFSET)) {1298 if (GetCapabilityBit(chan->appInfo.channelCapability, TRANS_CHANNEL_SINK_GENERATE_KEY_OFFSET)) {
@@ -1310,10 +1309,15 @@ static void FillMetaNodeAppInfo(int64_t authId, AppInfo *appInfo)
1310 return;1309 return;
1311 }1310 }
1312 char peerNetWorkId[NETWORK_ID_BUF_LEN] = { 0 };1311 char peerNetWorkId[NETWORK_ID_BUF_LEN] = { 0 };
1313- (void)AuthMetaGetPeerMetaNodeIdByPeerAuthIdPacked(authId, peerNetWorkId, NETWORK_ID_BUF_LEN);1312+ if (AuthMetaGetPeerMetaNodeIdByPeerAuthIdPacked(authId, peerNetWorkId, NETWORK_ID_BUF_LEN) != SOFTBUS_OK) {
1313+ return;
1314+ }
1314 GetOsTypeByNetworkId(peerNetWorkId, &appInfo->osType);1315 GetOsTypeByNetworkId(peerNetWorkId, &appInfo->osType);
1315 LnnGetRemoteNumInfo(peerNetWorkId, NUM_KEY_META_TYPE, &appInfo->metaType);1316 LnnGetRemoteNumInfo(peerNetWorkId, NUM_KEY_META_TYPE, &appInfo->metaType);
1316 appInfo->isSupportConcurrentMetaNode = AuthMetaIsSupportConcurrentByMetaNodeIdPacked(peerNetWorkId);1317 appInfo->isSupportConcurrentMetaNode = AuthMetaIsSupportConcurrentByMetaNodeIdPacked(peerNetWorkId);
1318+ if (appInfo->osType == OTHER_OS_TYPE) {
1319+ (void)strcpy_s(appInfo->peerNetWorkId, NETWORK_ID_BUF_LEN, peerNetWorkId);
1320+ }
1317}1321}
1318 1322 
1319static int32_t CheckProxyChannelPermission(const ProxyMessage *msg, ProxyChannelInfo *chan)1323static int32_t CheckProxyChannelPermission(const ProxyMessage *msg, ProxyChannelInfo *chan)
@@ -1331,13 +1335,7 @@ static int32_t CheckProxyChannelPermission(const ProxyMessage *msg, ProxyChannel
1331 1335 
1332#ifdef DSOFTBUS_FEATURE_PROXY_CHANNEL1336#ifdef DSOFTBUS_FEATURE_PROXY_CHANNEL
1333 if (chan->appInfo.appType == APP_TYPE_NORMAL && chan->appInfo.callingTokenId != TOKENID_NOT_SET) {1337 if (chan->appInfo.appType == APP_TYPE_NORMAL && chan->appInfo.callingTokenId != TOKENID_NOT_SET) {
1334- if (chan->appInfo.osType != OH_OS_TYPE) {1338+ if (chan->appInfo.osType != OH_OS_TYPE && chan->appInfo.osType != OTHER_OS_TYPE) {
1335- (void)strcpy_s(chan->appInfo.peerNetWorkId, NETWORK_ID_BUF_LEN, chan->appInfo.peerData.deviceId);
1336- } else {
1337- (void)LnnGetNetworkIdByUuid(
1338- chan->appInfo.peerData.deviceId, chan->appInfo.peerNetWorkId, NETWORK_ID_BUF_LEN);
1339- }
1340- if (chan->appInfo.osType != OH_OS_TYPE) {
1341 TRANS_LOGI(TRANS_CTRL, "not support acl check osType=%{public}d", chan->appInfo.osType);1339 TRANS_LOGI(TRANS_CTRL, "not support acl check osType=%{public}d", chan->appInfo.osType);
1342 } else if (GetCapabilityBit(chan->appInfo.channelCapability, TRANS_CHANNEL_ACL_CHECK_OFFSET)) {1340 } else if (GetCapabilityBit(chan->appInfo.channelCapability, TRANS_CHANNEL_ACL_CHECK_OFFSET)) {
1343 int32_t ret = TransCheckServerAccessControl(&chan->appInfo);1341 int32_t ret = TransCheckServerAccessControl(&chan->appInfo);