* [9front] webpaste: fail if file unreadable
@ 2017-06-09 14:59 raiz
2017-06-09 16:30 ` Kurt H Maier
0 siblings, 1 reply; 5+ messages in thread
From: raiz @ 2017-06-09 14:59 UTC (permalink / raw)
To: 9front
diff -r 7afc70a22b58 rc/bin/webpaste
--- a/rc/bin/webpaste Thu Jun 08 09:08:59 2017 +0200
+++ b/rc/bin/webpaste Fri Jun 09 17:57:11 2017 +0300
@@ -3,6 +3,8 @@
file=/fd/0
if not
file=$1
+test -r $file || echo unreadable file && exit unreadable
+
hpost -u http://okturing.com -p / a_body@$file submit:submit fake:fake
a_func:add_post url: |
grep -e '\/body\"' |
sed 1q | sed 's/^.*href=\"//g; s/body\".*$/body/g'
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [9front] webpaste: fail if file unreadable
2017-06-09 14:59 [9front] webpaste: fail if file unreadable raiz
@ 2017-06-09 16:30 ` Kurt H Maier
2017-06-09 23:40 ` raiz
0 siblings, 1 reply; 5+ messages in thread
From: Kurt H Maier @ 2017-06-09 16:30 UTC (permalink / raw)
To: 9front
On Fri, Jun 09, 2017 at 02:59:14PM +0000, raiz@firemail.cc wrote:
> diff -r 7afc70a22b58 rc/bin/webpaste
> --- a/rc/bin/webpaste Thu Jun 08 09:08:59 2017 +0200
> +++ b/rc/bin/webpaste Fri Jun 09 17:57:11 2017 +0300
> @@ -3,6 +3,8 @@
> file=/fd/0
> if not
> file=$1
> +test -r $file || echo unreadable file && exit unreadable
> +
> hpost -u http://okturing.com -p / a_body@$file submit:submit fake:fake
> a_func:add_post url: |
> grep -e '\/body\"' |
> sed 1q | sed 's/^.*href=\"//g; s/body\".*$/body/g'
Shouldn't this test be in hpost?
khm
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [9front] webpaste: fail if file unreadable
2017-06-09 16:30 ` Kurt H Maier
@ 2017-06-09 23:40 ` raiz
2017-06-10 7:42 ` Kurt H Maier
0 siblings, 1 reply; 5+ messages in thread
From: raiz @ 2017-06-09 23:40 UTC (permalink / raw)
To: 9front; +Cc: Kurt H Maier
On 2017-06-09 16:30, Kurt H Maier wrote:
> On Fri, Jun 09, 2017 at 02:59:14PM +0000, raiz@firemail.cc wrote:
>> diff -r 7afc70a22b58 rc/bin/webpaste
>> --- a/rc/bin/webpaste Thu Jun 08 09:08:59 2017 +0200
>> +++ b/rc/bin/webpaste Fri Jun 09 17:57:11 2017 +0300
>> @@ -3,6 +3,8 @@
>> file=/fd/0
>> if not
>> file=$1
>> +test -r $file || echo unreadable file && exit unreadable
>> +
>> hpost -u http://okturing.com -p / a_body@$file submit:submit
>> fake:fake
>> a_func:add_post url: |
>> grep -e '\/body\"' |
>> sed 1q | sed 's/^.*href=\"//g; s/body\".*$/body/g'
>
>
> Shouldn't this test be in hpost?
>
> khm
it doesn't fail though
cpu% ./webpaste -h
Usage: urlencode [ -d ] [ file ]
http://okturing.com/src/1378/body
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [9front] webpaste: fail if file unreadable
2017-06-09 23:40 ` raiz
@ 2017-06-10 7:42 ` Kurt H Maier
2017-06-10 15:09 ` raiz
0 siblings, 1 reply; 5+ messages in thread
From: Kurt H Maier @ 2017-06-10 7:42 UTC (permalink / raw)
To: 9front
On Fri, Jun 09, 2017 at 11:40:44PM +0000, raiz@firemail.cc wrote:
>
> it doesn't fail though
>
I'm advocating that hpost should test for an unreadable file, not
webpaste.
khm
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [9front] webpaste: fail if file unreadable
2017-06-10 7:42 ` Kurt H Maier
@ 2017-06-10 15:09 ` raiz
0 siblings, 0 replies; 5+ messages in thread
From: raiz @ 2017-06-10 15:09 UTC (permalink / raw)
To: 9front; +Cc: Kurt H Maier
On 2017-06-10 07:42, Kurt H Maier wrote:
>
> I'm advocating that hpost should test for an unreadable file, not
> webpaste.
>
> khm
diff -r 7afc70a22b58 rc/bin/hpost
--- a/rc/bin/hpost Thu Jun 08 09:08:59 2017 +0200
+++ b/rc/bin/hpost Sat Jun 10 18:07:05 2017 +0300
@@ -40,6 +40,14 @@
shift
}
+for(i in $af){
+ file=`{echo $i | awk -F@ '{ print $2 }'}
+ if(! test -r $file){
+ echo unreadable file: $file >[1=2]
+ exit unreadable
+ }
+}
+
hpost=(hpost $l)
fn uenc {
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-06-10 15:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-09 14:59 [9front] webpaste: fail if file unreadable raiz
2017-06-09 16:30 ` Kurt H Maier
2017-06-09 23:40 ` raiz
2017-06-10 7:42 ` Kurt H Maier
2017-06-10 15:09 ` raiz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).