halfwit / x9srv

srv and srvtls emulation for POSIX systems

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

x9srv

  • *THIS IS A WORK IN PROGRESS *

x9srv provides authsrv, bind, tlssrv, cpu and exportfs, suitable for interacting with 9front

libmp, libsec, libauthsrv are adapted from 9front and Aiju's code in jsdrawterm

libc9 is from sigrid's c9

libexportfs is a statically linked lib pulled from 9front's drawterm. It was linked against amd64

Building

Requires plan9port

mk all && mk install

authsrv

authsrv expects there to be at least the following files and directories in the chroot:

  • /lib/ndb/auth
  • /adm/$user
  • /adm/$user/secret
  • /adm/$user/key

You can use passtokey from authsrv9 to generate keys, following the guide at https://www.ueber.net/who/mjl/plan9/plan9-obsd.html This is an incomplete version of authsrv, but should suffice for simple file shares and sessions.

exportfs

See exportfs(4)

tlssrv, tlsclient

See tlssrv(8)

Usage

listen1 -t 'tcp!*!564' exportfs

# Start a normal cpu listener
listen1 -t 'tcp!*!17010' cpu -R

# Start an authsrv listener
listen1 -t 'tcp!*!567' authsrv

rcpu listener setup - probably broken

#!/bin/rc

fn server {
	# WIP!
	tmp=`{mktemp -d}
	$PLAN9/bin/disk/mkfs -d $tmp /path/to/a/proto

	# Try to chroot and read commands from the remote connection
	/usr/sbin/chroot $tmp /bin/rc <{n=`{read} && ! ~ $#n 0 && read -c $n} >[2=]
}

listen1 -t 'tcp!*!17019' tlssrv -a /bin/rc -c server

About

srv and srvtls emulation for POSIX systems


Languages

Language:C 96.2%Language:C++ 2.9%Language:Makefile 0.6%Language:Shell 0.3%