瀏覽代碼

Set sticky bits

Bob Mottram 8 年之前
父節點
當前提交
5c79c584fc
共有 1 個檔案被更改,包括 10 行新增0 行删除
  1. 10
    0
      src/freedombone-utils-setup

+ 10
- 0
src/freedombone-utils-setup 查看文件

416
     fi
416
     fi
417
 }
417
 }
418
 
418
 
419
+function set_sticky_bits {
420
+    world_writable=$(find / -xdev -type d -perm -002 \! -perm -1000)
421
+    for w in $world_writable; do
422
+        echo "Setting sticky bit on $w"
423
+        chmod +t $w
424
+    done
425
+}
426
+
419
 function lockdown_permissions {
427
 function lockdown_permissions {
420
     if [ -d /bin ]; then
428
     if [ -d /bin ]; then
421
         chown root:root /bin/*
429
         chown root:root /bin/*
466
     if [ -f /usr/sbin/exim4 ]; then
474
     if [ -f /usr/sbin/exim4 ]; then
467
         chmod u+s /usr/sbin/exim4
475
         chmod u+s /usr/sbin/exim4
468
     fi
476
     fi
477
+
478
+    set_sticky_bits
469
 }
479
 }
470
 
480
 
471
 function disable_core_dumps {
481
 function disable_core_dumps {