Skip to content

Commit 7ce65f1

Browse files
committed
Push v0.03
1 parent a8eeef7 commit 7ce65f1

File tree

4 files changed

+10
-16
lines changed

4 files changed

+10
-16
lines changed

CHANGES.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# v0.03: lewismc: 2021/01/21 ensure bash-httpd will run as of 2021...!
2+
# bash-httpd, by Morty Abzug <[email protected]>
3+
# v0.02: morty: 1998/11/22: does simple file queries
4+
# v0.01: morty: 1998/11/??: proof of concept

LICENSE.txt

100644100755
File mode changed.

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ you should do with it, and what you shouldn't.
1919
```console
2020
foo@bar:~$ git clone https://github.com/lewismc/bash-httpd.git
2121
foo@bar:~$ sudo ln -s /path/to/bash-httpd/bash-httpd-0.03.sh /usr/local/bin/bash-httpd
22+
foo@bar:~$ mkdir www // put your files in this directory
2223
```
23-
Then edit the config variables at the beginning of the script. You may need to insert a line for it in /etc/inetd.conf, running as nobody. You probably also want to wrap the port.
24+
Then edit the config variables at the beginning of the script tyo suit your environment. You may need to insert a line for it in /etc/inetd.conf, running as nobody. You probably also want to wrap the port.
2425

2526
If you're not root, get ahold of Netcat, preferably compile it with -DGAPING_SECURITY_HOLE (because it *is* a gaping security hole), and run:
2627
```console

bash-httpd-0.02.sh renamed to bash-httpd-0.03.sh

+4-15
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
#!/bin/bash
2-
3-
# bash-httpd, by Morty Abzug <[email protected]>
4-
# v0.02: morty: 1998/11/22: does simple file queries
5-
# v0.01: morty: 1998/11/??: proof of concept
6-
72
# Configurable variables
8-
PATH=/bin:/usr/bin
9-
DOC_ROOT=~morty/www/server
3+
PATH=/bin:/usr/bin:/usr/local/bin
4+
DOC_ROOT=~/Downloads/bash-httpd/www/
105
DEF_HTML=index.html
116
DEF_DIR=www
127
LOG_FACILITY=local1
13-
148
# End of configurables
159
HTTP_VERSION="HTTP/1.0"
1610
SERVER="bash-httpd/0.02"
@@ -40,9 +34,7 @@ error(){
4034
if [ "$2" ]; then problem="$2"; else problem="$err"; fi
4135
cat <<EOF
4236
Content-Type: text/html
43-
44-
<html> <head> <title> $problem </title>
45-
<body> <h1> $num $problem </h1> $problem </body> </html>
37+
<!DOCTYPE html><html><head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><title> $problem </title></head><body><h1> $num $problem </h1> $problem </body></html>
4638
EOF
4739
log err "$problem"
4840
exit 1
@@ -53,8 +45,6 @@ log(){
5345
logger -p $LOG_FACILITY."$level" "$program[$$]: $method $url $version: $message"
5446
}
5547

56-
57-
5848
read method url version
5949

6050
method="${method%$CR}";
@@ -123,5 +113,4 @@ case $type in
123113
*)
124114
error 501 "Messed up internal type"
125115
;;
126-
esac
127-
116+
esac

0 commit comments

Comments
 (0)