Commit Graph

1238 Commits

Author SHA1 Message Date
Andrew Pamment
41b0e18ffc Make it so users must exist to address them in local mail 2018-10-23 16:32:17 +10:00
Andrew Pamment
60b7d0d874 fix wrong email header 2018-10-23 15:37:06 +10:00
Andrew Pamment
8583ab6737 Fix for nbsp in messages 2018-10-23 11:44:39 +10:00
Andrew Pamment
0d26b5b06c More work on www tree stuff 2018-10-23 11:21:13 +10:00
Andrew Pamment
f0fa63cc5a Fix missing To on message view 2018-10-22 18:38:13 +10:00
Andrew Pamment
fb09e38602 Fix for nbsp in tag attribs 2018-10-22 17:16:10 +10:00
Andrew Pamment
3dab626285 Finished work converting www pages 2018-10-22 16:14:13 +10:00
Andrew Pamment
d4e80de397 Convert www_files to tree style 2018-10-22 10:47:20 +10:00
Andrew Pamment
947d4ab37f Rewrite aha to work with new tree system ready for messages and files 2018-10-21 23:05:17 +10:00
Andrew Pamment
71b465eba2 Improvements to www_tree and move over last 10 2018-10-21 20:11:30 +10:00
Andrew Pamment
fc590d9608 New tree thing for www. 2018-10-21 18:24:26 +10:00
Andrew Pamment
931c5465d5 Merge branch 'master' of ssh://git.magickabbs.com/home/andrew/repositories/MagickaBBS 2018-10-21 11:14:51 +10:00
Andrew Pamment
d047a1205b Fix rendering of www blog 2018-10-21 11:14:22 +10:00
Andrew Pamment
201510c3b3 the file i meant to commit when i committed the wrong file 2018-10-20 13:49:07 +10:00
Andrew Pamment
00a4cd40f9 revert accidently committed file :( 2018-10-20 13:41:00 +10:00
Andrew Pamment
8f7024a82c Add help for drafts to magiedit 2018-10-20 13:38:04 +10:00
Andrew Pamment
b2cbfdfd91 Add drafts support to magiedit 2018-10-20 13:28:44 +10:00
Andrew Pamment
4ba7eda791 Add fopen_bbs_path function 2018-10-20 09:50:28 +10:00
Dan Cross
bdde1aa621 Use fopen_bbs_path in a couple of places.
Just an example of how it may be used.

Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
2018-10-20 09:37:45 +10:00
Dan Cross
2f79c4a590 Trivial changes: white space etc.
clang-format and removing whitespace at the ends
of lines.

Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
2018-10-20 09:37:40 +10:00
Andrew Pamment
714fd09742 Change makefile cleaning a bit 2018-10-19 18:13:07 +10:00
Andrew Pamment
20e81962b7 fix for deleting bbses if you don't own it. 2018-10-19 14:48:29 +10:00
Andrew Pamment
ee194c102f fix path to last 10 and automessage 2018-10-18 21:03:52 +10:00
Andrew Pamment
321bf47ee8 Fix typo and old url.. thanks deon :) 2018-10-18 14:20:27 +10:00
Andrew Pamment
bc856d98d4 Cleanup Haiku makefile and enable SSH 2018-10-18 12:40:11 +10:00
Andrew Pamment
9b20880e66 fix for empty message bases on www 2018-10-18 12:35:39 +10:00
Andrew Pamment
999ec8871d another fix for new users 2018-10-18 12:13:10 +10:00
Andrew Pamment
aa2e4bced8 another fix for new users 2018-10-18 12:04:51 +10:00
Andrew Pamment
a681703a76 fix for lua with haiku 2018-10-18 11:53:19 +10:00
Andrew Pamment
8a201b77d1 Fix bug with new users 2018-10-18 11:50:56 +10:00
Andrew Pamment
af8936c02e Haiku Support
Hope I didn't break things!
2018-10-18 11:36:02 +10:00
Andrew Pamment
93e08c0c3d Fix for file uploads 2018-10-18 08:37:29 +10:00
Dan Cross
32d1c70622 Mostly trivial whitespace cleanups.
Clang-format and removing whitespace at the ends of lines.

Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
2018-10-17 13:11:38 +10:00
Dan Cross
359a190ee9 Remove the last of the sprintf() calls.
sprintf() is unsafe since it may overflow the bounds
of its destination buffers.  Remove the last of the
calls to it; all the logic has either been rewritten
to use snprintf() or other forms of string copying
such as strlcpy().

Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
2018-10-17 13:11:33 +10:00
Dan Cross
aacb1000c8 Arrays to vectors.
This is the big push to get rid of the last of the
unadorned dynamic arrays.  Use ptr_vectors for things
like mail conferences etc.

Lots of incidental cleanup along the way.

Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
2018-10-17 13:11:25 +10:00
Andrew Pamment
d8dc2e8f7d forgot to commit this file in last commit 2018-10-16 13:50:37 +10:00
Andrew Pamment
c3e21a5228 Add support for MUSL on Linux 2018-10-16 13:48:47 +10:00
Andrew Pamment
8f8a8d1b67 fix for compiling lua on dragonflybsd 2018-10-16 12:17:08 +10:00
Dan Cross
db53878cb1 Replace realloc() et al in unmangle_ansi with stralloc.
I think this is correct. The code, both before and
after, doesn't appear to NUL-terminate its output.

Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
2018-10-16 11:01:14 +10:00
Dan Cross
58481b88eb Cleanup users.c.
This started with using bounded operations on strings,
and morphed to introducing a utility function to open
the USERS SQLite3 database and then a general cleanup.

This needs testing.

Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
2018-10-16 11:01:11 +10:00
Dan Cross
f1361379af Replace calls to sprintf() with strlcpy() in settings.c.
sprintf() was being used to copy a string constant with
no formatting verbs; just use strlcpy() instead.

Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
2018-10-16 11:00:16 +10:00
Dan Cross
588242f68e Squash use of strncat(). Replaced by strlcat().
Note that the calls to strncat() did not account for the
NUL terminating byte, and for very long queries could have
led to a buffer overrun.

Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
2018-10-16 11:00:12 +10:00
Dan Cross
9f4269c74e Clean up menus.c.
In the course of removing calls to realloc(), change
the menu parsing and use logic to use ptr_vector's
directly.

This also fixes some detects menu issues in parsing
and avoids e.g. writing to a bad pointer (or should;
of course it needs testing...).

Finally, free menu state on return from the menu_system
function. There was a comment here to do that, but it
didn't appear to be done.

Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
2018-10-16 11:00:08 +10:00
Dan Cross
69c7286ea7 util.c: munmap takes a pointer, not a file descriptor.
The first argument to munmap(2) should be a pointer to
an mmap'ed region, not a file descriptor.

Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
2018-10-16 11:00:01 +10:00
Dan Cross
3519368d37 bbs.h: Add prototype for broadcast.
This squelches a warning in menus.c.

Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
2018-10-16 10:59:57 +10:00
Dan Cross
931c5625a3 Get rid of strncpy() calls.
The poorly named `strncpy` was originally written to
copy data into fixed-sized, disk-resident data structures
in an early version of the research Unix kernel.  Thus, it
has peculiar semantics: it takes source and destination
pointer arguments and a length and will *always* modify
exactly `length` bytes in the destination buffer.  If
the length of the source (which is presumed to be a
NUL-terminated C-stylestring) is `length` or more chars
long, then the result will not be NUL terminated.  If it
is less than `length` bytes long, then the result will be
padded with zeros up to `length`.

This is all well and good for storing a file name into a
fixed-width directory entry in 6th edition Unix, but it's
not useful as a general-purpose string utility.

Replaced with calls to strlcpy(), which always properly
terminates the destination but doesn't have the additional
zeroing behavior.  Since the buffers that we're copying
into were allocated with malloz(), and thus are guaranteed
to be filled with zeros, we're not leaking data, but not
double-zeroing either.

A few other things were changed. Lengths of destination
buffers are now given via `sizeof` instead of manifest
constants.  One call to `memcpy` took the length from the
size of the source argument, thus possibly writing beyond
the end of the destination buffer.  Changed to a call to
strlcpy() with length the sizeof destination.

Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
2018-10-16 10:59:53 +10:00
Andrew Pamment
f01cd5f1a6 Change file_id.diz to test post-receive hook 2018-10-15 14:51:37 +10:00
Andrew Pamment
7dddbde063 Fix www messages sending 2018-10-15 10:46:49 +10:00
Andrew Pamment
9d728d9a29 couple of minor fixes 2018-10-15 10:31:28 +10:00
Dan Cross
9bfc4ffbe5 More string cleanups.
In bluewave.c mostly.  There are a few places left where sprintf()
is called directly; these should be recast in terms of a stralloc
or possibly strlcat.

One small whitespace change in www_files.c.

Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
2018-10-15 10:20:20 +10:00