File: test.sh

package info (click to toggle)
filter 2.6.3-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, jessie, jessie-kfreebsd, lenny, sarge, squeeze, wheezy
  • size: 728 kB
  • ctags: 706
  • sloc: ansic: 4,033; sh: 3,932; makefile: 198
file content (33 lines) | stat: -rw-r--r-- 606 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh

maildir=/tmp/public

ls=/bin/ls
expr=expr

mailperms=`$ls -lgd $maildir/.`

mailpublic=`$expr "$mailperms" : "d[rwxstT]*\(w[tx]\) .*"`

echo mailpublic is $mailpublic

case "$mailpublic" in
   wt)
       echo has writable for all
       d_setgid="$undef"
       ;;
   wx)
       echo "WARNING: mail directory does not have 't' flag set, yet is world-writable"
       echo "$mailperms"
       d_setgid="$undef"
       ;;
   "")
       echo presume it doesnt exist yet
       ;;
   *)
       echo does NOT have writable thing
       d_setgid="$define"
       ;;
esac

echo d_setgid is "$d_setgid"