[hackers] [diri] fixed bogon's setvars version (did not worked with POST data @suckless.org)

From: <arg_AT_suckless.org>
Date: Mon Feb 12 10:09:22 2007

changeset: 61:ca19aef67e84
tag: tip
user: arg_AT_suckless.org
date: Mon Feb 12 10:05:08 2007 +0100
summary: fixed bogon's setvars version (did not worked with POST data @suckless.org)

diff -r 3fc61d6fa5b2 -r ca19aef67e84 remove.rc
--- a/remove.rc Mon Feb 12 09:38:56 2007 +0100
+++ b/remove.rc Mon Feb 12 10:05:08 2007 +0100
@@ -8,7 +8,7 @@ fn redirect {
 }
 
 fn setvars {
- while(input=`{read}) {
+ for(input in `{sed 's/\&/ /g'}) {
                 for(var) {
                         if(echo $"input | grep -s '^'$"var'=') {
                                 value=`{echo $"input | sed 's/^'$"var'=//'}
diff -r 3fc61d6fa5b2 -r ca19aef67e84 save.rc
--- a/save.rc Mon Feb 12 09:38:56 2007 +0100
+++ b/save.rc Mon Feb 12 10:05:08 2007 +0100
@@ -1,4 +1,4 @@
-#!/usr/local/plan9/bin/rc
+#!/usr/local/plan9/bin/rc -x
 . /var/www/dirirc
 
 fn redirect {
@@ -8,7 +8,7 @@ fn redirect {
 }
 
 fn setvars {
- while(input=`{read}) {
+ for(input in `{sed 's/\&/ /g'}) {
                 for(var) {
                         if(echo $"input | grep -s '^'$"var'=') {
                                 value=`{echo $"input | sed 's/^'$"var'=//'}
@@ -23,7 +23,7 @@ PATH_INFO=`{cleanname $PATH_INFO | sed '
 PATH_INFO=`{cleanname $PATH_INFO | sed 's/^.//'}
 if(test -d $DIRIDIR/$PATH_INFO)
         redirect $SHOW/$PATH_INFO
-setvars password text
+setvars text password
 if(test $password)
         password=`{echo -n $password | $URLDECODE | $HASHCMD}
 if not
Received on Mon Feb 12 2007 - 10:09:22 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:55:12 UTC