Win10子系统Ubuntu18.04下编译openwrt问题

Win10子系统Ubuntu18.04下编译openwrt问题

现象:

find: The relative path ‘Files/WindowsApps/CanonicalGroupLimited.Ubuntu18.04onWindows_1804.2019.522.0_x64__79rhkp1fndgsc’ is included in the PATH environment variable, which is insecure in combination with the -execdir action of find. Please remove that entry from $PATH
package/Makefile:65: recipe for target ‘package/install’ failed
make[2]: *** [package/install] Error 1

分析:

环境变量PATH内,路径:
'Files/WindowsApps/CanonicalGroupLimited.Ubuntu18.04onWindows_1804.2019.522.0_x64__79rhkp1fndgsc’存在风险,当find -execdir命令执行时。

  1. shell执行echo $PATH,确实存在路径:"/mnt/c/Program Files/WindowsApps/CanonicalGroupLimited.Ubuntu18.04onWindows_1804.2019.522.0_x64__79rhkp1fndgsc"
  2. 查看此目录下文件为ubuntu1804.exe等,推测应该是Ubuntu系统的虚拟程序。
  • 个人觉得这个路径对Ubuntu系统无过多用,Ubuntu不支持exe的运行,当然wine除外,但是wine也无执行ubuntu1804.exe程序的必要。
  • 不确定微软添加此路径的意图,个人选择从PATH内剔除这个路径。

解决:

网上临时修改环境变量的方法,不能根治。这里采取针对用户修改部署文件,从PATH内剔除这个路径。

  1. 测试变量替换命令{string/old/new} - 将string内old替换为new。
    echo “${PATH/’/mnt/c/Program Files/WindowsApps/CanonicalGroupLimited.Ubuntu18.04onWindows_1804.2019.522.0_x64__79rhkp1fndgsc:’/}”

  2. 修改用户部署文件。
    vim ~/.profile
    在最后一行添加如下语句,删除指定路径:
    PATH="${PATH/'/mnt/c/Program Files/WindowsApps/CanonicalGroupLimited.Ubuntu18.04onWindows_1804.2019.522.0_x64__79rhkp1fndgsc:'/}"
    :不同电脑路径不一样,请依据现象中报错路径指定。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值