亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 1151 | 回復(fù): 6
打印 上一主題 下一主題

[求助]umask對目錄起作用,對文件不起作用? [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2006-09-27 09:34 |只看該作者 |倒序瀏覽
很早就知道umask的意義,就是指創(chuàng)建文件時默認(rèn)被拿掉的權(quán)限(也就是從初始值777中拿掉),但是一直沒使用過,昨天在給朋友做FTP的時候才發(fā)現(xiàn),新建立的文件夾權(quán)限是755,但是文件就成了644,我的LINUX umask對目錄其作用,對文件居然不起作用,不知道是我的理解有錯還是怎么的?大家?guī)蛶兔。在此先謝過了。!

[root@Jes test1]# mkdir test2
[root@Jes test1]# ls -ld test2/
drwxr-xr-x  2 root root 4096 Sep 27 09:31 test2/
[root@Jes test1]# touch test2/test.file
[root@Jes test1]# ls -l test2/test.file
-rw-r--r--  1 root root 0 Sep 27 09:31 test2/test.file



1 man umask 的相關(guān)部分
umask [-p] [-S] [mode]
              The user file-creation mask is set to  mode.   If  mode  begins
              with  a  digit, it is interpreted as an octal number; otherwise
              it is interpreted as a  symbolic  mode  mask  similar  to  that
              accepted by chmod(1).  If mode is omitted, the current value of
              the mask is printed.  The -S  option  causes  the  mask  to  be
              printed  in  symbolic form; the default output is an octal num-
              ber.  If the -p option is supplied, and mode  is  omitted,  the
              output  is  in  a form that may be reused as input.  The return
              status is 0 if the mode was successfully changed or if no  mode
              argument was supplied, and false otherwise.

2 我機(jī)器的系統(tǒng)版本及默認(rèn)umask值等信息

[root@Jes ~]# uname  -a
Linux Jes 2.6.9-42.EL #1 Wed Jul 12 23:16:43 EDT 2006 i686 i686 i386 GNU/Linux
[root@Jes ~]# cat /etc/redhat-release
Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
[root@Jes ~]# umask
0022
[root@Jes ~]# umask -S
u=rwx,g=rx,o=rx

論壇徽章:
0
2 [報告]
發(fā)表于 2006-09-27 09:50 |只看該作者
對文件是起作用的
不過文件相當(dāng)于用666減去umask的值(如果我們不看s位)

論壇徽章:
0
3 [報告]
發(fā)表于 2006-09-27 12:34 |只看該作者
那我要想讓一個目錄下的所有新建立的文件以及子目錄有可執(zhí)行權(quán)限就不能通過umask 來做了?

論壇徽章:
0
4 [報告]
發(fā)表于 2006-09-27 12:57 |只看該作者
沒有任何一種umask,可以讓你新創(chuàng)建的文件具有可執(zhí)行的屬性。

論壇徽章:
0
5 [報告]
發(fā)表于 2006-09-27 14:18 |只看該作者
為安全起見,不允許你直接給文件執(zhí)行的權(quán)限

論壇徽章:
0
6 [報告]
發(fā)表于 2006-09-27 17:07 |只看該作者
別忘了umask可以自己設(shè)的.你肯定可以決定一切.

論壇徽章:
0
7 [報告]
發(fā)表于 2006-09-28 10:49 |只看該作者
又要手動了,或者弄到crontab里讓他定時去修改。
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP