GithubHelp home page GithubHelp logo

sai2791 / aund Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 4.0 632 KB

Linux Econet Server (Acorn computers - 8-bit with 32-bit support)

Makefile 15.40% C 62.36% Roff 3.18% Shell 18.51% M4 0.49% Vim Script 0.06%

aund's Introduction

aund is a program to allow a Unix system to act as an AUN or Econet
fileserver.  It supports:

* Clients from System 3 to RISC OS 3.70 (and probably later)
* Servers running Linux, NetBSD and probably others
* Connectivity by AUN (over UDP) or BeebEm emulated Econet
* Read/write operation
* Multiple virtual users (all under one Unix UID)
* Individual users (all under one Unix UID) with passwords and Privilege flags
* Owner permission on directories under the users URD
* Access permissions now supported
* Locked files now supported
* File Server can now be any station number not just 254
* NEWUSER command has been implemented, you can use NEWUSER user, or 
  NEWUSER group.user.  The login directory will be created based on what
  you entered.  Note: You cannot have a user created with the same name
  as a group.
* REMUSER command has been implemented.  This does not remove the user
  files or directory structure.

For general installation instructions, see the INSTALL file.  aund is
not particularly portable, and expects a BSDish or GNUish C library.
Building it on other systems is likely to be unpleasant.

aund is highly experimental and likely to have bugs.  Patches to fix
these will be gratefully received by Ben Harris <[email protected]>.
aund has a Web site at <http://bjh21.me.uk/aund/>.

Among aund's bugs are likely to be several that make it unsafe to run
on an untrustworthy network.  In any case, the fileserver protocol it
uses has serious security flaws.  In short, keep it off the Internet.

aund itself is released under the following licence:

Copyright (c) 1998, 2010 Ben Harris
Copyright (c) 2010 Simon Tatham
Copyright (c) 2010 James Woodcock
Copyright (c) 2015, 2021 Steve Inglis
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
   notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions and the following disclaimer in the
   documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
   derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Various parts of its build system are derived from Automake, and these
have their own copyright information embedded in them.

aund's People

Contributors

mjwoodcock avatar sai2791 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

aund's Issues

Link fails with library crypt missing on Raspberry Pi

Building on a raspberry pi gives an error when linking the files together because it cannot find the crypt library.

Workaround for now is to compile from the command line using

gcc -lcrypt -Wall -Wdeclaration-after-statement -Wold-style-definition -Wmissing-prototypes -Wredundant-decls -Wno-pointer-sign -Wno-uninitialized -g -O2 -o aund aund.o fileserver.o fs_cli.o fs_examine.o fs_fileio.o fs_misc.o fs_handle.o fs_util.o fs_error.o fs_nametrans.o fs_filetype.o aun.o beebem.o pw.o user_null.o libconf_lex.a

The "null" user management option has missing methods, results in coredump.

When running with the null user managment option, which seems to be the default with the supplied example config file, logging on (*I AM) causes a segmentation fault when trying to invoke:

c->client->priv = userfuncs->get_priv(c->client->login);

in fs_cmd_i_am in fs_cli.c. This is because this method, and several others, are not defined for this user option which has:

struct user_funcs const user_null = {
	null_validate, null_urd, null_change, null_set_opt4
};

compared with:

struct user_funcs const user_pw = {
	pw_validate, pw_urd, pw_change, pw_set_opt4, pw_set_priv, pw_get_priv,
    pw_add_user, pw_is_user, pw_del_user

};

in pw.c

posix_spawn causes compiler issue

Posix_spawn causes compile issue on root, because It was not set. This change was introduced while trying to fix this spawning process in a linux system and needed to be reverted.

Building refers to files in your home directory

./configure runs fine but when I type make it refers to a file 'documents/aund/missing' under your home directory which is therefore not in the package as cloned, or part of a standard Linux install.

No error returned for invalid handles

When sending a request on an (supposedly) open file with an invalid file handle there is a check to make sure the handle is valid, for example in fs_getbyte:

    if ((h = fs_check_handle(c->client, request->handle)) != 0) {

But if this test fails no error is sent. I believe this should be sending back the "Channel" error, i.e. the else part should be:

    else
        fs_err(c, EC_FS_E_CHANNEL);

This applies to gs_getbyte, fs_getbytes, fs_putbyte, fs_putbytes.

Handling of read-only files and a file descriptor leak

I have a filing system test program (see https://github.com/SteveFosdick/FsTest). One of the things it does is open a file for reading (OPENIN, i.e. OSFIND A=&40) and then attempt to write to it to check that an error is generated. The error that aund is sending back is 0xff/Bad file descriptor.

Looking at the code this is because aund correctly heeds the read-only attribute in the open request and opens the file read-only at the Unix level and then, when it receives a request to write to it, it calls write(2) which fails and the Unix errno EBADF is not mapped to an error message so it returns 0xff and the result of strerror(3).

Now there is code to set a handle attribute can_write but this only inspects the Acorn-specific file permissions and does not seem to be affected by whether the client requested the file to be open for writing. Is that correct? Do you think aund should set can_write to false if the original request specified read only?

Finally, while looking at fs_open to see what was going on, it looks like the file descriptor being used to open the file read-only as a "does it exist" test (line 112) is leaked as I can't see it being closed.

Core dump in posix_spawn unless -f is set for foreground

When I tried running aund on Linux, without specifying -f I immediately got a core dump. Here is the gdb backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7e79944 in __spawnix () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff7e79944 in __spawnix () from /usr/lib/libc.so.6
#1  0x00007ffff7e7a08b in __spawni () from /usr/lib/libc.so.6
#2  0x00007ffff7e798af in posix_spawn@@GLIBC_2.15 () from /usr/lib/libc.so.6
#3  0x0000555555557a3e in main (argc=1, argv=0x7fffffffe5b0) at aund.c:166

At a guess I'd say some things that can be left as NULL in that call are not allowed as NULL on Linux.

Normal Server Logging

The AUND server currently shows lots of debugging content to the terminal if the debug flag is set, turning this off shows nothing. It would be helpful to have something similar to the lvl 3 server display when a user logs on, logs off, loads or saves and uses the priv command.

Support AUN protocol

Aund currently only supports the Beebem aun protocol. The server needs to be changed to accept either Beebem AUN or the AUN protocol

Attemping *. when not logged in goes into a timeout loop

Beware, this might be an emulator bug but running*. on B-Em I get this from aund:

started as fileserver at station [254]

	(file server: {&=0,@=0,%=0} fs_error: 0xbf/Who are you?
aund: Tx reply: Connection timed out
)

	(file server: {&=0,@=0,%=0} fs_error: 0xbf/Who are you?
aund: Tx reply: Connection timed out
)

	(file server: {&=0,@=0,%=0} fs_error: 0xbf/Who are you?
aund: Tx reply: Connection timed out

Errors when sending large amounts of data

From SteveFosdick. ref: Issue #7

I have found another client problem, though, in that the program I was testing with was failing to set bytes &10 and &11 of the OSFILE control block, i.e. the upper limit of the memory block to be saved. It looks like in this case NFS is sending the length, as calculated by a straight subtraction, but possibly not sending all the data. In one case it send a length of 8523680 (about 8.1Mb) but then sent 83 1K blocks. I can't tell at the moment if that is because of some internal thing within NFS or if the network comms (or the AUN <> Econet state machine) is not so robust and this much data shows it up.

Aund gets stuck if the client stops talking

I came across when the client (B-Em emulating a BBC micro) malfunctioned and abandoned the dialogue in an OSFILE SAVE command part way through transferring the data. Upon re-starting the client, aund does not respond to *I AM. Re-starting aund restores operation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.