ret_val = chmod(filename,0777);
,但它不会改变,即使ret_val为0.如果我在常规文件上尝试相同的操作,它也可以.
有任何想法吗?
P.S:我以root身份运行程序,因此它拥有所需的所有权限.
解决方法
In the Linux implementation,sockets which are visible in the file system
honor the permissions of the directory they are in. Their owner,
group and their permissions can be changed. Creation of a new socket
will fail if the process does not have write and search (execute) permission on the directory the socket is created in. Connecting to the
socket object requires read/write permission. This behavior differs
from many BSD-derived systems which ignore permissions for UNIX domain
sockets. Portable programs should not rely on this feature for security.
原文地址:https://www.jb51.cc/linux/394575.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。