【问题标题】:difference between permission on the directory目录权限的区别
【发布时间】:2012-09-10 01:23:37
【问题描述】:

我有以下关于目录权限的问题。
实际上我安装了symphony2.0,我得到了以下错误:

RuntimeException: Unable to write in the cache directory   
(/Users/someUser/Sites/someApp/app/cache/dev) 

如果我列出我得到的目录

ll /Users/someUser/Sites/someApp/app/cache
(1)
drwxr-xr-x someUser

我有另一个安装,它的工作和权限是

(2)
drwxr-xr-x+ someUser

所以我的问题是如何获得 (2) ?
我运行以下命令(3)来获取(1),但我不知道如何获取(2)。

(3)
sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs

附:
(1) 和 (2) 的区别只是结尾处的 +

【问题讨论】:

  • +号表示它是一个ACL(访问控制列表)

标签: unix symfony permissions file-permissions user-permissions


【解决方案1】:

查看http://symfony.com/doc/current/book/installation.html

1) 在支持 chmod +a 的系统上使用 ACL

$ rm -rf app/cache/*
$ rm -rf app/logs/*

$ sudo chmod +a "www-data allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
$ sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs

2) 在不支持 chmod +a 的系统上使用 Acl

$ sudo setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs

$ sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs

【讨论】:

  • 感谢您的回答。无论如何,在我的情况下ls- l 相当于ls。反正楼主是一样的。我更新了我的问题。有什么想法吗?
【解决方案2】:

权限末尾的+ 符号表示存在ACL 列表,是*nix 正常权限的扩展。您可以使用ls -lZ 将其打印出来。然后您可以setfacl 进行设置。

【讨论】:

    猜你喜欢
    • 2013-12-24
    • 2011-11-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-17
    相关资源
    最近更新 更多