9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] tlsclient and hjgit for unix.
@ 2021-02-20 22:32 Jacob Moody
  2021-02-20 23:39 ` sl
  2021-02-21  2:23 ` ori
  0 siblings, 2 replies; 8+ messages in thread
From: Jacob Moody @ 2021-02-20 22:32 UTC (permalink / raw)
  To: 9front

Hello all,

Ori has suggested that I make an announcement about this here.
I have recently pillaged drawterm and jsdrawterm to pull out
code to make a standalone tlsclient for unix and friends.

With this comes 9cpu(a poor man's drawterm -G) and a
git remote helper that allows authenticated pushes and pulls
from git9 served repositories over hjgit.

You can find the source for it on shithub:
http://shithub.us/moody/tlsclient/HEAD/info.html


Thanks,
moody

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9front] tlsclient and hjgit for unix.
  2021-02-20 22:32 [9front] tlsclient and hjgit for unix Jacob Moody
@ 2021-02-20 23:39 ` sl
  2021-02-21  0:24   ` ori
  2021-02-21  2:23 ` ori
  1 sibling, 1 reply; 8+ messages in thread
From: sl @ 2021-02-20 23:39 UTC (permalink / raw)
  To: 9front

awesome! i have immediate use for this.

on openbsd, build dies here:

gcc -Wall -Wno-missing-braces -Wno-parentheses -ggdb -I.. -I../include -c -D_THREAD_SAFE -O2  -c genrandom.c
genrandom.c:6:24: error: sys/random.h: No such file or directory
genrandom.c: In function 'genrandom':
genrandom.c:11: warning: implicit declaration of function 'getrandom'
*** Error 1 in libc (<sys.mk>:87 'genrandom.o')
*** Error 2 in /home/sl/src/tlsclient (Makefile:34 'libc/libc.a')

sl

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9front] tlsclient and hjgit for unix.
  2021-02-20 23:39 ` sl
@ 2021-02-21  0:24   ` ori
  2021-02-21  1:39     ` Stanley Lieber
  0 siblings, 1 reply; 8+ messages in thread
From: ori @ 2021-02-21  0:24 UTC (permalink / raw)
  To: 9front

Quoth sl@stanleylieber.com:
> awesome! i have immediate use for this.
> 
> on openbsd, build dies here:
> 
> gcc -Wall -Wno-missing-braces -Wno-parentheses -ggdb -I.. -I../include -c -D_THREAD_SAFE -O2  -c genrandom.c
> genrandom.c:6:24: error: sys/random.h: No such file or directory
> genrandom.c: In function 'genrandom':
> genrandom.c:11: warning: implicit declaration of function 'getrandom'
> *** Error 1 in libc (<sys.mk>:87 'genrandom.o')
> *** Error 2 in /home/sl/src/tlsclient (Makefile:34 'libc/libc.a')
> 
> sl

Give this a shot.
It should work at least on FreeBSD, OpenBSD, and Ubuntu.


diff --git a/libc/genrandom.c b/libc/genrandom.c
index 42522aa..890c291 100644
--- a/libc/genrandom.c
+++ b/libc/genrandom.c
@@ -3,10 +3,10 @@
 
 #undef long
 #undef ulong
-#include <sys/random.h>
+#include <unistd.h>
 
 void
 genrandom(uchar *buf, int nbytes)
 {
-	getrandom(buf, nbytes, 0);
+	getentropy(buf, nbytes);
 }


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9front] tlsclient and hjgit for unix.
  2021-02-21  0:24   ` ori
@ 2021-02-21  1:39     ` Stanley Lieber
  2021-02-21  2:43       ` Jacob Moody
  0 siblings, 1 reply; 8+ messages in thread
From: Stanley Lieber @ 2021-02-21  1:39 UTC (permalink / raw)
  To: 9front

On February 20, 2021 7:24:50 PM EST, ori@eigenstate.org wrote:
>Quoth sl@stanleylieber.com:
>> awesome! i have immediate use for this.
>> 
>> on openbsd, build dies here:
>> 
>> gcc -Wall -Wno-missing-braces -Wno-parentheses -ggdb -I.. -I../include -c -D_THREAD_SAFE -O2  -c genrandom.c
>> genrandom.c:6:24: error: sys/random.h: No such file or directory
>> genrandom.c: In function 'genrandom':
>> genrandom.c:11: warning: implicit declaration of function 'getrandom'
>> *** Error 1 in libc (<sys.mk>:87 'genrandom.o')
>> *** Error 2 in /home/sl/src/tlsclient (Makefile:34 'libc/libc.a')
>> 
>> sl
>
>Give this a shot.
>It should work at least on FreeBSD, OpenBSD, and Ubuntu.
>
>
>diff --git a/libc/genrandom.c b/libc/genrandom.c
>index 42522aa..890c291 100644
>--- a/libc/genrandom.c
>+++ b/libc/genrandom.c
>@@ -3,10 +3,10 @@
> 
> #undef long
> #undef ulong
>-#include <sys/random.h>
>+#include <unistd.h>
> 
> void
> genrandom(uchar *buf, int nbytes)
> {
>-	getrandom(buf, nbytes, 0);
>+	getentropy(buf, nbytes);
> }
>
>

that worked, thanks.

now:

rachael$ 9cpu                                          
./9cpu[35]: syntax error: `(' unexpected

sl

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9front] tlsclient and hjgit for unix.
  2021-02-20 22:32 [9front] tlsclient and hjgit for unix Jacob Moody
  2021-02-20 23:39 ` sl
@ 2021-02-21  2:23 ` ori
  1 sibling, 0 replies; 8+ messages in thread
From: ori @ 2021-02-21  2:23 UTC (permalink / raw)
  To: 9front

Quoth Jacob Moody <moody@mail.posixcafe.org>:
> Hello all,
> 
> Ori has suggested that I make an announcement about this here.
> I have recently pillaged drawterm and jsdrawterm to pull out
> code to make a standalone tlsclient for unix and friends.
> 
> With this comes 9cpu(a poor man's drawterm -G) and a
> git remote helper that allows authenticated pushes and pulls
> from git9 served repositories over hjgit.
> 
> You can find the source for it on shithub:
> http://shithub.us/moody/tlsclient/HEAD/info.html

Awesome, thanks for doing this. I'll update
shithub with instructions on how to push from
Unix.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9front] tlsclient and hjgit for unix.
  2021-02-21  1:39     ` Stanley Lieber
@ 2021-02-21  2:43       ` Jacob Moody
  2021-02-21  9:49         ` J D
  0 siblings, 1 reply; 8+ messages in thread
From: Jacob Moody @ 2021-02-21  2:43 UTC (permalink / raw)
  To: 9front

> On February 20, 2021 7:24:50 PM EST, ori@eigenstate.org wrote:> diff --git a/libc/genrandom.c b/libc/genrandom.c> index 42522aa..890c291 100644> --- a/libc/genrandom.c> +++ b/libc/genrandom.c> @@ -3,10 +3,10 @@>> #undef long> #undef ulong> -#include <sys/random.h>> +#include <unistd.h>>> void> genrandom(uchar *buf, int nbytes)> {> -	getrandom(buf, nbytes, 0);> +	getentropy(buf, nbytes);> }>
Thank ori this should be applied now.

On 2/20/21 7:39 PM, Stanley Lieber wrote:
> rachael$ 9cpu                                          
> ./9cpu[35]: syntax error: `(' unexpected
> 

Try running it with ksh instead or changing the bang line to ksh.
It's erroring out on the process substitution.
Not sure what the best way to handle this is(for using the right shell
for the right system).


Thanks,
moody

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9front] tlsclient and hjgit for unix.
  2021-02-21  2:43       ` Jacob Moody
@ 2021-02-21  9:49         ` J D
  2021-02-21 16:01           ` Stanley Lieber
  0 siblings, 1 reply; 8+ messages in thread
From: J D @ 2021-02-21  9:49 UTC (permalink / raw)
  To: 9front

On Sat, Feb 20, 2021 at 8:05 PM Jacob Moody <moody@mail.posixcafe.org> wrote:
>
> > On February 20, 2021 7:24:50 PM EST, ori@eigenstate.org wrote:> diff --git a/libc/genrandom.c b/libc/genrandom.c> index 42522aa..890c291 100644> --- a/libc/genrandom.c> +++ b/libc/genrandom.c> @@ -3,10 +3,10 @@>> #undef long> #undef ulong> -#include <sys/random.h>> +#include <unistd.h>>> void> genrandom(uchar *buf, int nbytes)> {> -        getrandom(buf, nbytes, 0);> +   getentropy(buf, nbytes);> }>
> Thank ori this should be applied now.
>
> On 2/20/21 7:39 PM, Stanley Lieber wrote:
> > rachael$ 9cpu
> > ./9cpu[35]: syntax error: `(' unexpected
> >
>
> Try running it with ksh instead or changing the bang line to ksh.
> It's erroring out on the process substitution.
> Not sure what the best way to handle this is(for using the right shell
> for the right system).
>
>
> Thanks,
> moody

Hopefully HTML is not rudely inserted into my email this time by the
evil google.

Maybe instead of

USER=$user AUTH=$auth CPU=$cpu tlsclient -p 17019 sh <(cat <<EOF
printf '%7ld\n' $len
echo $cmd
cat </dev/tty 2>/dev/null &
cat >/dev/tty 2>/dev/null
EOF
)

Try

{
cat <<EOF
printf '%7ld\n' $len
echo $cmd
cat </dev/tty 2>/dev/null &
cat >/dev/tty 2>/dev/null
EOF
} |  USER=$user AUTH=$auth CPU=$cpu tlsclient -p 17019 sh

I'm not in a position to test this, but it should be fine, assuming
I haven't misunderstood something (likely I have). If this works, it is
also POSIX compliant behavior, as opposed to relying on ksh or
some particular shell.

Please don't yell at me for mentioning POSIX on this list :)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9front] tlsclient and hjgit for unix.
  2021-02-21  9:49         ` J D
@ 2021-02-21 16:01           ` Stanley Lieber
  0 siblings, 0 replies; 8+ messages in thread
From: Stanley Lieber @ 2021-02-21 16:01 UTC (permalink / raw)
  To: 9front

On February 21, 2021 4:49:34 AM EST, J D <jakdecidus@gmail.com> wrote:
>On Sat, Feb 20, 2021 at 8:05 PM Jacob Moody <moody@mail.posixcafe.org> wrote:
>>
>> > On February 20, 2021 7:24:50 PM EST, ori@eigenstate.org wrote:> diff --git a/libc/genrandom.c b/libc/genrandom.c> index 42522aa..890c291 100644> --- a/libc/genrandom.c> +++ b/libc/genrandom.c> @@ -3,10 +3,10 @@>> #undef long> #undef ulong> -#include <sys/random.h>> +#include <unistd.h>>> void> genrandom(uchar *buf, int nbytes)> {> -        getrandom(buf, nbytes, 0);> +   getentropy(buf, nbytes);> }>
>> Thank ori this should be applied now.
>>
>> On 2/20/21 7:39 PM, Stanley Lieber wrote:
>> > rachael$ 9cpu
>> > ./9cpu[35]: syntax error: `(' unexpected
>> >
>>
>> Try running it with ksh instead or changing the bang line to ksh.
>> It's erroring out on the process substitution.
>> Not sure what the best way to handle this is(for using the right shell
>> for the right system).
>>
>>
>> Thanks,
>> moody
>
>Hopefully HTML is not rudely inserted into my email this time by the
>evil google.
>
>Maybe instead of
>
>USER=$user AUTH=$auth CPU=$cpu tlsclient -p 17019 sh <(cat <<EOF
>printf '%7ld\n' $len
>echo $cmd
>cat </dev/tty 2>/dev/null &
>cat >/dev/tty 2>/dev/null
>EOF
>)
>
>Try
>
>{
>cat <<EOF
>printf '%7ld\n' $len
>echo $cmd
>cat </dev/tty 2>/dev/null &
>cat >/dev/tty 2>/dev/null
>EOF
>} |  USER=$user AUTH=$auth CPU=$cpu tlsclient -p 17019 sh
>
>I'm not in a position to test this, but it should be fine, assuming
>I haven't misunderstood something (likely I have). If this works, it is
>also POSIX compliant behavior, as opposed to relying on ksh or
>some particular shell.
>
>Please don't yell at me for mentioning POSIX on this list :)
>

on openbsd sh *is* ksh (well, pdksh):

rachael$ cmp /bin/sh /bin/ksh                          rachael$

sl

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-02-21 18:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-20 22:32 [9front] tlsclient and hjgit for unix Jacob Moody
2021-02-20 23:39 ` sl
2021-02-21  0:24   ` ori
2021-02-21  1:39     ` Stanley Lieber
2021-02-21  2:43       ` Jacob Moody
2021-02-21  9:49         ` J D
2021-02-21 16:01           ` Stanley Lieber
2021-02-21  2:23 ` ori

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).