Guest User

Untitled

a guest
Mar 26th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.82 KB | None | 0 0
  1. #! /bin/sh
  2. #
  3. # decode_passwords for FRITZ!OS versions > 06.05
  4. #
  5. # Copyright (C) 2014 P.Haemmerlein (http://www.yourfritz.de)
  6. #
  7. # This program is free software; you can redistribute it and/or
  8. # modify it under the terms of the GNU General Public License
  9. # as published by the Free Software Foundation; either version 2
  10. # of the License, or (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License under
  16. # http://www.gnu.org/licenses/gpl-2.0.html
  17. # for more details.
  18. #
  19. # There's a small license deviance, if you want to incorporate the script into your
  20. # own software, please read the description below to take note of that.
  21. #
  22. # "FRITZ!Box" and "FRITZ!" are registered word marks and "AVM" is a registered
  23. # word and figurative mark of:
  24. # AVM Computersysteme Vertriebs GmbH, 10559, Berlin, DE.
  25. #
  26. # A registered entry for "FRITZ!OS" could not be found as of that date (09-05-2014),
  27. # but perhaps the legal protection of "FRITZ!" is expanded to the term "FRITZ!OS" too.
  28. #
  29. #######################################################################################
  30. #
  31. # Purpose:
  32. # --------
  33. # - decode encrypted credentials from a configuration file
  34. # - sustitute the former -c switch for {all,usb,wlan}cfgconv utilities
  35. #
  36. # Usage:
  37. # ------
  38. #
  39. # decode_passwords < {input_data}
  40. #
  41. # The script is designed as a filter using standard input and standard output. If you
  42. # use it as standard input for a command interpreter via a pipe, you can use file
  43. # descriptor 3 to provide the data stream to process instead of stdin.
  44. #
  45. # The input data may be any text. Any data looking like an encrypted item as it is
  46. # used by AVMs reversible encryption (that is a string starting with four dollar signs
  47. # followed only by the characters A to Z and 1 to 6) will be extracted and the script
  48. # will try as hard as possible to decrypt it.
  49. #
  50. # The simplest input contains only one such secret value, but you may let point stdin
  51. # of the script to a whole file like /var/flash/ar7.cfg too.
  52. #
  53. # If it's impossible to decode an encrypted value, it will remain unchanged.
  54. #
  55. # The converted input (substitution between encrypted and decrypted data is done
  56. # using the 'sed' command) will be written to stdout.
  57. #
  58. # To prevent unexpected behaviour (waiting for input because of an omitted redirection)
  59. # the script will refuse to work, if its standard input is attached to a terminal
  60. # device. If it's your intention to use it such way, specify 'tty' as 1st argument.
  61. #
  62. # Exit codes:
  63. # -----------
  64. # 0 - input data (if any) processed
  65. # 121 - unable to create a private temporary directory
  66. # 122 - the stdin file points to a terminal device and the 'tty' argument is absent
  67. # 123 - the specified WLAN key for mimicry seems to be unusual
  68. # 124 - the specified MAC address for mimicry seems to be invalid
  69. # 125 - the temporary path looks suspicious
  70. # 126 - missing 'webdavcfginfo' binary
  71. # 127 - invalid arguments specified, usage help will be shown
  72. #
  73. # Lean and mean version:
  74. # ----------------------
  75. # There's a tradeoff between a well-documented script with embedded comments and the
  76. # requirement for some purposes (a.e. the ruKernelTool utility) to write the script
  77. # to a device using a telnet shell session, execute it one or more times and forget
  78. # it afterwards.
  79. #
  80. # To produce such a lean version, you can call the script with the argument
  81. # 'leanandmean' as first parameter and it will write a version of itself without error
  82. # messages or any comments and line indentations to stdout. The pure content will be
  83. # put into a short wrapper script like this:
  84. #
  85. # cat >/var/decode_passwords <<-"LEANANDMEAN"
  86. # >> script code is placed here <<
  87. # LEANANDMEAN
  88. # chmod 550 /var/decode_passwords
  89. # [ $(md5sum </var/decode_passwords | sed -n -e 's/^\([0-9a-f]*\).*/\1/p') \
  90. # (cont) == 39f69aa3fb14198462c45fe56f7ed4cc ] || \
  91. # (cont) echo "Hash difference found, transmission failed." 1>&2
  92. #
  93. # You can customize the above "wrapper" script with some more arguments. The target
  94. # file name at the device may be specified as second parameter, default value is
  95. # '/var/decode_passwords' which will write the script to volatile storage at tmpfs.
  96. # If you'd prefer to do without the final hash check, you can specify *any* item as
  97. # third argument. If its length is greater than zero, no MD5 check will take place
  98. # at the wrapper.
  99. #
  100. # And finally you can specify another word (the fourth argument) with 2any content
  101. # and its pure presence will remove some additional code (look below for 'mimicry'
  102. # explanations) from the lean script version.
  103. #
  104. # At the time of this writing the lean version (without mimicry) uses 90 lines
  105. # with 2046 characters (bytes) at the target system and 4 additional lines (+258
  106. # bytes) for the default wrapper.
  107. #
  108. # If you compare these values with the "full blown" version (~520 lines and ~19,600
  109. # bytes), there's a significant difference. And as long as nobody will really read
  110. # the lean version to understand what it's doing, there's no need to transfer so
  111. # much useless data to the box.
  112. #
  113. # For that (and only that) purpose you may use the special lean version without any
  114. # copyright notice and without the included license reference(s).
  115. # If you want to incorporate the lean version of this script into your own software,
  116. # you are obligated to bundle the full version with your software too, without any
  117. # additional need for the casual user to send a special request for it.
  118. #
  119. # In this case you may bundle the script with your own software without the need
  120. # to publish your own source code too, if it's not required by other licenses.
  121. #
  122. # Mimicry of another box:
  123. # -----------------------
  124. # If you've got the *internal* presentation of any configuration file from another
  125. # box (which is out of reach yet - for example due to a hardware failure as the
  126. # result of overvoltage) together with the WLAN key printed on the back of that
  127. # device *and* its MAC address (could be found at the "urlader environment" or may
  128. # be extracted from another computer, which had network access to the device
  129. # earlier - but it is send as "serial number" to AVMs DynDNS service and with
  130. # every TR-069 INFORM request too), you can try to decrypt the secret data from
  131. # that file, if you specify the two values mentioned above as parameters:
  132. #
  133. # decode_passwords wlan_key mac_address < input_file
  134. #
  135. # Currently this has been tested to be interoperable between the following
  136. # FRITZ!Box models:
  137. # 7270v1, 7270v2, 7270v3, 7390, 7490
  138. #
  139. # It does *not work* with a 6360 router, probably the IV for the AES encryption
  140. # will use some additional "device specific" data there.
  141. #
  142. # The 'mimicry' will *not work* with an exported configuration file. There is a
  143. # realistic possibility to import such a file, if you can fool the configuration
  144. # importer (/usr/www/cgi-bin/firmwarecfg or /usr/bin/tr069fwupdate) with a chroot
  145. # environment, but that's another story ...
  146. #
  147. # To check the ability of your device to mimicry another one, I've encoded a known
  148. # cleartext (username = "ippf@myfritz.net" and password = "1234567890") with a
  149. # 'faked' WLAN key (1234567890123456) and even a different MAC address value of
  150. # '11:22:33:44:55:66'. You can find the sample as (unreachable) shell code around
  151. # line 330.
  152. #
  153. # Prerequisites:
  154. # --------------
  155. # The whole script needs only a busybox with the following commands supported:
  156. # cat, sed, grep, mount/umount, cp, mkdir, date, echo, chroot, expr,
  157. # test (called as [)
  158. #
  159. # It's a matter of course that the 'webdavcfginfo' binary from the original firmware
  160. # has to be reachable (and that includes 'executable') too.
  161. #
  162. # If you create the lean and mean version, there are some more depedencies:
  163. # md5sum, chmod
  164. #
  165. # Just for fun:
  166. # The (imho) leanest version - with some additional limitations, but using the same
  167. # control flow - *could* be:
  168. #
  169. # b=/bin
  170. # l=/lib
  171. # f=/var/flash
  172. # t=/var/$$
  173. # m=mount
  174. # r=proc
  175. # mkdir -p $t$f $t$l $t$b $t/$r
  176. # cd $t
  177. # cat $*>i
  178. # sed -ne's/.*\(\$\$\$\$[A-Z1-6]*\).*/\1/p'<i>p
  179. # cat>s<<'Q'
  180. # q=\\\\
  181. # while read x;do
  182. # echo -e "$1$2 {$5=$x;}">$4
  183. # o="$($1$3 -p$5)"
  184. # o="${o//$q/$q$q}"
  185. # o="${o//|/\\|}"
  186. # o="${o//&/\\&}"
  187. # o="${o//\"/$q\"}"
  188. # echo "s|$x|$o|">>c
  189. # done<p
  190. # Q
  191. # $m -o bind $l .$l
  192. # $m -o bind $b .$b
  193. # $m -t $r . ./$r
  194. # chroot . sh s webdav client cfginfo $f/usb.cfg username
  195. # sed -fc<i
  196. # cd ..
  197. # u$m $t/$r $t$b $t$l
  198. # rm -r $t
  199. #
  200. # That version needs only 469 bytes on 30 lines and could do the basic job too. And
  201. # another benefit: You can specify one or more names of files to decode as arguments,
  202. # for example: 'sh micro_decode /var/flash/*.cfg'.
  203. # It's only a proof of concept and not intended for distribution from other sources.
  204. # Please respect that license limitation.
  205. #
  206. #######################################################################################
  207. #
  208. # the "abused" AVM binary
  209. #
  210. decode=/bin/webdavcfginfo
  211. if [ ! -x $decode ]; then
  212. # LAM-EXCLUDE 1
  213. echo "Missing $decode executable ..." 1>&2
  214. exit 126
  215. fi
  216. #
  217. # the config file name for the decoder above and the needed entries within
  218. #
  219. cfg=/var/flash/usb.cfg
  220. client=webdavclient
  221. username=username
  222. #
  223. # some file names pooled here for easy changes in case of conflicts
  224. #
  225. in=input
  226. enc=passwords
  227. sc=sedcmds
  228. ms=script
  229. ue=urenv
  230. shl=/bin/sh
  231. pm=/proc/mounts
  232. tddef=/var/tmp
  233. # LAM-EXCLUDE 1
  234. leanname=/var/decode_passwords
  235. #
  236. # here we'll store our temporary files ...
  237. #
  238. tmpdir=$([ -z $TMP ] && echo $tddef || echo $TMP)/dpwd-$$-$(date +%s)
  239. if [ ${#tmpdir} -lt 20 ]; then
  240. # LAM-EXCLUDE 1
  241. echo -e "The path to my temporary directory ($tmpdir) seems to be too short.\nAt least 20 characters are expected." 1>&2
  242. exit 125
  243. fi
  244. #
  245. # if we can write there
  246. #
  247. mkdir -p $tmpdir || exit 121
  248. #
  249. # to ease things in case of an error, we'll put together the needed commands for a clean exit and execute them using a trap
  250. #
  251. cleanup()
  252. {
  253. #
  254. # ensure a valid directory name first (shortest possible value is regexp('/./dpwd-[0-9]?-[0-9]{10,}') = 20)
  255. #
  256. [ ${#tmpdir} -lt 20 ] && return
  257. # LAM-EXCLUDE-MIMICRY-BEGIN
  258. #
  259. # unmount urlader environment first, if it was overlayed within our procfs
  260. #
  261. grep "${tmpdir}.*${urenv}" $pm | while read t mp m; do umount $mp; done
  262. # LAM-EXCLUDE-MIMICRY-END
  263. #
  264. # unmount everything linked under our temporary directory
  265. #
  266. grep $tmpdir/proc $pm | while read t mp m; do umount $mp; done
  267. grep $tmpdir/bin $pm | while read t mp m; do umount $mp; done
  268. grep $tmpdir/lib $pm | while read t mp m; do umount $mp; done
  269. grep $tmpdir $pm | while read t mp m; do umount $mp; done
  270. #
  271. # remove our temp files
  272. #
  273. [ -d $tmpdir ] && rm -r $tmpdir >/dev/null 2>&1
  274. }
  275. #
  276. # the next section is only necessary for "double use" to create the smaller version from the "well-documented" one
  277. #
  278. # LAM-EXCLUDE-BEGIN
  279. if [ x$1 == xleanandmean ]; then
  280. # reproduce a (temporary) lean and mean version of myself for easy transfer to a box within a shell session
  281. # - to exclude only a few lines from the output, add a line "# LAM-EXCLUDE n" before them where n is the number of following lines to ignore
  282. # - to exclude a continuous section, place "# LAM-EXCLUDE-BEGIN" and "# LAM-EXCLUDE-END" around it
  283. # the second parameter could be the name at the target system
  284. [ ${#2} -gt 0 ] && target=$2 || target=$leanname
  285. # the third argument (if any) is used to exclude the final hash check
  286. [ ${#3} -gt 0 ] && nomd5=1 || nomd5=0
  287. # exclude support for "foreign" encoded values from small version
  288. [ ${#4} -gt 0 ] && nomimicry=1 || nomimicry=0
  289. # build the small versions
  290. leanandmean()
  291. {
  292. out() { echo "$1" 1>&3 ; echo "$1" >>$tmpout; }
  293. local tmpout=$tmpdir/out$(date +%s)
  294. local tmpin=$tmpdir/in$(date +%s)
  295. local tmpcmd=$tmpdir/cmd$(date +%s)
  296. local mode=$1 nomim=$2 lineno lines
  297. out "#! $shl"
  298. cat $0 >$tmpin
  299. # remove all mimicry code first
  300. [ $nomim -eq 1 ] && sed -e '/^[ \t]*# LAM-EXCLUDE-MIMICRY-BEGIN/,/^[ \t]*# LAM-EXCLUDE-MIMICRY-END/d' -i $tmpin
  301. # remove all complete LAM-EXCLUDE sections
  302. sed -e '/^[ \t]*# LAM-EXCLUDE-BEGIN/,/^[ \t]*# LAM-EXCLUDE-END/d' -i $tmpin
  303. # now we will look for '# LAM-EXCLUDE n' comments
  304. touch $tmpcmd
  305. for lineno in $(sed -n -e '/^[ \t]*# LAM-EXCLUDE [0-9]*$/=' $tmpin); do
  306. lines=$(sed -n -e "${lineno}s/^.* \([0-9]*\).*$/\1/p" $tmpin)
  307. echo "${lineno},$(( lineno + lines ))d" >>$tmpcmd
  308. done
  309. [ -s $tmpcmd ] && sed -f $tmpcmd -i $tmpin
  310. sed -e '/^[ \t]*#.*/d' -e 's/^[ \t]*\(.*\)$/\1/' -i $tmpin
  311. cat $tmpin >>$tmpout
  312. cat $tmpin 1>&3
  313. echo $(md5sum $tmpout | sed -n -e 's/^\([0-9a-f]*\).*/\1/p')
  314. }
  315. # output the wrapper
  316. echo "cat >$target <<-\"LEANANDMEAN\""
  317. MD5=$(leanandmean ${1:0:1} $nomimicry) 3>&1
  318. echo "LEANANDMEAN"
  319. echo "chmod 550 $target"
  320. [ $nomd5 -eq 0 ] && echo "[ \$(md5sum <$target | sed -n -e 's/^\([0-9a-f]*\).*/\1/p') == $MD5 ] || echo \"Hash difference found, transmission failed.\" 1>&2"
  321. cleanup
  322. exit 0
  323. #
  324. # the unreachable code here can be used to check the 'mimicry' ability, copy the lines to a separate file, change them as needed and try it yourself
  325. #
  326. #! /bin/sh
  327. urenv=/proc/sys/urlader/environment
  328. key="wlan_key"
  329. mac="maca"
  330. decode="decode_passwords"
  331. encoded="username = \"\$\$\$\$GDAC24NUP3BNNQZ2SUWNFP2FH5ZLOA6ORXMYP1UOUEZE2UI3SYXXVVS15SRGNUW1C2I4V2FZLARCYKXO\";\npassword = \"\$\$\$\$WDLEUNJT1IJWZSQBBQMGXXXHTX2FV3ZQYMYCZPJEREFYXQ4CAYIWSXIXRVITC4HSA6AY65IRK5SSOKXO\";"
  332. original_key="$(sed -n -e "/^$key/s/^[^\t]*\t\(.*\)/\1/p" <$urenv)"
  333. original_mac="$(sed -n -e "/^$mac/s/^[^\t]*\t\(.*\)/\1/p" <$urenv)"
  334. delim="======================================================"
  335. echo $delim
  336. echo "original wlan key is '$original_key'"
  337. echo "original maca is '$original_mac'"
  338. echo "decode with original wlan key and maca ..."
  339. echo -e "$encoded" | $decode
  340. echo $delim
  341. echo "replace wlan key with '1234567890123456'"
  342. echo "replace maca with '11:22:33:44:55:66'"
  343. echo "decode now with replaced values ..."
  344. echo -e $encoded | $decode 1234567890123456 11:22:33:44:55:66
  345. echo $delim
  346. if echo -e $encoded | $decode 1234567890123456 11:22:33:44:55:66 | grep -q "ippf@myfritz.net"; then
  347. echo "Decoding with foreign $key and $mac is possible."
  348. else
  349. echo "Decoding with foreign $key and $mac is NOT POSSIBLE."
  350. fi
  351. #
  352. # end of embedded mimicry sample
  353. #
  354. fi
  355. # LAM-EXCLUDE-END
  356. # LAM-EXCLUDE-MIMICRY-BEGIN
  357. #
  358. # the "box specific" variables for the AES IV
  359. #
  360. key_name="wlan_key"
  361. mac_name="maca"
  362. #
  363. # and where to find them
  364. #
  365. urenv="/proc/sys/urlader/environment"
  366. #
  367. # check arguments - we do not expect any, if not "mimicry" is intended too or tty detection is set to off
  368. #
  369. igntty=0
  370. if [ ${#1} -gt 0 ]; then
  371. if [ ${#2} -eq 0 ]; then
  372. # LAM-EXCLUDE 4
  373. if [ x$1 != xtty ]; then
  374. echo "Usage: $0 {${key_name}} {${mac_name}} <{config_file}" 1>&2
  375. echo "- decode {config_file} from a foreign box which had the specified {${key_name}} and {${mac_name}} address" 1>&2
  376. echo "- if called without {${key_name}} and {${mac_name}}, decode with settings from the box where the script is running" 1>&2
  377. exit 127
  378. # LAM-EXCLUDE 3
  379. else
  380. igntty=1
  381. fi
  382. else
  383. key="$1"
  384. mac="$2"
  385. if [ ${#key} -ne 16 -a ${#key} -ne 20 ] || [ -n "$(echo -n ${key} | sed -e 's/[0-9]//g')" ]; then
  386. # LAM-EXCLUDE 1
  387. echo "The specified ${key_name} is unusual, it should be composed of 16 or 20 decimal digits." 1>&2
  388. exit 123
  389. fi
  390. if [ -n "$(echo -n ${mac} | sed -e 's/^\([0-9A-F]\{2\}:\)\{5\}[0-9A-F]\{2\}$//')" ]; then
  391. # LAM-EXCLUDE 1
  392. echo "The specified ${mac_name} address is invalid, only hexadecimal digits (with A to F in uppercase) and double colons are permitted (hh:hh:hh:hh:hh:hh)." 1>&2
  393. exit 124
  394. fi
  395. fi
  396. fi
  397. # LAM-EXCLUDE-MIMICRY-END
  398. # get list of files to incorporate into the chroot environment
  399. chroot_files() { cat <<-EOT
  400. # list of files/actions for chroot jail preparation
  401. #
  402. # type params action
  403. # D <dir> create directory <dir>
  404. # E <dst> create empty file (with "echo -n" for correct character device handling at TFFS) <dst>
  405. # M <type> <src> <dst> mount file system of type <type> from <src> at <dst>
  406. # B <src> <dst> bind mount from <src> to <dst>
  407. D var/flash
  408. E $cfg
  409. M proc none proc
  410. B bin $1/bin
  411. B lib $1/lib
  412. EOT
  413. }
  414. #
  415. # prepare the chroot environment for the decoder utility
  416. #
  417. prepare_chroot()
  418. {
  419. rel_path() { [ -z $1 ] && return 1; [ ${1:0:1} == / ] && echo ${1:1} || echo $1; }
  420. dir_path() { [ -z $1 ] && return 1; [ ${1%/*} == $1 ] && echo -n || echo ${1%/*}; }
  421. c=$1
  422. while read line; do
  423. set -- $line
  424. case $1 in
  425. D)
  426. p=$c/$(rel_path $2); mkdir -p $p
  427. ;;
  428. E)
  429. d=$c/$(rel_path $2); mkdir -p $(dir_path $d); echo -n >$d
  430. ;;
  431. M)
  432. t=$2; s=$3; d=$c/$(rel_path $4); mkdir -p $d; mount -t $t $s $d
  433. ;;
  434. B)
  435. s=/$(rel_path $2); d=/$(rel_path $3); mkdir -p $d; mount -o bind $s $d
  436. ;;
  437. *)
  438. ;;
  439. esac
  440. done
  441. }
  442. #
  443. # setup a trap for possible condition, not all will work as expected
  444. #
  445. trap 'cleanup' EXIT HUP
  446. #
  447. # We expect our input via stdin and save it for repeated use to a temporary file.
  448. #
  449. if [ -t 0 -a $igntty -eq 0 ]; then
  450. # LAM-EXCLUDE 1
  451. echo -e "It looks like you've missed redirecting any input data to that script.\nFor intentional reading of stdin from a terminal, specify 'tty' as first argument." 1>&2
  452. exit 122
  453. fi
  454. [ -L /proc/self/fd/3 ] && fd=3 || fd=0
  455. cat /proc/self/fd/$fd >$tmpdir/$in
  456. #
  457. # an empty input file isn't an error, but we can avoid all that stress
  458. #
  459. [ ! -s $tmpdir/$in ] && exit 0
  460. #
  461. # extract all encrypted data from input and put each item on a single line in 'passwords'
  462. #
  463. sed -n -e 's/.*\(\$\$\$\$[A-Z1-6]*\).*/\1/p' <$tmpdir/$in >$tmpdir/$enc
  464. #
  465. # We'll use sed to write the converted file to stdout later, so we have to make sure,
  466. # there's a command file (even if it's empty) for the final sed call.
  467. #
  468. touch $tmpdir/$sc
  469. #
  470. # prepare the chroot environment now, if there's something to decode
  471. #
  472. if [ x$(sed -e "/^[ \t]*$/d" $tmpdir/$enc | sed -n -e '$=') != x ]; then
  473. chroot_files $tmpdir | prepare_chroot $tmpdir
  474. #
  475. # that's the part which will be called within the chroot environment, we'll write it to a file there
  476. # some substitutions will take place here, remember to escape runtime variable references
  477. #
  478. cat >$tmpdir/$ms <<-ENDOFWORKER
  479. while read in; do
  480. # prepare config file
  481. echo -n -e "$client {\n\t$username = \"\$in\";\n}" >$cfg
  482. # let it decode
  483. out="\$($decode -p username)"
  484. # if the decoded text is empty, no escaping is needed
  485. if [ \${#out} -gt 0 ]; then
  486. # backslash is escape, we've to double each occurence
  487. out="\${out//\\\\\\\\/\\\\\\\\\\\\\\\\}"
  488. # ampersand means matched expression but we want the pure character
  489. out="\${out//&/\\\\&}"
  490. # pipe symbol is our delimiter, escape it too
  491. out="\${out//|/\\\\|}"
  492. # and last but not least the original AVM implementation had escaped
  493. # any embedded double quotes, so we'll do that too
  494. out="\${out//\"/\\\\\\\\\"}"
  495. fi
  496. # output the s-command for later execution
  497. echo "s|\${in}|\${out}|g" >>/$sc
  498. done </$enc
  499. ENDOFWORKER
  500. # LAM-EXCLUDE 2
  501. # not really needed, but let's remove comments from worker, if it's not the lean version, you may want to comment out that step
  502. sed -e '/^[ \t]*#.*/d' -i $tmpdir/$ms
  503. # LAM-EXCLUDE-MIMICRY-BEGIN
  504. if [ ${#key} -gt 0 -a ${#mac} -gt 0 ]; then
  505. sed -e "/^${key_name}/s/^\([^\t]*\t\).*/\1${key}/" -e "/^${mac_name}/s/^\([^\t]*\t\).*/\1${mac}/" <$tmpdir$urenv >$tmpdir/$ue
  506. mount -o bind $tmpdir/$ue $tmpdir$urenv
  507. fi
  508. # LAM-EXCLUDE-MIMICRY-END
  509. #
  510. # call ourself within the jail
  511. #
  512. chroot $tmpdir $shl /$ms
  513. fi
  514. #
  515. # let sed change the input and do the output to stdout with one step
  516. #
  517. sed -f $tmpdir/$sc <$tmpdir/$in
  518. #
  519. # remember that 'cleanup' will take place here via a trap condition
  520. #
  521. exit 0
Add Comment
Please, Sign In to add comment