home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume22 / cops.pch < prev    next >
Text File  |  1990-06-07  |  19KB  |  638 lines

  1. Subject:  v22i106:  System security analysis tool, patch1
  2. Newsgroups: comp.sources.unix
  3. Approved: rsalz@uunet.UU.NET
  4. X-Checksum-Snefru: 68b838ea d39df88f 01a3fe9e bcce4158
  5.  
  6. Submitted-by: Dan Farmer <df@cert.sei.cmu.edu>
  7. Posting-number: Volume 22, Issue 106
  8. Archive-name: cops.pch
  9. Patch-To: volume21/cops
  10.  
  11.  
  12. Here's the first patch for COPS.  Pretty minor stuff on the whole, but I'd
  13. appreciate it if you would get it out to the world for me.  This one fixes
  14. some bugs and minor doc stuff; I'll be putting out another patch later
  15. this year that should add features and all that good stuff (hopefully it
  16. won't be repairing problems with this patch :-)).
  17.  
  18.  thanks,
  19.  
  20.   -- dan
  21.  
  22. ---------------  Cut here for patch -------------------------
  23.  
  24. Patch #: 1
  25. Priority: MEDIUM
  26.  
  27.   This is the first patch for COPS.  This shar file includes three files; the
  28. original csh version of kuang (actually, another shar file), a patch file,
  29. and a "patchlevel.h" file.
  30.  
  31. o  The csh version of kuang was meant to be included in the original release,
  32.  but somehow got lost along the way.  It should be functionally equivalent to
  33.  the version I ported to bourne shell for wider portability, but is a little
  34.  cleaner design, since I had to do some strange things to get it to work in
  35.  bourne.
  36. o  Perhaps the biggest problem was with the password guessing program; turned
  37.  out there was a bug that someone added while adding features through the
  38.  years (it was originally written in 1983, and the bug was not in the original
  39.  version, looking at my archives.)  The problem was that once a dictionary
  40.  passwd was guessed, a variable wasn't reset.  The original author also added
  41.  some comments about the design and intent of the program.
  42. o  /bin/rm -f in rc* files (pretty common stuff) are now ignored.
  43. o  findsuid now uses "ls -ldga" instead of "ls -lga" to find files.
  44. o  A couple of error messages and docs were slightly changed, and a couple
  45.    of miscellaneous "'"'s were added to improve robustness; minor nits.
  46.  
  47.  
  48.   Enjoy!  If you have any problems, drop me a line at:
  49.  
  50.  df@sei.cmu.edu
  51.    or
  52.  (412) 268 7197
  53.  
  54.  
  55.   P.S.  To apply the patch, merely type:
  56.  
  57.   patch < cops.patch.1
  58.  
  59.      If you don't have the patch program, apply the patch by hand,
  60.      or get patch (I highly recommend it -- great program!  It can
  61.      be gotten from uunet.uu.net, via anonymous ftp)
  62.  
  63.      After patching, type "make", and all should be well again....
  64.  
  65.   The original COPS toolkit (as well as the "patch" program) can be gotten
  66. via anonymous ftp from uunet.uu.net (192.48.96.2), or wherever fine software
  67. is archived :-)
  68.  
  69. --------------------------------------------------------------------------------
  70.  
  71. #! /bin/sh
  72. # This is a shell archive.  Remove anything before this line, then unpack
  73. # it by saving it into a file and typing "sh file".  To overwrite existing
  74. # files, type "sh file -c".  You can also feed this as standard input via
  75. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  76. # will see the following message at the end:
  77. #        "End of shell archive."
  78. # Contents:  cops.patch.1 kuang.orig patchlevel.h
  79. #
  80. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  81. if test -f 'cops.patch.1' -a "${1}" != "-c" ; then 
  82.   echo shar: Will not clobber existing file \"'cops.patch.1'\"
  83. else
  84. echo shar: Extracting \"'cops.patch.1'\" \(6595 characters\)
  85. sed "s/^X//" >'cops.patch.1' <<'END_OF_FILE'
  86. XIndex: MANIFEST
  87. X17a18
  88. X> kuang.orig
  89. X
  90. XIndex: README
  91. X123c123
  92. X<    -- Next, change lines 36 and 37 in the "cops" shell file from:
  93. X---
  94. X>    -- Next, change lines 37 and 38 in the "cops" shell file from:
  95. X129c129
  96. X<    -- Set "MAIL=NO" in the "cops" shell file (line 22).  This will prevent
  97. X---
  98. X>    -- Set "MAIL=NO" in the "cops" shell file (line 23).  This will prevent
  99. X140c140
  100. X<    -- You may wish to comment out the password checker (line 72 in the
  101. X---
  102. X>    -- You may wish to comment out the password checker (line 73 in the
  103. X187c187
  104. X< groups in their respective target lines (below lines 21 and 27,
  105. X---
  106. X> groups in their respective target lines (below lines 20 and 27,
  107. X
  108. XIndex: XTRA_CREDIT
  109. X9,10c9,10
  110. X< Craig Leres, Seth Alford, Roger Southwick, Steve Dum, and Rick Lindsley
  111. X< all get credit for the password guessing program.
  112. X---
  113. X> Craig Leres, Jef Poskanzer, Seth Alford, Roger Southwick, Steve Dum,
  114. X> and Rick Lindsley all get credit for the password guessing program.
  115. X24c24,28
  116. X< implementation ideas at LISA II.
  117. X---
  118. X> implementation ideas at LISA III.
  119. X> 
  120. X>   In round II (the first patch), Mark Plumbly fixed rc.chk so it would
  121. X> work like I said it would, as well as pointing out a few problems with
  122. X> the password guesser.
  123. X
  124. XIndex: group.chk
  125. X75,76c75,77
  126. X<         if ("'$C2'" != "TRUE")
  127. X<             printf("Warning!  Group file, line %d, group has password: %s\n", NR, $0)
  128. X---
  129. X>         if ("'$C2'" != "TRUE") {
  130. X>             if (length($2) == 13)
  131. X>                 printf("Warning!  Group file, line %d, group has password: %s\n", NR, $0) }
  132. X127c128,129
  133. X<         printf("Warning!  YGroup file, line %d, group has password: %s\n", NR, $0) } \
  134. X---
  135. X>         if (if (length($2) == 13))
  136. X>             printf("Warning!  YGroup file, line %d, group has password: %s\n", NR, $0) } \
  137. X
  138. XIndex: kuang
  139. X0a1
  140. X> #!/bin/sh
  141. XOnly in cops.src: kuang.orig
  142. X
  143. XIndex: makefile
  144. X28a29
  145. X> RM=/bin/rm
  146. X32a34,36
  147. X> 
  148. X> clean:
  149. X>     $(RM) $(EXECUTABLE)
  150. X
  151. XIndex: passwd.chk
  152. X88,89c88,92
  153. X<     if ($3 !~ /[0-9]/) {
  154. X<         printf("Warning!  Password file, line %d, nonnumeric user id: \n\t%s\n", NR, $0) } \
  155. X---
  156. X>     if ($3 !~ /^[0-9]/) {
  157. X>         if ($3 < 0) {
  158. X>             printf("Warning!  Password file, line %d, negative user id: \n\t%s\n", NR, $0) } \
  159. X>         else {
  160. X>         printf("Warning!  Password file, line %d, nonnumeric user id: \n\t%s\n", NR, $0) }} \
  161. X117,118c120,124
  162. X<         if ($3 !~ /[0-9]/ && $3 != "-2") {
  163. X<             printf("Warning!  YPassword file, line %d, nonnumeric user id: \n\t%s\n", NR, $0) } \
  164. X---
  165. X>         if ($3 !~ /^[0-9]/) {
  166. X>             if ($3 < 0) {
  167. X>             printf("Warning!  YPassword file, line %d, negative user id: \n\t%s\n", NR, $0) } \
  168. X>             else {
  169. X>             printf("Warning!  YPassword file, line %d, nonnumeric user id: \n\t%s\n", NR, $0) }} \
  170. X121c127
  171. X<         if ($4 !~ /[0-9]/ && $4 != "-2") {
  172. X---
  173. X>         if ($4 !~ /[0-9]/) {
  174. XOnly in cops.src: patch.1
  175. X
  176. XIndex: rc.chk
  177. X21a22,27
  178. X> # 12 Apr 90, Mark Plumbly made it ignore lines starting with rm -f
  179. X> # (popular in rc files) and fixed my code so it would ignore everything
  180. X> # after a ">".
  181. X> #
  182. X> SED=/bin/sed
  183. X> CAT=/bin/cat
  184. X43d48
  185. X< #
  186. X46c51,70
  187. X< first_pass=`$AWK '{for (i=1;i<=NF;i++) if ((index($i,"/")) && ((first=substr($i,1,1)!=">"))&& first!="#" && first!="$" && (last=substr($i,length($i),1))!="\"") print $i}' $init_files | $EGREP -v "/dev/.*ty|/tmp|/usr/tmp|/dev/null" | $SORT -u`
  188. X---
  189. X> #
  190. X> # 12 Apr mdp:     Modified to remove "> file" as well as ">file"
  191. X> #        and remove "rm -f file" (this removes a few bogus ones).
  192. X> #        (i.e. things which are written to or removed only are ignored).
  193. X> #
  194. X> first_pass=`${CAT} ${init_files}     |                \
  195. X> ${SED} -e 's/ *#.*$//'            |                \
  196. X> $AWK '
  197. X> {                                    \
  198. X>   for (i=1;i<=NF;i++) {                            \
  199. X>     if     ((index($i,"/")) &&                        \
  200. X>     ((first=substr($i,1,1)!=">")) &&                \
  201. X>     $(i-1)!=">" &&                             \
  202. X>     ( i<=2 || $(i-2)!="rm" || $(i-1)!="-f" ) &&            \
  203. X>     first!="#" &&                            \
  204. X>     first!="$" &&                            \
  205. X>     (last=substr($i,length($i),1))!="\"")                \
  206. X>     print $i                            \
  207. X>     }                                    \
  208. X> }' | $EGREP -v "/dev/.*ty|/tmp|/usr/tmp|/dev/null" | $SORT -u`
  209. X
  210. XIndex: root.chk
  211. X71c71
  212. X<     if test ! `$GREP "root" $ftp`
  213. X---
  214. X>     if $TEST ! "`$GREP "root" $ftp`"
  215. X91c91
  216. X< $GREP path $csh | $AWK '{split($0,p1,"="); \
  217. X---
  218. X> $GREP path $csh | $SED 's/#.*$//' | $AWK '{split($0,p1,"="); \
  219. X105c105
  220. X< $GREP PATH $sh | $SED 's/\(PATH=.*\);.*/\1/' |
  221. X---
  222. X> $GREP PATH $sh | $SED 's/#.*$//' | $SED 's/\(PATH=.*\);.*/\1/' |
  223. X118c118
  224. X<         $ECHO "Warning!  \".\" is in roots path!"
  225. X---
  226. X>         $ECHO "Warning!  \".\" (or current directory) is in roots path!"
  227. X123c123
  228. X<         $ECHO "Warning!  Directory $i is _World_ writable!"
  229. X---
  230. X>         $ECHO "Warning!  Directory $i is _World_ writable and in roots path!"
  231. X
  232. XIndex: suid.chk
  233. X37c37
  234. X< SEARCH=.
  235. X---
  236. X> SEARCH=/
  237. X58c58
  238. X< $FIND $SEARCH \( -perm -4000 -o -perm -2000 \) -exec $LS -lga {} \; | \
  239. X---
  240. X> $FIND $SEARCH \( -perm -4000 -o -perm -2000 \) -exec $LS -ldga {} \; | \
  241. X
  242. XIndex: docs/warnings
  243. X50c50
  244. X< 1)
  245. X---
  246. X> 0)
  247. X61c61
  248. X< 2)
  249. X---
  250. X> 1)
  251. X80c80
  252. X< 3)
  253. X---
  254. X> 2)
  255. X93a94,101
  256. X> 3)
  257. X> Directory foo_dir is _World_ writable and in roots path!
  258. X> 
  259. X>    This is the same as (2), but the directory was found to be in the
  260. X> path variable set either in /.login or /.profile.  This is a bad thing
  261. X> because if it is writable, a trojan horse can be placed there, and
  262. X> root will execute the command.  See also (23).
  263. X> 
  264. X198a207,214
  265. X> Password file, line xyz, negative user id: foo
  266. X> 
  267. X>    A user id is negative.  This is most common with user name "nobody",
  268. X> and with an id of "-2".  This can be dangerous, especially if you are running
  269. X> a Sun, with 4.xx SunOS.  It is uncertain if it is dangerous for other
  270. X> versions or machines.  Changing it to 32767 is the usual course of action.
  271. X> 
  272. X> 19)
  273. X204c220
  274. X< 19)
  275. X---
  276. X> 20)
  277. X206c222,223
  278. X<    To fix, delete all blank lines.
  279. X---
  280. X>    To fix, delete all blank lines.  This can be very bad, because a blank
  281. X> line can give a uid=0 account with no password.
  282. X208c225
  283. X< 20)
  284. X---
  285. X> 21)
  286. X214c231
  287. X< 21)
  288. X---
  289. X> 22)
  290. X220,221c237,238
  291. X< 22)
  292. X< "." is in roots path!
  293. X---
  294. X> 23)
  295. X> "." (or current directory) is in roots path!
  296. X229c246
  297. X< 23)
  298. X---
  299. X> 24)
  300. X238c255
  301. X< 24)
  302. X---
  303. X> 25)
  304. X
  305. XIndex: src/pass.c
  306. X15a16,27
  307. X> 
  308. X>     Insecure is something that Jef Poskanzer and I wrote to rid a
  309. X>     local system of an overly persistent ankle-biting adolescent.
  310. X>     It was a quick hack we whipped up in just a few minutes and was
  311. X>     never intended to be publically distributed. Unfortunately, I
  312. X>     made the mistake of giving a copy to an associate at UC
  313. X>     Berkeley. Apparently, he incorporated it in a security package
  314. X>     he later developed for use at Berkeley. Someone else
  315. X>     distributed it outside Berkeley which explains why it's been
  316. X>     publically distributed.
  317. X> 
  318. X> 
  319. X226c238
  320. X< #define ARB_CONST    80
  321. X---
  322. X> #define ARB_CONST    1024
  323. X275a288,289
  324. X> 
  325. X>         done = 0;
  326. X
  327. END_OF_FILE
  328. if test 6595 -ne `wc -c <'cops.patch.1'`; then
  329.     echo shar: \"'cops.patch.1'\" unpacked with wrong size!
  330. fi
  331. # end of 'cops.patch.1'
  332. fi
  333. if test -f 'kuang.orig' -a "${1}" != "-c" ; then 
  334.   echo shar: Will not clobber existing file \"'kuang.orig'\"
  335. else
  336. echo shar: Extracting \"'kuang.orig'\" \(7758 characters\)
  337. sed "s/^X//" >'kuang.orig' <<'END_OF_FILE'
  338. X#! /bin/sh
  339. X# This is a shell archive.  Remove anything before this line, then unpack
  340. X# it by saving it into a file and typing "sh file".  To overwrite existing
  341. X# files, type "sh file -c".  You can also feed this as standard input via
  342. X# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  343. X# will see the following message at the end:
  344. X#        "End of shell archive."
  345. X# Contents:  dofiles dogids douids init_kuang kuang.csh
  346. X#
  347. XPATH=/bin:/usr/bin:/usr/ucb ; export PATH
  348. Xif test -f 'dofiles' -a "${1}" != "-c" ; then 
  349. X  echo shar: Will not clobber existing file \"'dofiles'\"
  350. Xelse
  351. Xecho shar: Extracting \"'dofiles'\" \(1564 characters\)
  352. Xsed "s/^X//" >'dofiles' <<'END_OF_FILE'
  353. XX# /* Copyright 1985 Robert W. Baldwin */
  354. XX# /* Copyright 1986 Robert W. Baldwin */
  355. XXset notice85="Copyright 1985 Robert W. Baldwin"
  356. XXset notice86="Copyright 1986 Robert W. Baldwin"
  357. XX
  358. XX#
  359. XX# A list of file names is read from successive lines of stdin.
  360. XX# Each file is examined for ways to access it.
  361. XX# The input format is:
  362. XX#    <filename> <whitespace> <mode> <comments>
  363. XX# The <mode> is either "write" or "replace".
  364. XX#
  365. XXecho Called dofiles.                        #>/dev/tty
  366. XXwhile ( 1 )
  367. XX    set nextfile = ( `echo $<` )
  368. XX    if ( $#nextfile == 0 )  break;
  369. XX#
  370. XX    set file = $nextfile[1]
  371. XX    set mode = $nextfile[2]
  372. XX    echo "    File $file, mode $mode"            #>/dev/tty
  373. XX#
  374. XX# Rules converting filename goals into UserName or GroupName goals.
  375. XX#
  376. XX    set writers = ( `filewriters $file` )
  377. XX    if ( $#writers == 3 ) then
  378. XX        set owner = $writers[1]
  379. XX        set group = $writers[2]
  380. XX        set other = $writers[3]
  381. XX        echo "        Writers are $owner $group $other"    #>/dev/tty
  382. XX        addto uids $owner $mode $file $nextfile[3-]
  383. XX        if ( $group != "NONE" ) then
  384. XX            addto gids $group $mode $file $nextfile[3-]
  385. XX        endif
  386. XX        if ( $other != "NONE" ) then
  387. XX            addto uids $other $mode $file $nextfile[3-]
  388. XX        endif
  389. XX    else
  390. XX        echo "        $file does not exist"        #>/dev/tty
  391. XX        continue
  392. XX    endif
  393. XX#
  394. XX# Rules converting filename goals into other filename goals.
  395. XX#
  396. XX    if ($mode != "replace" ) then
  397. XX        continue
  398. XX    endif
  399. XX#
  400. XX    set parent = "$file:h"
  401. XX    set basename = "$file:t"
  402. XX#    echo -n "       " Parent directory is $parent        #>/dev/tty
  403. XX#    echo ", " basename is $basename                #>/dev/tty
  404. XX    if ( "$parent" != "" ) then
  405. XX        addto files $parent write replace $basename $nextfile[3-]
  406. XX    endif
  407. XXend
  408. XX
  409. XEND_OF_FILE
  410. Xif test 1564 -ne `wc -c <'dofiles'`; then
  411. X    echo shar: \"'dofiles'\" unpacked with wrong size!
  412. Xfi
  413. X# end of 'dofiles'
  414. Xfi
  415. Xif test -f 'dogids' -a "${1}" != "-c" ; then 
  416. X  echo shar: Will not clobber existing file \"'dogids'\"
  417. Xelse
  418. Xecho shar: Extracting \"'dogids'\" \(668 characters\)
  419. Xsed "s/^X//" >'dogids' <<'END_OF_FILE'
  420. XX# /* Copyright 1985 Robert W. Baldwin */
  421. XX# /* Copyright 1986 Robert W. Baldwin */
  422. XXset notice85="Copyright 1985 Robert W. Baldwin"
  423. XXset notice86="Copyright 1986 Robert W. Baldwin"
  424. XX
  425. XX#
  426. XX# Process a list of gids from stdin.
  427. XX# Usage: dogids
  428. XX#    Input format is:
  429. XX#    GroupName Comments
  430. XX#
  431. XXecho Called dogids                        #>/dev/tty
  432. XXwhile ( 1 )
  433. XX    set nextgid = ( `echo $<` )
  434. XX    if ( $#nextgid == 0 )  break;
  435. XX    set group = $nextgid[1]
  436. XX    echo "   " Group $group                    #>/dev/tty
  437. XX#
  438. XX# Rules mapping gids to uids.
  439. XX#
  440. XX    foreach user ( `members $group` )
  441. XX        addto uids $user grant $group $nextgid[2-]
  442. XX    end
  443. XX#
  444. XX# Rules mapping gids to files.
  445. XX#
  446. XX    addto files /etc/group replace grant $group $nextgid[2-]
  447. XXend
  448. XX
  449. XEND_OF_FILE
  450. Xif test 668 -ne `wc -c <'dogids'`; then
  451. X    echo shar: \"'dogids'\" unpacked with wrong size!
  452. Xfi
  453. X# end of 'dogids'
  454. Xfi
  455. Xif test -f 'douids' -a "${1}" != "-c" ; then 
  456. X  echo shar: Will not clobber existing file \"'douids'\"
  457. Xelse
  458. Xecho shar: Extracting \"'douids'\" \(1539 characters\)
  459. Xsed "s/^X//" >'douids' <<'END_OF_FILE'
  460. XX# /* Copyright 1985 Robert W. Baldwin */
  461. XX# /* Copyright 1986 Robert W. Baldwin */
  462. XXset notice85="Copyright 1985 Robert W. Baldwin"
  463. XXset notice86="Copyright 1986 Robert W. Baldwin"
  464. XX
  465. XX#
  466. XX# Process a list of uids from stdin.
  467. XX# Usage: douids username comments
  468. XX#
  469. XXecho Called douids                        #>/dev/tty
  470. XXwhile ( 1 )
  471. XX    set nextuid = ( `echo $<` )
  472. XX    if ( $#nextuid == 0 )  break;
  473. XX    set user = $nextuid[1]
  474. XX    echo "   " User $user                    #>/dev/tty
  475. XX#
  476. XX# Rules mapping uids to other uids.
  477. XX#
  478. XX
  479. XX#
  480. XX# Rules mapping uids to files.
  481. XX#
  482. XX    addto files /etc/passwd replace grant $user $nextuid[2-]
  483. XX    addto files /usr/lib/aliases replace trojan $user $nextuid[2-]
  484. XX
  485. XX    if ( -e ~${user}/.rhosts )  then
  486. XX        addto files ~${user}/.rhosts write grant $user $nextuid[2-]
  487. XX    endif
  488. XX
  489. XX    if (-e ~${user}/.login)  then
  490. XX        addto files ~${user}/.login replace trojan $user $nextuid[2-]
  491. XX    endif
  492. XX
  493. XX    if (-e ~${user}/.cshrc)  then
  494. XX        addto files ~${user}/.cshrc replace trojan $user $nextuid[2-]
  495. XX    endif
  496. XX
  497. XX    if (-e ~${user}/.profile)  then
  498. XX        addto files ~${user}/.profile replace trojan $user $nextuid[2-]
  499. XX    endif
  500. XX
  501. XX    if (${user} == "root")  then
  502. XX        addto files /usr/lib/crontab replace create supershell\
  503. XX                $nextuid[2-]
  504. XX        addto files /etc/rc replace trojan $user $nextuid[2-]
  505. XX        addto files /etc/rc.local replace trojan $user $nextuid[2-]
  506. XX    endif
  507. XX
  508. XX    if (${user} != "root")  then
  509. XX        addto files /etc/hosts.equiv replace allow rlogin $nextuid[2-]
  510. XX    endif
  511. XX
  512. XX    if ((${user} != "root") && (-e /etc/hosts.equiv) && \
  513. XX        !(-z /etc/hosts.equiv))  then
  514. XX        addto files /etc/hosts replace fake HostAddress $nextuid[2-]
  515. XX    endif
  516. XX
  517. XXend
  518. XX
  519. XEND_OF_FILE
  520. Xif test 1539 -ne `wc -c <'douids'`; then
  521. X    echo shar: \"'douids'\" unpacked with wrong size!
  522. Xfi
  523. X# end of 'douids'
  524. Xfi
  525. Xif test -f 'init_kuang' -a "${1}" != "-c" ; then 
  526. X  echo shar: Will not clobber existing file \"'init_kuang'\"
  527. Xelse
  528. Xecho shar: Extracting \"'init_kuang'\" \(836 characters\)
  529. Xsed "s/^X//" >'init_kuang' <<'END_OF_FILE'
  530. XX# /* Copyright 1985 Robert W. Baldwin */
  531. XX# /* Copyright 1986 Robert W. Baldwin */
  532. XXset notice85="Copyright 1985 Robert W. Baldwin"
  533. XXset notice86="Copyright 1986 Robert W. Baldwin"
  534. XX
  535. XX###############################################
  536. XX# Kuang: Rule based computer security checker.
  537. XX###############################################
  538. XX#
  539. XX#
  540. XX# Initialization.
  541. XX#
  542. XXclearfiles
  543. XX#
  544. XX# First setup what we have access to.
  545. XX# The uids.k file must include the user 'OTHER' meaning the world access bits.
  546. XX# Add any other UIDs accessible to the attacker (e.g., ftp, daemon).
  547. XX#
  548. XX# Directly accessible user IDs.
  549. XXcat >uids.k <<END
  550. XXOTHER
  551. XXEND
  552. XX#
  553. XX# Directly accessible group IDs.
  554. XX# This usually includes a group like 'users', which most users are in.
  555. XX#
  556. XXcat >gids.k <<END
  557. XXEND
  558. XX#
  559. XX# Setup the primary goal(s).
  560. XX#
  561. XXecho Setting up goal                        #>/dev/tty
  562. XXaddto uids root DO ANYTHING
  563. XX
  564. XEND_OF_FILE
  565. Xif test 836 -ne `wc -c <'init_kuang'`; then
  566. X    echo shar: \"'init_kuang'\" unpacked with wrong size!
  567. Xfi
  568. X# end of 'init_kuang'
  569. Xfi
  570. Xif test -f 'kuang.csh' -a "${1}" != "-c" ; then 
  571. X  echo shar: Will not clobber existing file \"'kuang.csh'\"
  572. Xelse
  573. Xecho shar: Extracting \"'kuang.csh'\" \(704 characters\)
  574. Xsed "s/^X//" >'kuang.csh' <<'END_OF_FILE'
  575. XX# /* Copyright 1985 Robert W. Baldwin */
  576. XX# /* Copyright 1986 Robert W. Baldwin */
  577. XXset notice85="Copyright 1985 Robert W. Baldwin"
  578. XXset notice86="Copyright 1986 Robert W. Baldwin"
  579. XX
  580. XX###############################################
  581. XX# Kuang: Rule based computer security checker.
  582. XX###############################################
  583. XX#
  584. XX#
  585. XX# Initialization.
  586. XX#
  587. XXcsh -f init_kuang
  588. XX#
  589. XX# Main loop
  590. XX#
  591. XXecho Starting main loop                        #>/dev/tty
  592. XXwhile ( -e uids.n || -e gids.n || -e files.n )
  593. XX    if ( -e uids.n ) then
  594. XX        mv uids.n uids.x
  595. XX        csh -f douids < uids.x
  596. XX        endif
  597. XX    if ( -e gids.n ) then
  598. XX        mv gids.n gids.x
  599. XX        csh -f dogids < gids.x
  600. XX        endif
  601. XX
  602. XX    if ( -e files.n ) then
  603. XX        mv files.n files.x
  604. XX        csh -f dofiles < files.x
  605. XX        endif
  606. XX    end
  607. XX
  608. XEND_OF_FILE
  609. Xif test 704 -ne `wc -c <'kuang.csh'`; then
  610. X    echo shar: \"'kuang.csh'\" unpacked with wrong size!
  611. Xfi
  612. X# end of 'kuang.csh'
  613. Xfi
  614. Xecho shar: End of shell archive.
  615. Xexit 0
  616. END_OF_FILE
  617. if test 7758 -ne `wc -c <'kuang.orig'`; then
  618.     echo shar: \"'kuang.orig'\" unpacked with wrong size!
  619. fi
  620. # end of 'kuang.orig'
  621. fi
  622. if test -f 'patchlevel.h' -a "${1}" != "-c" ; then 
  623.   echo shar: Will not clobber existing file \"'patchlevel.h'\"
  624. else
  625. echo shar: Extracting \"'patchlevel.h'\" \(21 characters\)
  626. sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
  627. X#define PATCHLEVEL 1
  628. END_OF_FILE
  629. if test 21 -ne `wc -c <'patchlevel.h'`; then
  630.     echo shar: \"'patchlevel.h'\" unpacked with wrong size!
  631. fi
  632. # end of 'patchlevel.h'
  633. fi
  634. echo shar: End of shell archive.
  635. exit 0
  636.  
  637. exit 0 # Just in case...
  638.