ruby warning: Insecure world writable dir /usr/local/bin, mode 040777

在安装或者运行ruby相关的程序时,有时会报

 ruby warning: Insecure world writable dir /usr/local/bin, mode 040777

Ruby (on all Unixes, including Cygwin) warns if you try to run an external program and your $PATH contains a world-writable directory. It doesn't just check the directories on $PATH: it checks each of their parents, too, because if /usr/local (say) is world-writeable, /usr/local/bin is subverted as easily as if it were writeable itself
Cygwin seems to ship with various directories world-writable, so you get warnings if you run a Ruby script that runs external programs:
 
ehughes:~$ uname -a
CYGWIN_NT-5.0 ehughes 1.5.18(0.132/4/2) 2005-07-02 20:30 i686 unknown unknown Cygwin
ehughes:~$ ruby -e 'system("echo")'
-e:1: warning: Insecure world writable dir /usr/local/bin, mode 040777
 
ehughes:~$ ruby -e '`echo`'
-e:1: warning: Insecure world writable dir /usr/local/bin, mode 040777
ehughes:~$ 

这时可以将报错的目录权限修改下:

chmod o-w /usr/local/bin
chmod o-w /usr/local
chmod o-w /usr

然后 

~$ source /etc/profile 

或者重启系统

ok  再试就没问题了


posted on 2011-12-29 18:00 hanyi 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/hanyi/archive/2011/12/29/2306509.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值