Skip to content

Latest commit

 

History

History

pcserver

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
The code in this directory is derived from an old TCP/IP filesystem server I
built for my TCIP/IP over Serial implementation in the GeckOS operating system.
In the beginning it was in fact almost unchanged, but has evolved a lot since
then.


BUILD
-----

Just type

	make

on a Linux box with gcc installed. You need to have "libcurl" installed
for the FTP and HTTP protocol support.

Note that you may need to enter your sudo password to allow to Setuid the
executables and chown them to root. 


RUN
---

Type

	make run

to start the server, publishing the samples directory. 
The XS1541 device must be connected to /dev/ttyUSB0
The code drops privileges as soon as it has aquired and configured
the serial device (or set up the TCP/IP listen). So any
file operations happen with the privileges of the starting user.
(Note: tested on Linux only)

Alternatively do not setuid the executable, but then you need to be 
root to run them and they don't drop privileges!
Even better: make the USB device user-accessible, so no extra
permissions are needed.


TODO
----

	- check with systems where char is two-byte (are there?)
	  Anyway, the signedness stuff is a mess
	- Code is partly cruft from 20 years ago. Coding style has
	  changed a lot since then...