腰疼吃什么药最有效| 2010属什么生肖| 水瓜壳煲水有什么功效| 碱性磷酸酶偏高吃什么能降下来呢| 咀嚼是什么意思| ccu是什么意思| 天地银行是什么意思| 吃三七粉不能吃什么| 1996年五行属什么| 脱发缺什么维生素| 老鼠为什么怕猫| 高压偏低是什么原因造成的| 深圳到香港需要办理什么手续| 什么烧肉好吃| 金牛座跟什么星座最配| 9月20日什么星座| 犯罪心理学属于什么专业| 支气管炎吃什么药最有效| 用苦良心是什么意思| 凿壁偷光是什么意思| 汗斑用什么药膏| 咕咾肉是什么肉| 尿蛋白是什么症状| 胚芽是什么| 孩子出疹子应该注意什么| 梦到自己开车是什么意思| 口腔经常溃疡是什么原因| 玑是什么意思| 穿丝袜有什么好处| 吃什么长卵泡| 负压是什么意思| 蝴蝶是什么变的| 为什么家里蟑螂特别多| 乌冬面是什么做的| 形态是什么意思| 飞吻是什么意思| 大便干燥吃什么| 喉咙痛吃什么饭菜好| 情绪高涨是什么意思| asmr是什么| 月经期间喝红糖水有什么好处| 狗狗中毒了用什么办法可以解毒| 诚字属于五行属什么| 一直打哈欠是什么原因| 甲状腺是什么功能| 老鼠属于什么类动物| 梦见挖坟墓预示什么| 紊乱是什么意思| 消肿用什么药| 晚上吃什么好| 胸腔里面像岔气了的疼是什么原因| gi什么意思| 血管狭窄吃什么食物好| dna倍体异常细胞是什么意思| 脚心抽筋是什么原因引起的| 什么是三界五行| 蜈蚣为什么不能打死| 脸上长癣是什么原因造成的| 政协是什么| 九天揽月是什么意思| 什么品牌的奶粉最好| 马齿苋吃了有什么好处| 甲醛中毒吃什么药解毒| 长乘宽乘高算的是什么| 列文虎克发现了什么| 吃脆骨有什么好处| 什么是幻听| 太平果是什么水果| 小便尿不出来什么原因| 左眼皮跳是什么预兆| 斯德哥尔摩综合症是什么意思| 一甲子是什么意思| adem是什么病| 溃疡是什么原因引起的| 一见如什么| 为什么有的| 转基因是什么意思| 舒张压和收缩压是什么| 鬓角长痘痘是什么原因| 巨细胞病毒igg阳性是什么意思| 肝多发囊肿是什么意思| 什么是跑马| 官杀混杂是什么意思| 农业户口和非农业户口有什么区别| 叶酸不能和什么一起吃| 鸡血藤手镯有什么功效| 人参泡酒有什么功效和作用| 鹿角有什么功效和作用| 海苔是什么做的| 呼吸衰竭是什么意思| 血红蛋白浓度是什么意思| 胃酸胃胀反酸水吃什么药| 心率低是什么原因| 筋是什么组织| 做梦翻车了什么预兆| 癸水是什么意思| 红油是什么油| 吃什么补胶原蛋白| 冻顶乌龙茶是什么茶| 出冷汗是什么原因| 红牛加什么提高性功能| 什么水果含维c最多| 胰腺做什么检查| 散瞳后需要注意什么| 手掌心发红是什么原因| 天然气是什么味道| 类风湿性关节炎吃什么药| 米加白念什么| MP是什么| 验血肝功能看什么指标| ac是胎儿的什么| 茶花什么时候开花| 35岁月经量少是什么原因| 发烧吃什么食物最好| 什么门关不上| 疱疹长什么样子图片| 什么病不能吃豆制品| 狐臭挂什么科| 膝关节退行性变是什么意思| 生酮是什么意思| 女人梦见仇人代表什么| 连翘败毒丸的功效与作用是什么| 热量是什么| 彩泥可以做什么| 1979年属什么| 朗姆是什么| 左肺上叶肺大泡是什么意思| 吃什么能提高血压| 渐冻症是什么| 女人骨质疏松吃什么最好| 慢性浅表性胃炎吃什么药好得快| 梦见长大水是什么意思| 吃玉米有什么好处| 胜肽的主要功能是什么| 眼睫毛脱落是什么原因| 睚眦什么意思| 什么是癌胚抗原| 侃侃而谈是什么意思| 人几读什么| 尿常规能查出什么| 鲍鱼什么意思| 不是省油的灯是什么意思| 阴虚内热吃什么药| 42天产后检查挂什么科| 过敏是什么原因引起的| 显现是什么意思| 痒痒粉在药店叫什么| 柴胡有什么功效| 老虎的天敌是什么动物| 生吃大蒜有什么好处| 洗衣机什么牌子的好| 平均红细胞体积偏高是什么意思| 大便不成形吃什么食物好| 梦见瓜是什么意思| 阿戈美拉汀片是什么药| ebv病毒是什么| 初中学历可以考什么证| 7.11是什么星座| 妈祖是什么| 晚上六点是什么时辰| 猪八戒的老婆叫什么| 摩羯座属于什么象星座| 七月初七是什么节日| 五点是什么时辰| 海狗是什么动物| 黄芪的作用是什么| 刘胡兰是什么样的人| 经常生气会得什么病| 儿童鸡胸挂什么科| 半熟芝士是什么意思| 吃什么补血快效果好| 冲锋衣是什么意思| 坐怀不乱是什么生肖| 腱鞘是什么| 流产挂什么科| 高我是什么意思| 梦见下雨是什么意思| 二级医院是什么医院| 农历六月初四是什么日子| 肾看什么科| 奥特曼有什么| 男朋友过生日送什么礼物最有意义| 耳朵堵塞感是什么原因| 苏轼是什么之一| 痛风频繁发作说明什么| 蛇盘疮什么原因引起的| 1955年属羊的是什么命| 刚拔完牙需要注意什么| 落地生根是什么生肖| 狐臭用什么药| 奔跑的马是什么牌子的车| 近亲结婚有什么危害| 什么叫射线| special是什么意思| 痰栓是什么意思| 白细胞低说明什么| 鼻头发黑是什么原因| 娃儿发烧用什么方法退烧快| 星标朋友是什么意思| 什么炖鸡汤好喝又营养| 古惑仔为什么不拍了| 属鸡和什么属相相克| 生理盐水是什么水| 闰六月给父母买什么| 阴道真菌感染用什么药| 嗓子肿痛吃什么药| 三个火念什么| 横死是什么意思| 脾大吃什么药能缩小| 镜子是什么生肖| 蔻驰手表属于什么档次| 为什么会长老年斑| 桃花眼的女人什么命| 对节木是什么树| 什么给我带来快乐| pin是什么意思| 香榧是什么东西| 霉菌性阴道炎用什么药好| 花椒泡脚有什么功效| 脚旁边骨头突出叫什么| 胆红素偏高是什么原因| 勇敢的什么| 女生吃避孕药有什么副作用| 牙齿为什么会变黄| 虚伪是什么意思| 云南白药的保险子是起什么作用的| 高血压变成低血压是什么原因| 农历今年是什么年| 尿白细胞弱阳性是什么意思| 嘴唇起皮是什么原因| gm是什么单位| 苯磺酸氨氯地平片什么时候吃最好| 蒙脱石散是什么| 谷丙转氨酶偏高说明什么原因| 香榧是什么东西| 前戏是什么意思| 婆婆是什么意思| 空前绝后是什么生肖| 14k金是什么意思| 胰腺炎为什么不能同房| 月与什么有关| 明月照沟渠是什么意思| 心率过低吃什么药| 低血压有什么危害| 吃什么能化解肾结石| 女生适合做什么工作| 草莓的种子是什么| 肌酐高是什么原因| 宫颈炎吃什么药效果最好| 妈妈生日送什么礼物| 手掌像什么| 为什么一躺下就鼻塞| 吃什么容易长胖| 0元购是什么意思| 广西属于什么气候| 血糖高吃什么主食好| 春秋鼎盛是什么意思| 父亲节送什么礼物比较好| 爽约什么意思| 93年的属什么| 口干口臭什么原因引起的| 月经期生气会造成什么后果| 前列腺增大伴钙化是什么意思| 蝉鸣声耳鸣是什么原因引起的| 百度Jump to content

山西通报4起违反中央八项规定精神典型问题

From Wikipedia, the free encyclopedia
百度 如果把新技术的“新”,当成文艺本身的“新”,不免本末倒置。

In computing, the sticky bit is a user ownership access right flag that can be assigned to files and directories on Unix-like systems.

There are two definitions: one for files, and one for directories.

For files, particularly executables, the superuser could tag these as to be retained in main memory, even when their need ends, to minimize swapping that would occur when another need arises, and the file now has to be reloaded from relatively slow secondary memory.[1] This function has become obsolete due to swapping optimization.

For directories, when a directory's sticky bit is set, the filesystem treats the files in such directories in a special way so only the file's owner, the directory's owner, or root user can rename or delete the file. Without the sticky bit set, any user with write and execute permissions for the directory can rename or delete contained files, regardless of the file's owner. Typically this is set on the /tmp directory to prevent ordinary users from deleting or moving other users' files.

The modern function of the sticky bit refers to directories, and protects directories and their content from being hijacked by non-owners; this is found in most modern Unix-like systems. Files in a shared directory such as /tmp belong to individual owners, and non-owners may not delete, overwrite or rename them.

History

[edit]

The sticky bit was introduced in the Fifth Edition of Unix (in 1974) for use with pure executable files.[2] When set, it instructed the operating system to retain the text segment of the program in swap space after the process exited. This speeds up subsequent executions by allowing the kernel to make a single operation of moving the program from swap to real memory. Thus, frequently-used programs like editors would load noticeably faster. One notable problem with "stickied" programs was replacing the executable (for instance, during patching); to do so required removing the sticky bit from the executable, executing the program and exiting to flush the cache, replacing the binary executable, and then restoring the sticky bit.

Subsequently, this behavior became operative only in HP-UX and UnixWare. Solaris appears to have abandoned this in 2005.[citation needed] The 4.4-Lite release of BSD retained the old sticky bit behavior, but it has been subsequently dropped from OpenBSD (as of release 3.7) and FreeBSD (as of release 2.2.1). No version of Linux has ever supported this traditional behavior; Linux performs caching of executable files in the same way as all files, so re-executing the program to flush the cache is not necessary.[clarification needed]

Usage

[edit]

The most common modern use of the sticky bit is on directories residing within filesystems for Unix-like operating systems. When a directory's sticky bit is set, the filesystem treats the files in such directories in a special way so only the file's owner, the directory's owner, or root can rename or delete the file. Without the sticky bit set, any user with write and execute permissions for the directory can rename or delete contained files, regardless of the file's owner. Typically, this is set on the /tmp directory to prevent ordinary users from deleting or moving other users' files. This feature was introduced in 4.3BSD in 1986, and today it is found in most modern Unix-like systems.

In addition, Solaris (as of Solaris 2.5) defines special behavior when the sticky bit is set on non-executable files: those files, when accessed, will not be cached by the kernel. This is usually set on swap files to prevent access on the file from flushing more important data from the system cache. It is also used occasionally for benchmarking tests.[citation needed]

The sticky bit is also set by the automounter to indicate that a file has not been mounted yet. This allows programs like ls to ignore unmounted remote files.

Excerpts from man pages about the sticky bit's effect on directories and files
Operating System Directories Files
AIX 5.2[3] indicates that only file owners can link or unlink files in the specified directory. sets the save-text attribute.
Solaris 11[4] If a directory is writable and has S_ISVTX (the sticky bit) set, files within that directory can be removed or renamed only if one or more of the following is true (see unlink(2) and rename(2)): the user owns the file, the user owns the directory, the file is writable by the user, the user is a privileged user. If a regular file is not executable and has S_ISVTX set, the file is assumed to be a swap file. In this case, the system's page cache will not be used to hold the file's data. If [...] set on any other file, the results are unspecified.
HP-UX[5] If [...] set on a directory, an unprivileged user cannot delete or rename others' files in that directory. [...] prevents the system from abandoning the swap-space image of the program-text portion of the file when its last user terminates. Then, when the next user of the file executes it, the text need not be read from the file system but can simply be swapped in, thus saving time.
Linux[6][7] When [...] set on a directory, files in that directory may only be unlinked or renamed by root or the directory owner or the file owner. The fs.protected_fifos, fs.protected_regular, and fs.protected_symlinks sysctls further restrict the creation of FIFOs, creation of regular files, and the following of symlinks respectively within directories with the sticky bit set. the Linux kernel ignores the sticky bit on files.
FreeBSD[8] If [...] set on a directory, an unprivileged user may not delete or rename files of other users in that directory. The FreeBSD VM system totally ignores the sticky bit (S_ISVTX) for executables.
IRIX[9] If [...] set on a directory, then any files created in that directory will take on the group ID of the directory rather than the group ID of the calling process. mount(1M) may be used to enable this feature regardless of the mode of the directory. If the sticky bit, S_ISVTX, is set on a file that is a dynamic loader for an ELF executable, then when the executable is exec'ed the old process's read only address spaces will be made available to the dynamic loader in the new process. This can improve program start up time considerably. The setting of the sticky bit on any other file has no effect.
Mac OS X (Leopard)[10] A directory whose 'sticky bit' is set becomes an append-only directory [...] in which the deletion of files is restricted. A file in a sticky directory may only be removed or renamed by a user if the user has write permission for the directory and the user is the owner of the file, the owner of the directory, or the super-user. This feature is usefully applied to directories such as /tmp which must be publicly writable but should deny users the license to arbitrarily delete or rename each other's files. Any user may create a sticky directory. The sticky bit has no effect on executable files. All optimisation on whether text images remain resident in memory is handled by the kernel's virtual memory system.
NetBSD[11] A directory whose "sticky bit" is set becomes a directory in which the deletion of files is restricted. A file in a sticky directory may only be removed or renamed by a user if the user has write permission for the directory and the user is the owner of the file, the owner of the directory, or the super-user. This feature is usefully applied to directories such as /tmp which must be publicly writable but should deny users the license to arbitrarily delete or rename each other's files. NetBSD does not currently treat regular files that have the sticky bit set specially, but this behavior might change in the future.
OpenBSD[12] A directory with the "sticky bit" set places restrictions on file deletion: a file in a sticky directory may only be removed or renamed by a user if the user has write permission for the directory and the user is the owner of the file, the owner of the directory, or the superuser. This feature is usefully applied to directories such as /tmp which must be publicly writable but should deny users the license to arbitrarily delete or rename each other's files.

Any user may create a sticky directory. See chmod(1) for details about modifying file modes.

Historically, an executable shareable file which had the sticky bit set was not immediately discarded from swap space after execution. The kernel hoarded the text segment of the file for future reuse, thus avoiding having to reload the program. This is no longer true on modern systems; the current virtual memory system keeps track of recently used executables, making the sticky bit for files redundant. The sticky bit can still be set on files, but without any effect.

Only the superuser can set the sticky bit on a file, though the owner of the file may clear the sticky bit.

SCO UnixWare[13] If a directory is writable and the sticky bit, S_ISVTX, is set on the directory, a process may remove or rename files within that directory only if one or more of the following is true:
  • the effective user ID of the process is the same as that of the owner ID of the file
  • the effective user ID of the process is the same as that of the owner ID of the directory
  • the process has write permission for the file
  • the process has the P_OWNER privilege
If a 0410 a.out executable file has the sticky bit (mode bit 01000) set, the operating system will not delete the program text from the swap area when the last user process terminates. If a 0413 a.out or ELF executable file has the sticky bit set, the operating system will not delete the program text from memory when the last user process terminates. In either case, if the sticky bit is set the text will already be available (either in a swap area or in memory) when the next user of the file executes it, thus making execution faster.

Examples

[edit]

The sticky bit can be set using the chmod command and can be set using its octal mode 1000 or by its symbol t (s is already used by the setuid bit). For example, to add the bit on the directory /usr/local/tmp, one would type chmod +t /usr/local/tmp. Or, to make sure that directory has standard tmp permissions, one could also type chmod 1777 /usr/local/tmp.

To clear it, use chmod -t /usr/local/tmp or chmod 0777 /usr/local/tmp (the latter will also reset the tmp directory to standard permissions).

In Unix symbolic file system permission notation, the sticky bit is represented either by the letter t or T in the final character-place depending on whether the execution bit for the others category is set or unset, respectively. For instance, on Solaris 8, the /tmp directory, which by default has both the others execute bit and the sticky-bit set, shows up as:

$ ls -ld /tmp
drwxrwxrwt   4 root     sys          485 Nov 10 06:01 /tmp

If the sticky-bit is set on a file or directory without the execution bit set for the others category (non-user-owner and non-group-owner), it is indicated with a capital T (replacing what would otherwise be -):

# ls -l test
-rw-r--r--   1 root     anygroup          0 Nov 10 12:57 test
# chmod +t test; ls -l test
-rw-r--r-T   1 root     anygroup          0 Nov 10 12:57 test

See also

[edit]

References

[edit]
  1. ^ Zintz, Walter (February 1984). "The Unix Connection: What is a sticky bit?". HARDCOPY. p. 130.
  2. ^ Steinhauser, Martin Oliver (2012). Computer Simulation in Physics and Engineering. De Gruyter. ISBN 978-3-1102-5590-4.
  3. ^ "Archived copy of chmod man page under AIX 5.2". Archived from the original on 2025-08-06. Retrieved 2025-08-06.
  4. ^ "Synopsis - man pages section 2: System Calls". Docs.oracle.com. 2025-08-06. Retrieved 2025-08-06.
  5. ^ "HPUX chmod[2]". Archived from the original on November 20, 2007. Retrieved February 29, 2008.{{cite web}}: CS1 maint: bot: original URL status unknown (link)
  6. ^ "chmod(1) - Linux manual page". Man7.org. Retrieved 2025-08-06.
  7. ^ "proc(5) - Linux manual page". Man7.org. Retrieved 2025-08-06.
  8. ^ "chmod - FreeBSD". Nixdoc.net. 2025-08-06. Retrieved 2025-08-06.
  9. ^ "chmod - IRIX/standard/". Nixdoc.net. Retrieved 2025-08-06.
  10. ^ "Mac Developer Library". Developer.apple.com. Retrieved 2025-08-06.
  11. ^ "sticky.7 - NetBSD Manual Pages". Netbsd.gw.com. 2025-08-06. Retrieved 2025-08-06.
  12. ^ "Manual Pages: sticky". Openbsd.org. 2025-08-06. Retrieved 2025-08-06.
  13. ^ "chmod(2)". Uw714doc.sco.com. 2025-08-06. Retrieved 2025-08-06.
[edit]
晚上扫地有什么说法 甲亢是什么原因引起的 农历四月是什么月 老人大小便失禁是什么原因造成的 掉头发补充什么维生素
扫描件是什么意思 不敢造次是什么意思 干爹是什么意思 眼睑炎用什么药效果好 冶游史是什么意思
取笑是什么意思 机智如你是什么意思 什么是创造性思维 黑京念什么 偶尔耳鸣是什么原因
蛆长什么样 县长是什么级别 指甲扁平是什么原因 滔滔不绝的绝什么意思 公务员什么时候退休
甲胎蛋白是检查什么的hcv7jop9ns2r.cn 烹饪是什么意思hcv9jop0ns0r.cn 尿道炎吃什么药最好hcv7jop5ns1r.cn 蛀虫指什么生肖hcv9jop5ns0r.cn 孕妇心情不好对胎儿有什么影响hcv7jop6ns0r.cn
拉肚子挂什么科hcv9jop7ns9r.cn 激光脱毛挂什么科hcv7jop6ns8r.cn 集分宝是什么意思hcv9jop7ns3r.cn 人的价值是什么hcv8jop8ns7r.cn 甲状腺手术后有什么后遗症hcv9jop1ns6r.cn
七夕节的含义是什么hcv9jop6ns3r.cn 什么情况下要打破伤风hcv8jop1ns5r.cn 减肥中午吃什么比较好hcv8jop8ns7r.cn msgm是什么品牌hcv7jop9ns6r.cn 蓝色搭配什么颜色hcv9jop7ns4r.cn
18年是什么年hcv7jop4ns8r.cn 水杯用什么材质的好hcv7jop4ns5r.cn 乌龟最喜欢吃什么hcv9jop8ns3r.cn 衣原体支原体感染有什么症状hcv8jop9ns7r.cn 康复治疗技术学什么wuhaiwuya.com
百度