免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4825 | 回复: 8
打印 上一主题 下一主题

chmod 修改连接文件属性,不成功是什么原因? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-07-07 08:15 |只看该作者 |倒序浏览
#su
#ln -s /usr/bin/file aaa
  这个时候aaa的属性是 lrwxrwxrwx(777)
#chmod 755 aaa
  没有失败提示
  这个时候aaa的属性还是lrwxrwxrwx(777)

请问如何改这个文件的属性。请高手指点。

论坛徽章:
0
2 [报告]
发表于 2006-07-07 08:30 |只看该作者
原帖由 gotolj 于 2006-7-7 08:15 发表
#su
#ln -s /usr/bin/file aaa
  这个时候aaa的属性是 lrwxrwxrwx(777)
#chmod 755 aaa
  没有失败提示
  这个时候aaa的属性还是lrwxrwxrwx(777)

请问如何改这个文件的属性。请高手指点。


symlink 本身权限表示都是 rwxrwxrwx,你 chmod 这样修改实际是改到 aaa 该项目的权限。

==

论坛徽章:
0
3 [报告]
发表于 2006-07-07 08:44 |只看该作者
下面是上一个版本的sample,式样我不能改啊?
所以我的目的是一定要把*.so 文件属性变成755

-r-xr-xr-x   1 root       sys         217088  5月 13日 2004年 libXXXXX.so.1
lrwxr-xr-x   1 root       sys             34 11月 30日  15:09 libXXXXX.so -> /opt/XXXX/libXXXXX.so.1
~~~~~~
755

论坛徽章:
0
4 [报告]
发表于 2006-07-07 10:37 |只看该作者
为了答案,顶

论坛徽章:
0
5 [报告]
发表于 2006-07-07 11:45 |只看该作者
the permission of a soft link (symbolic link) cannot be modified after it is created.

the permisson of a symbolic link depends on the O.S.,   on some O.S., permission is set according to "umask", but on other O.S., permission is always 777.

论坛徽章:
0
6 [报告]
发表于 2006-07-07 11:55 |只看该作者
OK,suggest the platform is hpux,and the fact is hpux.
see the property of libXXXXX.so , it is 755.
lrwxr-xr-x   1 root       sys             34 11月 30日  15:09 libXXXXX.so -> /opt/XXXX/libXXXXX.so.1
how can it be?

I just want to create a symbolic link in the same platform with the same property(755).
What a pity, I always failed.

论坛徽章:
0
7 [报告]
发表于 2006-07-07 12:04 |只看该作者
chmod的手册里面说了chmod不能修改符号连接的权限。
chmod  never  changes  the permissions of symbolic links; the chmod system call cannot change their permissions.  This is not a problem since the permissions of symbolic links are never used.  However, for each symbolic link listed on the command  line,  chmod changes the permissions of the pointed-to file.  In contrast, chmod ignores symbolic links encountered during recursive directory traversals.

论坛徽章:
0
8 [报告]
发表于 2006-07-07 12:25 |只看该作者
mrbob:
than you so much but it appears on the platform like follow which is the former product
lrwxr-xr-x   1 root       sys             34 11月 30日  15:09 libXXXXX.so -> /opt/XXXX/libXXXXX.so.1

论坛徽章:
0
9 [报告]
发表于 2006-07-07 12:33 |只看该作者
好了,谢谢大家,这个问题算是搞定了.

跟上司谈过了,就让他这样去吧! 777
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP