From 76877ba0a0eeb17d5c7e46211297ef7e4611685a Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Sun, 5 Apr 2020 19:49:41 +0100 Subject: [PATCH 01/22] Added libtelnet to vendor directory and Makefile --- Makefile | 35 +- src/vendors/libtelnet/AUTHORS | 4 + src/vendors/libtelnet/COPYING | 11 + src/vendors/libtelnet/NEWS | 50 + src/vendors/libtelnet/README.md | 700 ++++++++++++ src/vendors/libtelnet/libtelnet.c | 1669 +++++++++++++++++++++++++++++ src/vendors/libtelnet/libtelnet.h | 691 ++++++++++++ 7 files changed, 3150 insertions(+), 10 deletions(-) create mode 100644 src/vendors/libtelnet/AUTHORS create mode 100644 src/vendors/libtelnet/COPYING create mode 100644 src/vendors/libtelnet/NEWS create mode 100644 src/vendors/libtelnet/README.md create mode 100644 src/vendors/libtelnet/libtelnet.c create mode 100644 src/vendors/libtelnet/libtelnet.h diff --git a/Makefile b/Makefile index 4de7f71..cc840b9 100644 --- a/Makefile +++ b/Makefile @@ -43,10 +43,18 @@ IDENTD_OBJS = $(addprefix $(IDENTD_OBJ_DIR)/,$(notdir $(IDENTD_SRC:.c=.o))) # # Locations of vendors libraries # -VENDOR_SDS_SRC_DIR = $(TALKER_SRC_DIR)/vendors/sds -VENDOR_SDS_OBJ_DIR = $(TALKER_OBJ_DIR) -VENDOR_SDS_SRC = $(wildcard $(VENDOR_SDS_SRC_DIR)/*.c) -VENDOR_SDS_OBJS = $(addprefix $(VENDOR_SDS_OBJ_DIR)/,$(notdir $(VENDOR_SDS_SRC:.c=.o))) + +# SDS: https://github.com/antirez/sds +VENDOR_SDS_SRC_DIR = $(TALKER_SRC_DIR)/vendors/sds +VENDOR_SDS_OBJ_DIR = $(TALKER_OBJ_DIR) +VENDOR_SDS_SRC = $(wildcard $(VENDOR_SDS_SRC_DIR)/*.c) +VENDOR_SDS_OBJS = $(addprefix $(VENDOR_SDS_OBJ_DIR)/,$(notdir $(VENDOR_SDS_SRC:.c=.o))) + +# libtelnet: https://github.com/seanmiddleditch/libtelnet +VENDOR_LIBTELNET_SRC_DIR = $(TALKER_SRC_DIR)/vendors/libtelnet +VENDOR_LIBTELNET_OBJ_DIR = $(TALKER_OBJ_DIR) +VENDOR_LIBTELNET_SRC = $(wildcard $(VENDOR_LIBTELNET_SRC_DIR)/*.c) +VENDOR_LIBTELNET_OBJS = $(addprefix $(VENDOR_LIBTELNET_OBJ_DIR)/,$(notdir $(VENDOR_LIBTELNET_SRC:.c=.o))) # # Platform-specific libraries that need to be included @@ -79,35 +87,37 @@ distclean: clean rm -f $(TALKER_SRC_DIR)/*.[ch]~ $(TALKER_SRC_DIR)/*.[ch].bak rm -f $(IDENTD_SRC_DIR)/*.[ch]~ $(IDENTD_SRC_DIR)/*.[ch].bak rm -f $(VENDOR_SDS_SRC_DIR)/*.[ch]~ $(VENDOR_SDS_SRC_DIR)/*.[ch].bak + rm -f $(VENDOR_LIBTELNET_SRC_DIR)/*.[ch]~ $(VENDOR_LIBTELNET_SRC_DIR)/*.[ch].bak rm -f $(TALKER_BIN) $(BINDIR)/$(TALKER_BIN) rm -f $(IDENTD_BIN) $(BINDIR)/$(IDENTD_BIN) rm -f $(INCDIR)/*.[ch]~ $(INCDIR)/*.[ch].bak clean: - @echo "Removing object and dependancy files" + @echo "Removing object and dependency files" rm -f $(TALKER_OBJS) $(TALKER_OBJS:.o=.d) rm -f $(IDENTD_OBJS) $(IDENTD_OBJS:.o=.d) rm -f $(VENDOR_SDS_OBJS) $(VENDOR_SDS_OBJS:.o=.d) + rm -f $(VENDOR_LIBTELNET_OBJS) $(VENDOR_LIBTELNET_OBJS:.o=.d) install: $(BINDIR)/$(TALKER_BIN) $(BINDIR)/$(IDENTD_BIN) build: $(TALKER_BIN) $(IDENTD_BIN) -compile: $(TALKER_OBJS) $(IDENTD_OBJS) $(VENDOR_SDS_OBJS) +compile: $(TALKER_OBJS) $(IDENTD_OBJS) $(VENDOR_SDS_OBJS) $(VENDOR_LIBTELNET_OBJS) print-%: ; @echo $* = $($*) -vpath %.c $(TALKER_SRC_DIR) $(TALKER_SRC_DIR)/commands $(IDENTD_SRC_DIR) $(VENDOR_SDS_SRC_DIR) +vpath %.c $(TALKER_SRC_DIR) $(TALKER_SRC_DIR)/commands $(IDENTD_SRC_DIR) $(VENDOR_SDS_SRC_DIR) $(VENDOR_LIBTELNET_SRC_DIR) $(BINDIR)/$(TALKER_BIN) $(BINDIR)/$(IDENTD_BIN): $(BINDIR)/%: % @echo "Installing $< ..." chmod $(PERMS) $< -$(TALKER_BIN): $(TALKER_OBJS) $(VENDOR_SDS_OBJS) +$(TALKER_BIN): $(TALKER_OBJS) $(VENDOR_SDS_OBJS) $(VENDOR_LIBTELNET_OBJS) @echo "Linking $@ ..." $(CC) $(LD_FLAGS) $^ $(TALKER_LIBS) -o $@ -$(IDENTD_BIN): $(IDENTD_OBJS) $(VENDOR_SDS_OBJS) +$(IDENTD_BIN): $(IDENTD_OBJS) $(VENDOR_SDS_OBJS) $(VENDOR_LIBTELNET_OBJS) @echo "Linking $@ ..." $(CC) $(LD_FLAGS) $^ $(IDENTD_LIBS) -o $@ @@ -126,4 +136,9 @@ $(VENDOR_SDS_OBJS): $(VENDOR_SDS_OBJ_DIR)/%.o: %.c @test -d $(VENDOR_SDS_OBJ_DIR) || mkdir $(VENDOR_SDS_OBJ_DIR) $(CC) $(C_FLAGS) $(CC_FLAGS) $(TALKER_FLAGS) -c -o $@ $< --include $(TALKER_OBJS:.o=.d) $(IDENTD_OBJS:.o=.d) $(VENDOR_SDS_OBJS:.o=.d) +$(VENDOR_LIBTELNET_OBJS): $(VENDOR_LIBTELNET_OBJ_DIR)/%.o: %.c + @echo "Compiling libtelnet library $< ... ($@)" + @test -d $(VENDOR_LIBTELNET_OBJ_DIR) || mkdir $(VENDOR_LIBTELNET_OBJ_DIR) + $(CC) $(C_FLAGS) $(CC_FLAGS) $(TALKER_FLAGS) -c -o $@ $< + +-include $(TALKER_OBJS:.o=.d) $(IDENTD_OBJS:.o=.d) $(VENDOR_SDS_OBJS:.o=.d) $(VENDOR_LIBTELNET_OBJS:.o=.d) diff --git a/src/vendors/libtelnet/AUTHORS b/src/vendors/libtelnet/AUTHORS new file mode 100644 index 0000000..9beb0c7 --- /dev/null +++ b/src/vendors/libtelnet/AUTHORS @@ -0,0 +1,4 @@ +Sean Middleditch +Jack Kelly +Katherine Flavel +Daniel Loffgren (https://github.com/RyuKojiro) diff --git a/src/vendors/libtelnet/COPYING b/src/vendors/libtelnet/COPYING new file mode 100644 index 0000000..f7ba00c --- /dev/null +++ b/src/vendors/libtelnet/COPYING @@ -0,0 +1,11 @@ +libtelnet is released to the public domain: + +The author or authors of this code dedicate any and all copyright +interest in this code to the public domain. We make this dedication +for the benefit of the public at large and to the detriment of our +heirs and successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +code under copyright law. + +-- Sean Middleditch +-- Jack Kelly diff --git a/src/vendors/libtelnet/NEWS b/src/vendors/libtelnet/NEWS new file mode 100644 index 0000000..0d2f935 --- /dev/null +++ b/src/vendors/libtelnet/NEWS @@ -0,0 +1,50 @@ +Version 0.30.0 +============== + +* Convert build to CMake + +Version 0.23 +============ + +* Fixed release errors + +Version 0.22 +============ + +* EOL handling fixes +* allocation fixes to Q option states +* portability fixes + +Version 0.21 +============ + +* Visual C++ 2008/2010 compatibility, with solution files +* va_list versions of the printf helper functions +* fixes for ECHO, TTYPE IS, and flushing +* improved autotools build + +Version 0.20 +============ + +* added basic man pages +* major revamp of event API +* new APIs for ZMP, TERMINAL-TYPE, NEW-ENVIRON, and MSSP +* added a test suite + +Version 0.12 +============ + +* added pkg-config file +* telnet_t is now a private data structure +* telnet_init() allocates memory and returns a pointer +* renamed telnet_printf2() to telnet_raw_printf() + +Version 0.11 +============ + +* fix autoconf rules to find and use zlib + +Version 0.10 +============ + +* use automake/autoconf/libtool for building diff --git a/src/vendors/libtelnet/README.md b/src/vendors/libtelnet/README.md new file mode 100644 index 0000000..48e3947 --- /dev/null +++ b/src/vendors/libtelnet/README.md @@ -0,0 +1,700 @@ +[![Actions Status](https://github.com/seanmiddleditch/libtelnet/workflows/CI/badge.svg)](https://github.com/seanmiddleditch/libtelnet/actions) + +libtelnet - TELNET protocol handling library +============================================ + + http://github.com/seanmiddleditch/libtelnet + + Sean Middleditch and contributors + + +The author or authors of this code dedicate any and all copyright +interest in this code to the public domain. We make this dedication +for the benefit of the public at large and to the detriment of our +heirs and successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +code under copyright law. + + +I. Introduction +--------------- + +libtelnet provides safe and correct handling of the core TELNET +protocol. In addition to the base TELNET protocol, libtelnet also +implements the Q method of TELNET option negotiation. libtelnet can +be used for writing servers, clients, or proxies. + +For more information on the TELNET standards supported by libtelnet, +visit the following websites: + +* http://www.faqs.org/rfcs/rfc854.html +* http://www.faqs.org/rfcs/rfc855.html +* http://www.faqs.org/rfcs/rfc1091.html +* http://www.faqs.org/rfcs/rfc1143.html +* http://www.faqs.org/rfcs/rfc1408.html +* http://www.faqs.org/rfcs/rfc1572.html + +II. API +------- + +The libtelnet API contains several distinct parts. The first part is +the basic initialization and deinitialization routines. The second +part is a single function for pushing received data into the telnet +processor. The third part is the libtelnet output functions, which +generate TELNET commands and ensure data is properly formatted before +sending over the wire. The final part is the event handler +interface. + +This document covers only the most basic functions. See the +libtelnet manual pages or HTML documentation for a complete +reference. + +#### IIa. Initialization + + Using libtelnet requires the initialization of a telnet_t structure + which stores all current state for a single TELNET connection. + + Initializing a telnet_t structure requires several pieces of data. + One of these is the telopt support table, which specifies which + TELNET options your application supports both locally and remotely. + This table is comprised of telnet_telopt_t structures, one for each + supported option. Each entry specifies the option supported, + whether the option is supported locally or remotely. + +``` +struct telnet_telopt_t { + short telopt; + unsigned char us; + unsigned char him; +}; +``` + + The us field denotes whether your application supports the telopt + locally. It should be set to TELNET_WILL if you support it and to + TELNET_WONT if you don't. The him field denotes whether the telopt + is supported on the remote end, and should be TELNET_DO if yes and + TELNET_DONT if not. + + When definition the telopt table you must include an end marker + entry, which is simply an entry with telopt set to -1. For + example: + +``` +static const telnet_telopt_t my_telopts[] = { + { TELNET_TELOPT_ECHO, TELNET_WILL, TELNET_DONT }, + { TELNET_TELOPT_TTYPE, TELNET_WILL, TELNET_DONT }, + { TELNET_TELOPT_COMPRESS2, TELNET_WONT, TELNET_DO }, + { TELNET_TELOPT_ZMP, TELNET_WONT, TELNET_DO }, + { TELNET_TELOPT_MSSP, TELNET_WONT, TELNET_DO }, + { TELNET_TELOPT_BINARY, TELNET_WILL, TELNET_DO }, + { TELNET_TELOPT_NAWS, TELNET_WILL, TELNET_DONT }, + { -1, 0, 0 } +}; +``` + + If you need to dynamically alter supported options on a + per-connection basis then you may use a different table + (dynamically allocated if necessary) per call to telnet_init() or + you share a single constant table like the above example between + all connections if you support a fixed set of options. Most + applications will support only a fixed set of options. + +* `telnet_t *telnet_init(const telnet_telopts_t *telopts, + telnet_event_handler_t handler, unsigned char flags, + void *user_data);` + + The telnet_init() function is responsible for allocating memory + and initializing the data in a telnet_t structure. It must be + called immediately after establishing a connection and before any + other libtelnet API calls are made. + + The telopts field is the telopt support table as described above. + + The handler parameter must be a function matching the + telnet_event_handler_t definition. More information about events + can be found in section IId. + + The user_data parameter is passed to the event handler whenver it + is invoked. This will usually be a structure container + information about the connection, including a socket descriptor + for implementing TELNET_EV_SEND event handling. + + The flags parameter can be any of the following flag constants + bit-or'd together, or 0 to leave all options disabled. + + TELNET_FLAG_PROXY + Operate in proxy mode. This disables the RFC1143 support and + enables automatic detection of COMPRESS2 streams. + + TELNET_FLAG_NVT_EOL + Receive data with translation of the TELNET NVT CR NUL and CR LF + sequences specified in RFC854 to C carriage return (\r) and C + newline (\n), respectively. + + If telnet_init() fails to allocate the required memory, the + returned pointer will be zero. + +* `void telnet_free(telnet_t *telnet);` + + Releases any internal memory allocated by libtelnet for the given + telnet pointer. This must be called whenever a connection is + closed, or you will incur memory leaks. The pointer passed in may + no longer be used afterwards. + +#### IIb. Receiving Data + +* `void telnet_recv(telnet_t *telnet, + const char *buffer, unsigned int size, void *user_data);` + + When your application receives data over the socket from the + remote end, it must pass the received bytes into this function. + + As the TELNET stream is parsed, events will be generated and + passed to the event handler given to telnet_init(). Of particular + interest for data receiving is the TELNET_EV_DATA event, which is + triggered for any regular data such as user input or server + process output. + +#### IIc. Sending Data + + All of the output functions will invoke the TELNET_EV_SEND event. + + Note: it is very important that ALL data sent to the remote end of + the connection be passed through libtelnet. All user input or + process output that you wish to send over the wire should be given + to one of the following functions. Do NOT send or buffer + unprocessed output data directly! + +* `void telnet_iac(telnet_t *telnet, unsigned char cmd);` + + Sends a single "simple" TELNET command, such as the GO-AHEAD + commands (255 249). + +* `void telnet_negotiate(telnet_t *telnet, unsigned char cmd, + unsigned char opt);` + + Sends a TELNET negotiation command. The cmd parameter must be one + of TELNET_WILL, TELNET_WONT, TELNET_DO, or TELNET_DONT. The opt + parameter is the option to negotiate. + + Unless in PROXY mode, the RFC1143 support may delay or ellide the + request entirely, as appropriate. It will ignore duplicate + invocations, such as asking for WILL NAWS when NAWS is already on + or is currently awaiting response from the remote end. + +* `void telnet_send(telnet_t *telnet, const char *buffer, size_t size);` + + Sends raw data, which would be either the process output from a + server or the user input from a client. + + For sending regular text it may be more convenient to use + telnet_printf(). + +* `void telnet_send_text(telnet_t *telnet, const char *buffer, + size_t size);` + + Sends text characters with translation of C newlines (\n) into + CR LF and C carriage returns (\r) into CR NUL, as required by + RFC854, unless transmission in BINARY mode has been negotiated. + + For sending regular text it may be more convenient to use + telnet_printf(). + +* `void telnet_begin_sb(telnet_t *telnet, unsigned char telopt);` + + Sends the header for a TELNET sub-negotiation command for the + specified option. All send data following this command will be + part of the sub-negotiation data until a call is made to + telnet_finish_subnegotiation(). + + You should not use telnet_printf() for sending subnegotiation + data as it will perform newline translations that usually do not + need to be done for subnegotiation data, and may cause problems. + +* `void telnet_finish_sb(telnet_t *telnet);` + + Sends the end marker for a TELNET sub-negotiation command. This + must be called after (and only after) a call has been made to + telnet_begin_subnegotiation() and any negotiation data has been + sent. + +* `void telnet_subnegotiation(telnet_t *telnet, unsigned char telopt, + const char *buffer, unsigned int size);` + + Sends a TELNET sub-negotiation command. The telopt parameter is + the sub-negotiation option. + + Note that this function is just a shorthand for: + ``` + telnet_begin_sb(telnet, telopt); + telnet_send(telnet, buffer, size); + telnet_end_sb(telnet); + ``` + + For some subnegotiations that involve a lot of complex formatted + data to be sent, it may be easier to make calls to both + telnet_begin_sb() and telnet_finish_sb() and using telnet_send() + or telnet_printf2() to format the data. + + NOTE: telnet_subnegotiation() does have special behavior in + PROXY mode, as in that mode this function will automatically + detect the COMPRESS2 marker and enable zlib compression. + +* `int telnet_printf(telnet_t *telnet, const char *fmt, ...);` + + This functions very similarly to fprintf, except that output is + sent through libtelnet for processing. IAC bytes are properly + escaped, C newlines (\n) are translated into CR LF, and C carriage + returns (\r) are translated into CR NUL, all as required by + RFC854. The return code is the length of the formatted text. + + NOTE: due to an internal implementation detail, the maximum + lenth of the formatted text is 4096 characters. + + +#### IId. Event Handling + + libtelnet relies on an event-handling mechanism for processing the + parsed TELNET protocol stream as well as for buffering and sending + output data. + + When you initialize a telnet_t structure with telnet_init() you had + to pass in an event handler function. This function must meet the + following prototype: + + `void (telnet_t *telnet, telnet_event_t *event, void *user_data);` + + The event structure is detailed below. The user_data value is the + pointer passed to telnet_init(). + + The following is a summary of the most important parts of the + telnet_event_t data type. Please see the libtelnet manual pages or + HTML document for a complete reference. + +``` +union telnet_event_t { + enum telnet_event_type_t type; + + struct data_t { + enum telnet_event_type_t _type; + const char *buffer; + size_t size; + } data; + + struct error_t { + enum telnet_event_type_t _type; + const char *file; + const char *func; + const char *msg; + int line; + telnet_error_t errcode; + } error; + + struct iac_t { + enum telnet_event_type_t _type; + unsigned char cmd; + } iac; + + struct negotiate_t { + enum telnet_event_type_t _type; + unsigned char telopt; + } neg; + + struct subnegotiate_t { + enum telnet_event_type_t _type; + const char *buffer; + size_t size; + unsigned char telopt; + } sub; +}; +``` + + The enumeration values of telnet_event_type_t are described in + detail below. Whenever the the event handler is invoked, the + application must look at the event->type value and do any necessary + processing. + + The only event that MUST be implemented is TELNET_EV_SEND. Most + applications will also always want to implement the event + TELNET_EV_DATA. + + Here is an example event handler implementation which includes + handlers for several important events. + +``` +void my_event_handler(telnet_t *telnet, telnet_event_t *ev, + void *user_data) { + struct user_info *user = (struct user_info *)user_data; + + switch (ev->type) { + case TELNET_EV_DATA: + process_user_input(user, event->data.buffer, event->data.size); + break; + case TELNET_EV_SEND: + write_to_descriptor(user, event->data.buffer, event->data.size); + break; + case TELNET_EV_ERROR: + fatal_error("TELNET error: %s", event->error.msg); + break; + } +} +``` + +* TELNET_EV_DATA + + The DATA event is triggered whenever regular data (not part of any + special TELNET command) is received. For a client, this will be + process output from the server. For a server, this will be input + typed by the user. + + The event->data.buffer value will contain the bytes received and the + event->data.size value will contain the number of bytes received. + Note that event->data.buffer is not NUL terminated! + + NOTE: there is no guarantee that user input or server output + will be received in whole lines. If you wish to process data + a line at a time, you are responsible for buffering the data and + checking for line terminators yourself! + +* TELNET_EV_SEND + + This event is sent whenever libtelnet has generated data that must + be sent over the wire to the remove end. Generally that means + calling send() or adding the data to your application's output + buffer. + + The event->data.buffer value will contain the bytes to send and the + event->data.size value will contain the number of bytes to send. + Note that event->data.buffer is not NUL terminated, and may include + NUL characters in its data, so always use event->data.size! + + NOTE: Your SEND event handler must send or buffer the data in + its raw form as provided by libtelnet. If you wish to perform + any kind of preprocessing on data you want to send to the other + +* TELNET_EV_IAC + + The IAC event is triggered whenever a simple IAC command is + received, such as the IAC EOR (end of record, also called go ahead + or GA) command. + + The command received is in the event->iac.cmd value. + + The necessary processing depends on the specific commands; see + the TELNET RFC for more information. + +* TELNET_EV_WILL / TELNET_EV_DO + + The WILL and DO events are sent when a TELNET negotiation command + of the same name is received. + + WILL events are sent by the remote end when they wish to be + allowed to turn an option on on their end, or in confirmation + after you have sent a DO command to them. + + DO events are sent by the remote end when they wish for you to + turn on an option on your end, or in confirmation after you have + sent a WILL command to them. + + In either case, the TELNET option under negotiation will be in + event->neg.telopt field. + + libtelnet manages most of the pecularities of negotiation for you. + For information on libtelnet's negotiation method, see: + + http://www.faqs.org/rfcs/rfc1143.html + + Note that in PROXY mode libtelnet will do no processing of its + own for you. + +* TELNET_EV_WONT / TELNET_EV_DONT + + The WONT and DONT events are sent when the remote end of the + connection wishes to disable an option, when they are refusing to + a support an option that you have asked for, or in confirmation of + an option you have asked to be disabled. + + Most commonly WONT and DONT events are sent as rejections of + features you requested by sending DO or WILL events. Receiving + these events means the TELNET option is not or will not be + supported by the remote end, so give up. + + Sometimes WONT or DONT will be sent for TELNET options that are + already enabled, but the remote end wishes to stop using. You + cannot decline. These events are demands that must be complied + with. libtelnet will always send the appropriate response back + without consulting your application. These events are sent to + allow your application to disable its own use of the features. + + In either case, the TELNET option under negotiation will be in + event->neg.telopt field. + + Note that in PROXY mode libtelnet will do no processing of its + own for you. + +* TELNET_EV_SUBNEGOTIATION + + Triggered whenever a TELNET sub-negotiation has been received. + Sub-negotiations include the NAWS option for communicating + terminal size to a server, the NEW-ENVIRON and TTYPE options for + negotiating terminal features, and MUD-centric protocols such as + ZMP, MSSP, and MCCP2. + + The event->sub->telopt value is the option under sub-negotiation. + The remaining data (if any) is passed in event->sub.buffer and + event->sub.size. Note that most subnegotiation commands can include + embedded NUL bytes in the subnegotiation data, and the data + event->sub.buffer is not NUL terminated, so always use the + event->sub.size value! + + The meaning and necessary processing for subnegotiations are + defined in various TELNET RFCs and other informal specifications. + A subnegotiation should never be sent unless the specific option + has been enabled through the use of the telnet negotiation + feature. + + TTYPE/ENVIRON/NEW-ENVIRON/MSSP/ZMP SUPPORT: + libtelnet parses these subnegotiation commands. A special + event will be sent for each, after the SUBNEGOTIATION event is + sent. Except in special circumstances, the SUBNEGOTIATION event + should be ignored for these options and the special events should + be handled explicitly. + +* TELNET_EV_COMPRESS + + The COMPRESS event notifies the app that COMPRESS2/MCCP2 + compression has begun or ended. Only servers can send compressed + data, and hence only clients will receive compressed data. + + The event->command value will be 1 if compression has started and + will be 0 if compression has ended. + +* TELNET_EV_ZMP + + The event->zmp.argc field is the number of ZMP parameters, including + the command name, that have been received. The event->zmp.argv + field is an array of strings, one for each ZMP parameter. The + command name will be in event->zmp.argv[0]. + +* TELNET_EV_TTYPE + + The event->ttype.cmd field will be either TELNET_TTYPE_SEND, + TELNET_TTYPE_IS, TELNET_TTYPE_INFO. + + The actual terminal type will be in event->ttype.name. + +* TELNET_EV_ENVIRON + + The event->environ.cmd field will be either TELNET_ENVIRON_IS, + TELNET_ENVIRON_SEND, or TELNET_ENVIRON_INFO. + + The actual environment variable sent or requested will be sent + in the event->environ.values field. This is an array of + structures with the following format: + + ``` + struct telnet_environ_t { + unsigned char type; + const char *var; + const char *value; + }; + ``` + + The number of entries in the event->environ.values array is + stored in event->environ.count. + + Note that libtelnet does not support the ESC byte for ENVIRON/ + NEW-ENVIRON. Data using escaped bytes will not be parsed + correctly. + +* TELNET_EV_MSSP + + The event->mssp.values field is an array of telnet_environ_t + structures. The cmd field in each entry will have an + unspecified value, while the var and value fields will always + be set to the MSSP variable and value being set. For multi-value + MSSP variables, there will be multiple entries in the values + array for each value, each with the same variable name set. + + The number of entries in the event->mssp.values array is + stored in event->mssp.count. + +* TELNET_EV_WARNING + + The WARNING event is sent whenever something has gone wrong inside + of libtelnet (possibly due to malformed data sent by the other + end) but which recovery is (likely) possible. It may be safe to + continue using the connection, but some data may have been lost or + incorrectly interpreted. + + The event->error.msg field will contain a NUL terminated string + explaining the error. + +* TELNET_EV_ERROR + + Similar to the WARNING event, the ERROR event is sent whenever + something has gone wrong. ERROR events are non-recoverable, + however, and the application should immediately close the + connection. Whatever has happened is likely going only to result + in garbage from libtelnet. This is most likely to happen when a + COMPRESS2 stream fails, but other problems can occur. + + The event->error.msg field will contain a NUL terminated string + explaining the error. + +III. Integrating libtelnet with common muds +------------------------------------------- + +FIXME: fill in some notes about how to splice in libtelnet with +common Diku/Merc/Circle/etc. MUD codebases. + +IV. Safety and correctness considerations +----------------------------------------- + +Your existing application may make heavy use of its own output +buffering and transmission commands, including hand-made routines for +sending TELNET commands and sub-negotiation requests. There are at +times subtle issues that need to be handled when communication over +the TELNET protocol, not least of which is the need to escape any +byte value 0xFF with a special TELNET command. + +For these reasons, it is very important that applications making use +of libtelnet always make use of the libtelnet output functions for +all data being sent over the TELNET connection. + +In particular, if you are writing a client, all user input must be +passed through to telnet_send(). This also includes any input +generated automatically by scripts, triggers, or macros. + +For a server, any and all output -- including ANSI/VT100 escape +codes, regular text, newlines, and so on -- must be passed through to +telnet_send(). + +Any TELNET commands that are to be sent must be given to one of the +following: telnet_iac, telnet_negotiate, or telnet_subnegotiation(). + +If you are attempting to enable COMPRESS2/MCCP2, you must use the +telnet_begin_compress2() function. + +V. MCCP2 compression +-------------------- + +The MCCP2 (COMPRESS2) TELNET extension allows for the compression of +all traffic sent from server to client. For more information: + + http://www.mudbytes.net/index.php?a=articles&s=mccp + +In order for libtelnet to support MCCP2, zlib must be installed and +enabled when compiling libtelnet. Use -DHAVE_ZLIB to enable zlib +when compiling libtelnet.c and pass -lz to the linker to link in the +zlib shared library. + +libtelnet transparently supports MCCP2. For a server to support +MCCP2, the application must begin negotiation of the COMPRESS2 option +using telnet_negotiate(), for example: + + `telnet_negotiate(&telnet, TELNET_WILL, + TELNET_OPTION_COMPRESS2, user_data);` + +If a favorable DO COMPRESS2 is sent back from the client then the +server application can begin compression at any time by calling +telnet_begin_compress2(). + +If a connection is in PROXY mode and COMPRESS2 support is enabled +then libtelnet will automatically detect the start of a COMPRESS2 +stream, in either the sending or receiving direction. + +VI. Zenith MUD Protocol (ZMP) support +------------------------------------- + +The Zenith MUD Protocol allows applications to send messages across +the TELNET connection outside of the normal user input/output data +stream. libtelnet offers some limited support for receiving and +sending ZMP commands to make implementing a full ZMP stack easier. +For more information on ZMP: + + http://zmp.sourcemud.org/ + +For a server to enable ZMP, it must send the WILL ZMP negotitaion: + + `telnet_negotiate(&telnet, TELNET_WILL, TELNET_TELOPT_ZMP);` + +For a client to support ZMP it must include ZMP in the telopt table +passed to telnet_init(), with the him field set to TELNET_DO: + + `{ TELNET_TELOPT_ZMP, TELNET_WONT, TELNET_DO },` + +Note that while ZMP is a bi-directional protocol, it is only ever +enabled on the server end of the connection. This automatically +enables the client to send ZMP commands. The client must never +attempt to negotiate ZMP directly using telnet_negotiate(). + +Once ZMP is enabled, any ZMP commands received will automatically be +sent to the event handler function with the TELNET_EV_SUBNEGOTIATION +event code. The command will automatically be parsed and the ZMP +parameters will be placed in the event->argv array and the number of +parameters will be placed in the event->argc field. + +NOTE: if an error occured while parsing the ZMP command because it +was malformed, the event->argc field will be equal to 0 and the +event->argv field will be NULL. You should always check for this +before attempting to access the parameter array. + +To send ZMP commands to the remote end, use either telnet_send_zmp() +or telnet_send_zmpv(). + +* `int telnet_send_zmp(telnet_t *telnet, size_t argv, + const char **argv);` + + Sends a ZMP command to the remote end. The argc parameter is the + number of ZMP parameters (including the command name!) to be sent. + The argv parameter is an array of strings containing the + parameters. The element in argv[0] is the command name itself. + The argv array must have at least as many elements as the value + argc. + +VII. MUD Server Status Protocol (MSSP) support +---------------------------------------------- + +MSSP allows for crawlers or other clients to query a MUD server's +supported feature list. This allows MUD listing states to +automatically stay up to date with the MUD's features, and not +require MUD administrators to manually update listing sites for +their MUD. For more information on MSSP: + + http://tintin.sourceforge.net/mssp/ + +VIII. Telnet proxy utility +-------------------------- + +The telnet-proxy utility is a small application that serves both as a +testbed for libtelnet and as a powerful debugging tool for TELNET +servers and clients. + +To use telnet-proxy, you must first compile it using: + +``` + $ make +``` + +If you do not have zlib installed and wish to disable MCCP2 support +then you must first edit the Makefile and remove the -DHAVE_ZLIB and +the -lz from the compile flags. + +To run telnet-proxy, you simply give it the server's host name or IP +address, the server's port number, and the port number that +telnet-proxy should listen on. For example, to connect to the server +on mud.example.com port 7800 and to listen on port 5000, run: + +``` + $ ./telnet-proxy mud.example.com 7800 5000 +``` + +You can then connect to the host telnet-proxy is running on (e.g. +127.0.0.1) on port 5000 and you will automatically be proxied into +mud.example.com. + +telnet-proxy will display status information about the data passing +through both ends of the tunnel. telnet-proxy can only support a +single tunnel at a time. It will continue running until an error +occurs or a terminating signal is sent to the proxy process. diff --git a/src/vendors/libtelnet/libtelnet.c b/src/vendors/libtelnet/libtelnet.c new file mode 100644 index 0000000..71dc5f3 --- /dev/null +++ b/src/vendors/libtelnet/libtelnet.c @@ -0,0 +1,1669 @@ +/* + * libtelnet - TELNET protocol handling library + * + * Sean Middleditch + * sean@sourcemud.org + * + * The author or authors of this code dedicate any and all copyright interest + * in this code to the public domain. We make this dedication for the benefit + * of the public at large and to the detriment of our heirs and successors. We + * intend this dedication to be an overt act of relinquishment in perpetuity of + * all present and future rights to this code under copyright law. + */ + +#include +#include +#include +#include +#include +#include + +/* Win32 compatibility */ +#if defined(_WIN32) +# define vsnprintf _vsnprintf +# define __func__ __FUNCTION__ +# define ZLIB_WINAPI 1 +# if defined(_MSC_VER) +/* va_copy() is directly supported starting in Visual Studio 2013 + * https://msdn.microsoft.com/en-us/library/kb57fad8(v=vs.110).aspx + * https://msdn.microsoft.com/en-us/library/kb57fad8(v=vs.120).aspx + */ +# if _MSC_VER <= 1700 +# define va_copy(dest, src) (dest = src) +# endif +# endif +#endif + +#if defined(HAVE_ZLIB) +# include +#endif + +#include "libtelnet.h" + +/* inlinable functions */ +#if defined(__GNUC__) || __STDC_VERSION__ >= 199901L +# define INLINE __inline__ +#else +# define INLINE +#endif + +/* helper for Q-method option tracking */ +#define Q_US(q) ((q).state & 0x0F) +#define Q_HIM(q) (((q).state & 0xF0) >> 4) +#define Q_MAKE(us,him) ((us) | ((him) << 4)) + +/* helper for the negotiation routines */ +#define NEGOTIATE_EVENT(telnet,cmd,opt) \ + ev.type = (cmd); \ + ev.neg.telopt = (opt); \ + (telnet)->eh((telnet), &ev, (telnet)->ud); + +/* telnet state codes */ +enum telnet_state_t { + TELNET_STATE_DATA = 0, + TELNET_STATE_EOL, + TELNET_STATE_IAC, + TELNET_STATE_WILL, + TELNET_STATE_WONT, + TELNET_STATE_DO, + TELNET_STATE_DONT, + TELNET_STATE_SB, + TELNET_STATE_SB_DATA, + TELNET_STATE_SB_DATA_IAC +}; +typedef enum telnet_state_t telnet_state_t; + +/* telnet state tracker */ +struct telnet_t { + /* user data */ + void *ud; + /* telopt support table */ + const telnet_telopt_t *telopts; + /* event handler */ + telnet_event_handler_t eh; +#if defined(HAVE_ZLIB) + /* zlib (mccp2) compression */ + z_stream *z; +#endif + /* RFC1143 option negotiation states */ + struct telnet_rfc1143_t *q; + /* sub-request buffer */ + char *buffer; + /* current size of the buffer */ + size_t buffer_size; + /* current buffer write position (also length of buffer data) */ + size_t buffer_pos; + /* current state */ + enum telnet_state_t state; + /* option flags */ + unsigned char flags; + /* current subnegotiation telopt */ + unsigned char sb_telopt; + /* length of RFC1143 queue */ + unsigned int q_size; + /* number of entries in RFC1143 queue */ + unsigned int q_cnt; +}; + +/* RFC1143 option negotiation state */ +typedef struct telnet_rfc1143_t { + unsigned char telopt; + unsigned char state; +} telnet_rfc1143_t; + +/* RFC1143 state names */ +#define Q_NO 0 +#define Q_YES 1 +#define Q_WANTNO 2 +#define Q_WANTYES 3 +#define Q_WANTNO_OP 4 +#define Q_WANTYES_OP 5 + +/* telnet NVT EOL sequences */ +static const char CRLF[] = { '\r', '\n' }; +static const char CRNUL[] = { '\r', '\0' }; + +/* buffer sizes */ +static const size_t _buffer_sizes[] = { 0, 512, 2048, 8192, 16384, }; +static const size_t _buffer_sizes_count = sizeof(_buffer_sizes) / + sizeof(_buffer_sizes[0]); + +/* RFC1143 option negotiation state table allocation quantum */ +#define Q_BUFFER_GROWTH_QUANTUM 4 + +/* error generation function */ +static telnet_error_t _error(telnet_t *telnet, unsigned line, + const char* func, telnet_error_t err, int fatal, const char *fmt, + ...) { + telnet_event_t ev; + char buffer[512]; + va_list va; + + /* format informational text */ + va_start(va, fmt); + vsnprintf(buffer, sizeof(buffer), fmt, va); + va_end(va); + + /* send error event to the user */ + ev.type = fatal ? TELNET_EV_ERROR : TELNET_EV_WARNING; + ev.error.file = __FILE__; + ev.error.func = func; + ev.error.line = line; + ev.error.msg = buffer; + telnet->eh(telnet, &ev, telnet->ud); + + return err; +} + +#if defined(HAVE_ZLIB) +/* initialize the zlib box for a telnet box; if deflate is non-zero, it + * initializes zlib for delating (compression), otherwise for inflating + * (decompression). returns TELNET_EOK on success, something else on + * failure. + */ +telnet_error_t _init_zlib(telnet_t *telnet, int deflate, int err_fatal) { + z_stream *z; + int rs; + + /* if compression is already enabled, fail loudly */ + if (telnet->z != 0) + return _error(telnet, __LINE__, __func__, TELNET_EBADVAL, + err_fatal, "cannot initialize compression twice"); + + /* allocate zstream box */ + if ((z= (z_stream *)calloc(1, sizeof(z_stream))) == 0) + return _error(telnet, __LINE__, __func__, TELNET_ENOMEM, err_fatal, + "malloc() failed: %s", strerror(errno)); + + /* initialize */ + if (deflate) { + if ((rs = deflateInit(z, Z_DEFAULT_COMPRESSION)) != Z_OK) { + free(z); + return _error(telnet, __LINE__, __func__, TELNET_ECOMPRESS, + err_fatal, "deflateInit() failed: %s", zError(rs)); + } + telnet->flags |= TELNET_PFLAG_DEFLATE; + } else { + if ((rs = inflateInit(z)) != Z_OK) { + free(z); + return _error(telnet, __LINE__, __func__, TELNET_ECOMPRESS, + err_fatal, "inflateInit() failed: %s", zError(rs)); + } + telnet->flags &= ~TELNET_PFLAG_DEFLATE; + } + + telnet->z = z; + + return TELNET_EOK; +} +#endif /* defined(HAVE_ZLIB) */ + +/* push bytes out, compressing them first if need be */ +static void _send(telnet_t *telnet, const char *buffer, + size_t size) { + telnet_event_t ev; + +#if defined(HAVE_ZLIB) + /* if we have a deflate (compression) zlib box, use it */ + if (telnet->z != 0 && telnet->flags & TELNET_PFLAG_DEFLATE) { + char deflate_buffer[1024]; + int rs; + + /* initialize z state */ + telnet->z->next_in = (unsigned char *)buffer; + telnet->z->avail_in = (unsigned int)size; + telnet->z->next_out = (unsigned char *)deflate_buffer; + telnet->z->avail_out = sizeof(deflate_buffer); + + /* deflate until buffer exhausted and all output is produced */ + while (telnet->z->avail_in > 0 || telnet->z->avail_out == 0) { + /* compress */ + if ((rs = deflate(telnet->z, Z_SYNC_FLUSH)) != Z_OK) { + _error(telnet, __LINE__, __func__, TELNET_ECOMPRESS, 1, + "deflate() failed: %s", zError(rs)); + deflateEnd(telnet->z); + free(telnet->z); + telnet->z = 0; + break; + } + + /* send event */ + ev.type = TELNET_EV_SEND; + ev.data.buffer = deflate_buffer; + ev.data.size = sizeof(deflate_buffer) - telnet->z->avail_out; + telnet->eh(telnet, &ev, telnet->ud); + + /* prepare output buffer for next run */ + telnet->z->next_out = (unsigned char *)deflate_buffer; + telnet->z->avail_out = sizeof(deflate_buffer); + } + + /* do not continue with remaining code */ + return; + } +#endif /* defined(HAVE_ZLIB) */ + + ev.type = TELNET_EV_SEND; + ev.data.buffer = buffer; + ev.data.size = size; + telnet->eh(telnet, &ev, telnet->ud); +} + +/* to send bags of unsigned chars */ +#define _sendu(t, d, s) _send((t), (const char*)(d), (s)) + +/* check if we support a particular telopt; if us is non-zero, we + * check if we (local) supports it, otherwise we check if he (remote) + * supports it. return non-zero if supported, zero if not supported. + */ +static INLINE int _check_telopt(telnet_t *telnet, unsigned char telopt, + int us) { + int i; + + /* if we have no telopts table, we obviously don't support it */ + if (telnet->telopts == 0) + return 0; + + /* loop until found or end marker (us and him both 0) */ + for (i = 0; telnet->telopts[i].telopt != -1; ++i) { + if (telnet->telopts[i].telopt == telopt) { + if (us && telnet->telopts[i].us == TELNET_WILL) + return 1; + else if (!us && telnet->telopts[i].him == TELNET_DO) + return 1; + else + return 0; + } + } + + /* not found, so not supported */ + return 0; +} + +/* retrieve RFC1143 option state */ +static INLINE telnet_rfc1143_t _get_rfc1143(telnet_t *telnet, + unsigned char telopt) { + telnet_rfc1143_t empty; + unsigned int i; + + /* search for entry */ + for (i = 0; i != telnet->q_cnt; ++i) { + if (telnet->q[i].telopt == telopt) { + return telnet->q[i]; + } + } + + /* not found, return empty value */ + empty.telopt = telopt; + empty.state = 0; + return empty; +} + +/* save RFC1143 option state */ +static INLINE void _set_rfc1143(telnet_t *telnet, unsigned char telopt, + char us, char him) { + telnet_rfc1143_t *qtmp; + unsigned int i; + + /* search for entry */ + for (i = 0; i != telnet->q_cnt; ++i) { + if (telnet->q[i].telopt == telopt) { + telnet->q[i].state = Q_MAKE(us,him); + if (telopt != TELNET_TELOPT_BINARY) + return; + telnet->flags &= ~(TELNET_FLAG_TRANSMIT_BINARY | + TELNET_FLAG_RECEIVE_BINARY); + if (us == Q_YES) + telnet->flags |= TELNET_FLAG_TRANSMIT_BINARY; + if (him == Q_YES) + telnet->flags |= TELNET_FLAG_RECEIVE_BINARY; + return; + } + } + + /* we're going to need to track state for it, so grow the queue + * by 4 (four) elements and put the telopt into it; bail on allocation + * error. we go by four because it seems like a reasonable guess as + * to the number of enabled options for most simple code, and it + * allows for an acceptable number of reallocations for complex code. + */ + + /* Did we reach the end of the table? */ + if (telnet->q_cnt >= telnet->q_size) { + /* Expand the size */ + if ((qtmp = (telnet_rfc1143_t *)realloc(telnet->q, + sizeof(telnet_rfc1143_t) * + (telnet->q_size + Q_BUFFER_GROWTH_QUANTUM))) == 0) { + _error(telnet, __LINE__, __func__, TELNET_ENOMEM, 0, + "realloc() failed: %s", strerror(errno)); + return; + } + memset(&qtmp[telnet->q_size], 0, sizeof(telnet_rfc1143_t) * + Q_BUFFER_GROWTH_QUANTUM); + telnet->q = qtmp; + telnet->q_size += Q_BUFFER_GROWTH_QUANTUM; + } + /* Add entry to end of table */ + telnet->q[telnet->q_cnt].telopt = telopt; + telnet->q[telnet->q_cnt].state = Q_MAKE(us, him); + ++telnet->q_cnt; +} + +/* send negotiation bytes */ +static INLINE void _send_negotiate(telnet_t *telnet, unsigned char cmd, + unsigned char telopt) { + unsigned char bytes[3]; + bytes[0] = TELNET_IAC; + bytes[1] = cmd; + bytes[2] = telopt; + _sendu(telnet, bytes, 3); +} + +/* negotiation handling magic for RFC1143 */ +static void _negotiate(telnet_t *telnet, unsigned char telopt) { + telnet_event_t ev; + telnet_rfc1143_t q; + + /* in PROXY mode, just pass it thru and do nothing */ + if (telnet->flags & TELNET_FLAG_PROXY) { + switch ((int)telnet->state) { + case TELNET_STATE_WILL: + NEGOTIATE_EVENT(telnet, TELNET_EV_WILL, telopt); + break; + case TELNET_STATE_WONT: + NEGOTIATE_EVENT(telnet, TELNET_EV_WONT, telopt); + break; + case TELNET_STATE_DO: + NEGOTIATE_EVENT(telnet, TELNET_EV_DO, telopt); + break; + case TELNET_STATE_DONT: + NEGOTIATE_EVENT(telnet, TELNET_EV_DONT, telopt); + break; + } + return; + } + + /* lookup the current state of the option */ + q = _get_rfc1143(telnet, telopt); + + /* start processing... */ + switch ((int)telnet->state) { + /* request to enable option on remote end or confirm DO */ + case TELNET_STATE_WILL: + switch (Q_HIM(q)) { + case Q_NO: + if (_check_telopt(telnet, telopt, 0)) { + _set_rfc1143(telnet, telopt, Q_US(q), Q_YES); + _send_negotiate(telnet, TELNET_DO, telopt); + NEGOTIATE_EVENT(telnet, TELNET_EV_WILL, telopt); + } else + _send_negotiate(telnet, TELNET_DONT, telopt); + break; + case Q_WANTNO: + _set_rfc1143(telnet, telopt, Q_US(q), Q_NO); + NEGOTIATE_EVENT(telnet, TELNET_EV_WONT, telopt); + _error(telnet, __LINE__, __func__, TELNET_EPROTOCOL, 0, + "DONT answered by WILL"); + break; + case Q_WANTNO_OP: + _set_rfc1143(telnet, telopt, Q_US(q), Q_YES); + NEGOTIATE_EVENT(telnet, TELNET_EV_WILL, telopt); + _error(telnet, __LINE__, __func__, TELNET_EPROTOCOL, 0, + "DONT answered by WILL"); + break; + case Q_WANTYES: + _set_rfc1143(telnet, telopt, Q_US(q), Q_YES); + NEGOTIATE_EVENT(telnet, TELNET_EV_WILL, telopt); + break; + case Q_WANTYES_OP: + _set_rfc1143(telnet, telopt, Q_US(q), Q_WANTNO); + _send_negotiate(telnet, TELNET_DONT, telopt); + NEGOTIATE_EVENT(telnet, TELNET_EV_WILL, telopt); + break; + } + break; + + /* request to disable option on remote end, confirm DONT, reject DO */ + case TELNET_STATE_WONT: + switch (Q_HIM(q)) { + case Q_YES: + _set_rfc1143(telnet, telopt, Q_US(q), Q_NO); + _send_negotiate(telnet, TELNET_DONT, telopt); + NEGOTIATE_EVENT(telnet, TELNET_EV_WONT, telopt); + break; + case Q_WANTNO: + _set_rfc1143(telnet, telopt, Q_US(q), Q_NO); + NEGOTIATE_EVENT(telnet, TELNET_EV_WONT, telopt); + break; + case Q_WANTNO_OP: + _set_rfc1143(telnet, telopt, Q_US(q), Q_WANTYES); + NEGOTIATE_EVENT(telnet, TELNET_EV_DO, telopt); + break; + case Q_WANTYES: + case Q_WANTYES_OP: + _set_rfc1143(telnet, telopt, Q_US(q), Q_NO); + break; + } + break; + + /* request to enable option on local end or confirm WILL */ + case TELNET_STATE_DO: + switch (Q_US(q)) { + case Q_NO: + if (_check_telopt(telnet, telopt, 1)) { + _set_rfc1143(telnet, telopt, Q_YES, Q_HIM(q)); + _send_negotiate(telnet, TELNET_WILL, telopt); + NEGOTIATE_EVENT(telnet, TELNET_EV_DO, telopt); + } else + _send_negotiate(telnet, TELNET_WONT, telopt); + break; + case Q_WANTNO: + _set_rfc1143(telnet, telopt, Q_NO, Q_HIM(q)); + NEGOTIATE_EVENT(telnet, TELNET_EV_DONT, telopt); + _error(telnet, __LINE__, __func__, TELNET_EPROTOCOL, 0, + "WONT answered by DO"); + break; + case Q_WANTNO_OP: + _set_rfc1143(telnet, telopt, Q_YES, Q_HIM(q)); + NEGOTIATE_EVENT(telnet, TELNET_EV_DO, telopt); + _error(telnet, __LINE__, __func__, TELNET_EPROTOCOL, 0, + "WONT answered by DO"); + break; + case Q_WANTYES: + _set_rfc1143(telnet, telopt, Q_YES, Q_HIM(q)); + NEGOTIATE_EVENT(telnet, TELNET_EV_DO, telopt); + break; + case Q_WANTYES_OP: + _set_rfc1143(telnet, telopt, Q_WANTNO, Q_HIM(q)); + _send_negotiate(telnet, TELNET_WONT, telopt); + NEGOTIATE_EVENT(telnet, TELNET_EV_DO, telopt); + break; + } + break; + + /* request to disable option on local end, confirm WONT, reject WILL */ + case TELNET_STATE_DONT: + switch (Q_US(q)) { + case Q_YES: + _set_rfc1143(telnet, telopt, Q_NO, Q_HIM(q)); + _send_negotiate(telnet, TELNET_WONT, telopt); + NEGOTIATE_EVENT(telnet, TELNET_EV_DONT, telopt); + break; + case Q_WANTNO: + _set_rfc1143(telnet, telopt, Q_NO, Q_HIM(q)); + NEGOTIATE_EVENT(telnet, TELNET_EV_WONT, telopt); + break; + case Q_WANTNO_OP: + _set_rfc1143(telnet, telopt, Q_WANTYES, Q_HIM(q)); + _send_negotiate(telnet, TELNET_WILL, telopt); + NEGOTIATE_EVENT(telnet, TELNET_EV_WILL, telopt); + break; + case Q_WANTYES: + case Q_WANTYES_OP: + _set_rfc1143(telnet, telopt, Q_NO, Q_HIM(q)); + break; + } + break; + } +} + +/* process an ENVIRON/NEW-ENVIRON subnegotiation buffer + * + * the algorithm and approach used here is kind of a hack, + * but it reduces the number of memory allocations we have + * to make. + * + * we copy the bytes back into the buffer, starting at the very + * beginning, which makes it easy to handle the ENVIRON ESC + * escape mechanism as well as ensure the variable name and + * value strings are NUL-terminated, all while fitting inside + * of the original buffer. + */ +static int _environ_telnet(telnet_t *telnet, unsigned char type, + char* buffer, size_t size) { + telnet_event_t ev; + struct telnet_environ_t *values = 0; + char *c, *last, *out; + size_t index, count; + + /* if we have no data, just pass it through */ + if (size == 0) { + return 0; + } + + /* first byte must be a valid command */ + if ((unsigned)buffer[0] != TELNET_ENVIRON_SEND && + (unsigned)buffer[0] != TELNET_ENVIRON_IS && + (unsigned)buffer[0] != TELNET_ENVIRON_INFO) { + _error(telnet, __LINE__, __func__, TELNET_EPROTOCOL, 0, + "telopt %d subneg has invalid command", type); + return 0; + } + + /* store ENVIRON command */ + ev.environ.cmd = buffer[0]; + + /* if we have no arguments, send an event with no data end return */ + if (size == 1) { + /* no list of variables given */ + ev.environ.values = 0; + ev.environ.size = 0; + + /* invoke event with our arguments */ + ev.type = TELNET_EV_ENVIRON; + telnet->eh(telnet, &ev, telnet->ud); + + return 1; + } + + /* very second byte must be VAR or USERVAR, if present */ + if ((unsigned)buffer[1] != TELNET_ENVIRON_VAR && + (unsigned)buffer[1] != TELNET_ENVIRON_USERVAR) { + _error(telnet, __LINE__, __func__, TELNET_EPROTOCOL, 0, + "telopt %d subneg missing variable type", type); + return 0; + } + + /* ensure last byte is not an escape byte (makes parsing later easier) */ + if ((unsigned)buffer[size - 1] == TELNET_ENVIRON_ESC) { + _error(telnet, __LINE__, __func__, TELNET_EPROTOCOL, 0, + "telopt %d subneg ends with ESC", type); + return 0; + } + + /* count arguments; each valid entry starts with VAR or USERVAR */ + count = 0; + for (c = buffer + 1; c < buffer + size; ++c) { + if (*c == TELNET_ENVIRON_VAR || *c == TELNET_ENVIRON_USERVAR) { + ++count; + } else if (*c == TELNET_ENVIRON_ESC) { + /* skip the next byte */ + ++c; + } + } + + /* allocate argument array, bail on error */ + if ((values = (struct telnet_environ_t *)calloc(count, + sizeof(struct telnet_environ_t))) == 0) { + _error(telnet, __LINE__, __func__, TELNET_ENOMEM, 0, + "calloc() failed: %s", strerror(errno)); + return 0; + } + + /* parse argument array strings */ + out = buffer; + c = buffer + 1; + for (index = 0; index != count; ++index) { + /* remember the variable type (will be VAR or USERVAR) */ + values[index].type = *c++; + + /* scan until we find an end-marker, and buffer up unescaped + * bytes into our buffer */ + last = out; + while (c < buffer + size) { + /* stop at the next variable or at the value */ + if ((unsigned)*c == TELNET_ENVIRON_VAR || + (unsigned)*c == TELNET_ENVIRON_VALUE || + (unsigned)*c == TELNET_ENVIRON_USERVAR) { + break; + } + + /* buffer next byte (taking into account ESC) */ + if (*c == TELNET_ENVIRON_ESC) { + ++c; + } + + *out++ = *c++; + } + *out++ = '\0'; + + /* store the variable name we have just received */ + values[index].var = last; + values[index].value = ""; + + /* if we got a value, find the next end marker and + * store the value; otherwise, store empty string */ + if (c < buffer + size && *c == TELNET_ENVIRON_VALUE) { + ++c; + last = out; + while (c < buffer + size) { + /* stop when we find the start of the next variable */ + if ((unsigned)*c == TELNET_ENVIRON_VAR || + (unsigned)*c == TELNET_ENVIRON_USERVAR) { + break; + } + + /* buffer next byte (taking into account ESC) */ + if (*c == TELNET_ENVIRON_ESC) { + ++c; + } + + *out++ = *c++; + } + *out++ = '\0'; + + /* store the variable value */ + values[index].value = last; + } + } + + /* pass values array and count to event */ + ev.environ.values = values; + ev.environ.size = count; + + /* invoke event with our arguments */ + ev.type = TELNET_EV_ENVIRON; + telnet->eh(telnet, &ev, telnet->ud); + + /* clean up */ + free(values); + return 1; +} + +/* process an MSSP subnegotiation buffer */ +static int _mssp_telnet(telnet_t *telnet, char* buffer, size_t size) { + telnet_event_t ev; + struct telnet_environ_t *values; + char *var = 0; + char *c, *last, *out; + size_t i, count; + unsigned char next_type; + + /* if we have no data, just pass it through */ + if (size == 0) { + return 0; + } + + /* first byte must be a VAR */ + if ((unsigned)buffer[0] != TELNET_MSSP_VAR) { + _error(telnet, __LINE__, __func__, TELNET_EPROTOCOL, 0, + "MSSP subnegotiation has invalid data"); + return 0; + } + + /* count the arguments, any part that starts with VALUE */ + for (count = 0, i = 0; i != size; ++i) { + if ((unsigned)buffer[i] == TELNET_MSSP_VAL) { + ++count; + } + } + + /* allocate argument array, bail on error */ + if ((values = (struct telnet_environ_t *)calloc(count, + sizeof(struct telnet_environ_t))) == 0) { + _error(telnet, __LINE__, __func__, TELNET_ENOMEM, 0, + "calloc() failed: %s", strerror(errno)); + return 0; + } + + ev.mssp.values = values; + ev.mssp.size = count; + + /* allocate strings in argument array */ + out = last = buffer; + next_type = buffer[0]; + for (i = 0, c = buffer + 1; c < buffer + size;) { + /* search for end marker */ + while (c < buffer + size && (unsigned)*c != TELNET_MSSP_VAR && + (unsigned)*c != TELNET_MSSP_VAL) { + *out++ = *c++; + } + *out++ = '\0'; + + /* if it's a variable name, just store the name for now */ + if (next_type == TELNET_MSSP_VAR) { + var = last; + } else if (next_type == TELNET_MSSP_VAL && var != 0) { + values[i].var = var; + values[i].value = last; + ++i; + } else { + _error(telnet, __LINE__, __func__, TELNET_EPROTOCOL, 0, + "invalid MSSP subnegotiation data"); + free(values); + return 0; + } + + /* remember our next type and increment c for next loop run */ + last = out; + next_type = *c++; + } + + /* invoke event with our arguments */ + ev.type = TELNET_EV_MSSP; + telnet->eh(telnet, &ev, telnet->ud); + + /* clean up */ + free(values); + + return 0; +} + +/* parse ZMP command subnegotiation buffers */ +static int _zmp_telnet(telnet_t *telnet, const char* buffer, size_t size) { + telnet_event_t ev; + char **argv; + const char *c; + size_t i, argc; + + /* make sure this is a valid ZMP buffer */ + if (size == 0 || buffer[size - 1] != 0) { + _error(telnet, __LINE__, __func__, TELNET_EPROTOCOL, 0, + "incomplete ZMP frame"); + return 0; + } + + /* count arguments */ + for (argc = 0, c = buffer; c != buffer + size; ++argc) + c += strlen(c) + 1; + + /* allocate argument array, bail on error */ + if ((argv = (char **)calloc(argc, sizeof(char *))) == 0) { + _error(telnet, __LINE__, __func__, TELNET_ENOMEM, 0, + "calloc() failed: %s", strerror(errno)); + return 0; + } + + /* populate argument array */ + for (i = 0, c = buffer; i != argc; ++i) { + argv[i] = (char *)c; + c += strlen(c) + 1; + } + + /* invoke event with our arguments */ + ev.type = TELNET_EV_ZMP; + ev.zmp.argv = (const char**)argv; + ev.zmp.argc = argc; + telnet->eh(telnet, &ev, telnet->ud); + + /* clean up */ + free(argv); + return 0; +} + +/* parse TERMINAL-TYPE command subnegotiation buffers */ +static int _ttype_telnet(telnet_t *telnet, const char* buffer, size_t size) { + telnet_event_t ev; + + /* make sure request is not empty */ + if (size == 0) { + _error(telnet, __LINE__, __func__, TELNET_EPROTOCOL, 0, + "incomplete TERMINAL-TYPE request"); + return 0; + } + + /* make sure request has valid command type */ + if (buffer[0] != TELNET_TTYPE_IS && + buffer[0] != TELNET_TTYPE_SEND) { + _error(telnet, __LINE__, __func__, TELNET_EPROTOCOL, 0, + "TERMINAL-TYPE request has invalid type"); + return 0; + } + + /* send proper event */ + if (buffer[0] == TELNET_TTYPE_IS) { + char *name; + + /* allocate space for name */ + if ((name = (char *)malloc(size)) == 0) { + _error(telnet, __LINE__, __func__, TELNET_ENOMEM, 0, + "malloc() failed: %s", strerror(errno)); + return 0; + } + memcpy(name, buffer + 1, size - 1); + name[size - 1] = '\0'; + + ev.type = TELNET_EV_TTYPE; + ev.ttype.cmd = TELNET_TTYPE_IS; + ev.ttype.name = name; + telnet->eh(telnet, &ev, telnet->ud); + + /* clean up */ + free(name); + } else { + ev.type = TELNET_EV_TTYPE; + ev.ttype.cmd = TELNET_TTYPE_SEND; + ev.ttype.name = 0; + telnet->eh(telnet, &ev, telnet->ud); + } + + return 0; +} + +/* process a subnegotiation buffer; return non-zero if the current buffer + * must be aborted and reprocessed due to COMPRESS2 being activated + */ +static int _subnegotiate(telnet_t *telnet) { + telnet_event_t ev; + + /* standard subnegotiation event */ + ev.type = TELNET_EV_SUBNEGOTIATION; + ev.sub.telopt = telnet->sb_telopt; + ev.sub.buffer = telnet->buffer; + ev.sub.size = telnet->buffer_pos; + telnet->eh(telnet, &ev, telnet->ud); + + switch (telnet->sb_telopt) { +#if defined(HAVE_ZLIB) + /* received COMPRESS2 begin marker, setup our zlib box and + * start handling the compressed stream if it's not already. + */ + case TELNET_TELOPT_COMPRESS2: + if (telnet->sb_telopt == TELNET_TELOPT_COMPRESS2) { + if (_init_zlib(telnet, 0, 1) != TELNET_EOK) + return 0; + + /* notify app that compression was enabled */ + ev.type = TELNET_EV_COMPRESS; + ev.compress.state = 1; + telnet->eh(telnet, &ev, telnet->ud); + return 1; + } + return 0; +#endif /* defined(HAVE_ZLIB) */ + + /* specially handled subnegotiation telopt types */ + case TELNET_TELOPT_ZMP: + return _zmp_telnet(telnet, telnet->buffer, telnet->buffer_pos); + case TELNET_TELOPT_TTYPE: + return _ttype_telnet(telnet, telnet->buffer, telnet->buffer_pos); + case TELNET_TELOPT_ENVIRON: + case TELNET_TELOPT_NEW_ENVIRON: + return _environ_telnet(telnet, telnet->sb_telopt, telnet->buffer, + telnet->buffer_pos); + case TELNET_TELOPT_MSSP: + return _mssp_telnet(telnet, telnet->buffer, telnet->buffer_pos); + default: + return 0; + } +} + +/* initialize a telnet state tracker */ +telnet_t *telnet_init(const telnet_telopt_t *telopts, + telnet_event_handler_t eh, unsigned char flags, void *user_data) { + /* allocate structure */ + struct telnet_t *telnet = (telnet_t*)calloc(1, sizeof(telnet_t)); + if (telnet == 0) + return 0; + + /* initialize data */ + telnet->ud = user_data; + telnet->telopts = telopts; + telnet->eh = eh; + telnet->flags = flags; + + return telnet; +} + +/* free up any memory allocated by a state tracker */ +void telnet_free(telnet_t *telnet) { + /* free sub-request buffer */ + if (telnet->buffer != 0) { + free(telnet->buffer); + telnet->buffer = 0; + telnet->buffer_size = 0; + telnet->buffer_pos = 0; + } + +#if defined(HAVE_ZLIB) + /* free zlib box */ + if (telnet->z != 0) { + if (telnet->flags & TELNET_PFLAG_DEFLATE) + deflateEnd(telnet->z); + else + inflateEnd(telnet->z); + free(telnet->z); + telnet->z = 0; + } +#endif /* defined(HAVE_ZLIB) */ + + /* free RFC1143 queue */ + if (telnet->q) { + free(telnet->q); + telnet->q = NULL; + telnet->q_size = 0; + telnet->q_cnt = 0; + } + + /* free the telnet structure itself */ + free(telnet); +} + +/* push a byte into the telnet buffer */ +static telnet_error_t _buffer_byte(telnet_t *telnet, + unsigned char byte) { + char *new_buffer; + size_t i; + + /* check if we're out of room */ + if (telnet->buffer_pos == telnet->buffer_size) { + /* find the next buffer size */ + for (i = 0; i != _buffer_sizes_count; ++i) { + if (_buffer_sizes[i] == telnet->buffer_size) { + break; + } + } + + /* overflow -- can't grow any more */ + if (i >= _buffer_sizes_count - 1) { + _error(telnet, __LINE__, __func__, TELNET_EOVERFLOW, 0, + "subnegotiation buffer size limit reached"); + return TELNET_EOVERFLOW; + } + + /* (re)allocate buffer */ + new_buffer = (char *)realloc(telnet->buffer, _buffer_sizes[i + 1]); + if (new_buffer == 0) { + _error(telnet, __LINE__, __func__, TELNET_ENOMEM, 0, + "realloc() failed"); + return TELNET_ENOMEM; + } + + telnet->buffer = new_buffer; + telnet->buffer_size = _buffer_sizes[i + 1]; + } + + /* push the byte, all set */ + telnet->buffer[telnet->buffer_pos++] = byte; + return TELNET_EOK; +} + +static void _process(telnet_t *telnet, const char *buffer, size_t size) { + telnet_event_t ev; + unsigned char byte; + size_t i, start; + for (i = start = 0; i != size; ++i) { + byte = buffer[i]; + switch (telnet->state) { + /* regular data */ + case TELNET_STATE_DATA: + /* on an IAC byte, pass through all pending bytes and + * switch states */ + if (byte == TELNET_IAC) { + if (i != start) { + ev.type = TELNET_EV_DATA; + ev.data.buffer = buffer + start; + ev.data.size = i - start; + telnet->eh(telnet, &ev, telnet->ud); + } + telnet->state = TELNET_STATE_IAC; + } else if (byte == '\r' && + (telnet->flags & TELNET_FLAG_NVT_EOL) && + !(telnet->flags & TELNET_FLAG_RECEIVE_BINARY)) { + if (i != start) { + ev.type = TELNET_EV_DATA; + ev.data.buffer = buffer + start; + ev.data.size = i - start; + telnet->eh(telnet, &ev, telnet->ud); + } + telnet->state = TELNET_STATE_EOL; + } + break; + + /* NVT EOL to be translated */ + case TELNET_STATE_EOL: + if (byte != '\n') { + byte = '\r'; + ev.type = TELNET_EV_DATA; + ev.data.buffer = (char*)&byte; + ev.data.size = 1; + telnet->eh(telnet, &ev, telnet->ud); + byte = buffer[i]; + } + /* any byte following '\r' other than '\n' or '\0' is invalid, + * so pass both \r and the byte */ + start = i; + if (byte == '\0') + ++start; + /* state update */ + telnet->state = TELNET_STATE_DATA; + break; + + /* IAC command */ + case TELNET_STATE_IAC: + switch (byte) { + /* subnegotiation */ + case TELNET_SB: + telnet->state = TELNET_STATE_SB; + break; + /* negotiation commands */ + case TELNET_WILL: + telnet->state = TELNET_STATE_WILL; + break; + case TELNET_WONT: + telnet->state = TELNET_STATE_WONT; + break; + case TELNET_DO: + telnet->state = TELNET_STATE_DO; + break; + case TELNET_DONT: + telnet->state = TELNET_STATE_DONT; + break; + /* IAC escaping */ + case TELNET_IAC: + /* event */ + ev.type = TELNET_EV_DATA; + ev.data.buffer = (char*)&byte; + ev.data.size = 1; + telnet->eh(telnet, &ev, telnet->ud); + + /* state update */ + start = i + 1; + telnet->state = TELNET_STATE_DATA; + break; + /* some other command */ + default: + /* event */ + ev.type = TELNET_EV_IAC; + ev.iac.cmd = byte; + telnet->eh(telnet, &ev, telnet->ud); + + /* state update */ + start = i + 1; + telnet->state = TELNET_STATE_DATA; + } + break; + + /* negotiation commands */ + case TELNET_STATE_WILL: + case TELNET_STATE_WONT: + case TELNET_STATE_DO: + case TELNET_STATE_DONT: + _negotiate(telnet, byte); + start = i + 1; + telnet->state = TELNET_STATE_DATA; + break; + + /* subnegotiation -- determine subnegotiation telopt */ + case TELNET_STATE_SB: + telnet->sb_telopt = byte; + telnet->buffer_pos = 0; + telnet->state = TELNET_STATE_SB_DATA; + break; + + /* subnegotiation -- buffer bytes until end request */ + case TELNET_STATE_SB_DATA: + /* IAC command in subnegotiation -- either IAC SE or IAC IAC */ + if (byte == TELNET_IAC) { + telnet->state = TELNET_STATE_SB_DATA_IAC; + } else if (telnet->sb_telopt == TELNET_TELOPT_COMPRESS && byte == TELNET_WILL) { + /* In 1998 MCCP used TELOPT 85 and the protocol defined an invalid + * subnegotiation sequence (IAC SB 85 WILL SE) to start compression. + * Subsequently MCCP version 2 was created in 2000 using TELOPT 86 + * and a valid subnegotiation (IAC SB 86 IAC SE). libtelnet for now + * just captures and discards MCCPv1 sequences. + */ + start = i + 2; + telnet->state = TELNET_STATE_DATA; + /* buffer the byte, or bail if we can't */ + } else if (_buffer_byte(telnet, byte) != TELNET_EOK) { + start = i + 1; + telnet->state = TELNET_STATE_DATA; + } + break; + + /* IAC escaping inside a subnegotiation */ + case TELNET_STATE_SB_DATA_IAC: + switch (byte) { + /* end subnegotiation */ + case TELNET_SE: + /* return to default state */ + start = i + 1; + telnet->state = TELNET_STATE_DATA; + + /* process subnegotiation */ + if (_subnegotiate(telnet) != 0) { + /* any remaining bytes in the buffer are compressed. + * we have to re-invoke telnet_recv to get those + * bytes inflated and abort trying to process the + * remaining compressed bytes in the current _process + * buffer argument + */ + telnet_recv(telnet, &buffer[start], size - start); + return; + } + break; + /* escaped IAC byte */ + case TELNET_IAC: + /* push IAC into buffer */ + if (_buffer_byte(telnet, TELNET_IAC) != + TELNET_EOK) { + start = i + 1; + telnet->state = TELNET_STATE_DATA; + } else { + telnet->state = TELNET_STATE_SB_DATA; + } + break; + /* something else -- protocol error. attempt to process + * content in subnegotiation buffer, then evaluate the + * given command as an IAC code. + */ + default: + _error(telnet, __LINE__, __func__, TELNET_EPROTOCOL, 0, + "unexpected byte after IAC inside SB: %d", + byte); + + /* enter IAC state */ + start = i + 1; + telnet->state = TELNET_STATE_IAC; + + /* process subnegotiation; see comment in + * TELNET_STATE_SB_DATA_IAC about invoking telnet_recv() + */ + if (_subnegotiate(telnet) != 0) { + telnet_recv(telnet, &buffer[start], size - start); + return; + } else { + /* recursive call to get the current input byte processed + * as a regular IAC command. we could use a goto, but + * that would be gross. + */ + _process(telnet, (char *)&byte, 1); + } + break; + } + break; + } + } + + /* pass through any remaining bytes */ + if (telnet->state == TELNET_STATE_DATA && i != start) { + ev.type = TELNET_EV_DATA; + ev.data.buffer = buffer + start; + ev.data.size = i - start; + telnet->eh(telnet, &ev, telnet->ud); + } +} + +/* push a bytes into the state tracker */ +void telnet_recv(telnet_t *telnet, const char *buffer, + size_t size) { +#if defined(HAVE_ZLIB) + /* if we have an inflate (decompression) zlib stream, use it */ + if (telnet->z != 0 && !(telnet->flags & TELNET_PFLAG_DEFLATE)) { + char inflate_buffer[1024]; + int rs; + + /* initialize zlib state */ + telnet->z->next_in = (unsigned char*)buffer; + telnet->z->avail_in = (unsigned int)size; + telnet->z->next_out = (unsigned char *)inflate_buffer; + telnet->z->avail_out = sizeof(inflate_buffer); + + /* inflate until buffer exhausted and all output is produced */ + while (telnet->z->avail_in > 0 || telnet->z->avail_out == 0) { + /* reset output buffer */ + + /* decompress */ + rs = inflate(telnet->z, Z_SYNC_FLUSH); + + /* process the decompressed bytes on success */ + if (rs == Z_OK || rs == Z_STREAM_END) + _process(telnet, inflate_buffer, sizeof(inflate_buffer) - + telnet->z->avail_out); + else + _error(telnet, __LINE__, __func__, TELNET_ECOMPRESS, 1, + "inflate() failed: %s", zError(rs)); + + /* prepare output buffer for next run */ + telnet->z->next_out = (unsigned char *)inflate_buffer; + telnet->z->avail_out = sizeof(inflate_buffer); + + /* on error (or on end of stream) disable further inflation */ + if (rs != Z_OK) { + telnet_event_t ev; + + /* disable compression */ + inflateEnd(telnet->z); + free(telnet->z); + telnet->z = 0; + + /* send event */ + ev.type = TELNET_EV_COMPRESS; + ev.compress.state = 0; + telnet->eh(telnet, &ev, telnet->ud); + + break; + } + } + + /* COMPRESS2 is not negotiated, just process */ + } else +#endif /* defined(HAVE_ZLIB) */ + _process(telnet, buffer, size); +} + +/* send an iac command */ +void telnet_iac(telnet_t *telnet, unsigned char cmd) { + unsigned char bytes[2]; + bytes[0] = TELNET_IAC; + bytes[1] = cmd; + _sendu(telnet, bytes, 2); +} + +/* send negotiation */ +void telnet_negotiate(telnet_t *telnet, unsigned char cmd, + unsigned char telopt) { + telnet_rfc1143_t q; + + /* if we're in proxy mode, just send it now */ + if (telnet->flags & TELNET_FLAG_PROXY) { + unsigned char bytes[3]; + bytes[0] = TELNET_IAC; + bytes[1] = cmd; + bytes[2] = telopt; + _sendu(telnet, bytes, 3); + return; + } + + /* get current option states */ + q = _get_rfc1143(telnet, telopt); + + switch (cmd) { + /* advertise willingess to support an option */ + case TELNET_WILL: + switch (Q_US(q)) { + case Q_NO: + _set_rfc1143(telnet, telopt, Q_WANTYES, Q_HIM(q)); + _send_negotiate(telnet, TELNET_WILL, telopt); + break; + case Q_WANTNO: + _set_rfc1143(telnet, telopt, Q_WANTNO_OP, Q_HIM(q)); + break; + case Q_WANTYES_OP: + _set_rfc1143(telnet, telopt, Q_WANTYES, Q_HIM(q)); + break; + } + break; + + /* force turn-off of locally enabled option */ + case TELNET_WONT: + switch (Q_US(q)) { + case Q_YES: + _set_rfc1143(telnet, telopt, Q_WANTNO, Q_HIM(q)); + _send_negotiate(telnet, TELNET_WONT, telopt); + break; + case Q_WANTYES: + _set_rfc1143(telnet, telopt, Q_WANTYES_OP, Q_HIM(q)); + break; + case Q_WANTNO_OP: + _set_rfc1143(telnet, telopt, Q_WANTNO, Q_HIM(q)); + break; + } + break; + + /* ask remote end to enable an option */ + case TELNET_DO: + switch (Q_HIM(q)) { + case Q_NO: + _set_rfc1143(telnet, telopt, Q_US(q), Q_WANTYES); + _send_negotiate(telnet, TELNET_DO, telopt); + break; + case Q_WANTNO: + _set_rfc1143(telnet, telopt, Q_US(q), Q_WANTNO_OP); + break; + case Q_WANTYES_OP: + _set_rfc1143(telnet, telopt, Q_US(q), Q_WANTYES); + break; + } + break; + + /* demand remote end disable an option */ + case TELNET_DONT: + switch (Q_HIM(q)) { + case Q_YES: + _set_rfc1143(telnet, telopt, Q_US(q), Q_WANTNO); + _send_negotiate(telnet, TELNET_DONT, telopt); + break; + case Q_WANTYES: + _set_rfc1143(telnet, telopt, Q_US(q), Q_WANTYES_OP); + break; + case Q_WANTNO_OP: + _set_rfc1143(telnet, telopt, Q_US(q), Q_WANTNO); + break; + } + break; + } +} + +/* send non-command data (escapes IAC bytes) */ +void telnet_send(telnet_t *telnet, const char *buffer, + size_t size) { + size_t i, l; + + for (l = i = 0; i != size; ++i) { + /* dump prior portion of text, send escaped bytes */ + if (buffer[i] == (char)TELNET_IAC) { + /* dump prior text if any */ + if (i != l) { + _send(telnet, buffer + l, i - l); + } + l = i + 1; + + /* send escape */ + telnet_iac(telnet, TELNET_IAC); + } + } + + /* send whatever portion of buffer is left */ + if (i != l) { + _send(telnet, buffer + l, i - l); + } +} + +/* send non-command text (escapes IAC bytes and does NVT translation) */ +void telnet_send_text(telnet_t *telnet, const char *buffer, + size_t size) { + size_t i, l; + + for (l = i = 0; i != size; ++i) { + /* dump prior portion of text, send escaped bytes */ + if (buffer[i] == (char)TELNET_IAC) { + /* dump prior text if any */ + if (i != l) { + _send(telnet, buffer + l, i - l); + } + l = i + 1; + + /* send escape */ + telnet_iac(telnet, TELNET_IAC); + } + /* special characters if not in BINARY mode */ + else if (!(telnet->flags & TELNET_FLAG_TRANSMIT_BINARY) && + (buffer[i] == '\r' || buffer[i] == '\n')) { + /* dump prior portion of text */ + if (i != l) { + _send(telnet, buffer + l, i - l); + } + l = i + 1; + + /* automatic translation of \r -> CRNUL */ + if (buffer[i] == '\r') { + _send(telnet, CRNUL, 2); + } + /* automatic translation of \n -> CRLF */ + else { + _send(telnet, CRLF, 2); + } + } + } + + /* send whatever portion of buffer is left */ + if (i != l) { + _send(telnet, buffer + l, i - l); + } +} + +/* send subnegotiation header */ +void telnet_begin_sb(telnet_t *telnet, unsigned char telopt) { + unsigned char sb[3]; + sb[0] = TELNET_IAC; + sb[1] = TELNET_SB; + sb[2] = telopt; + _sendu(telnet, sb, 3); +} + + +/* send complete subnegotiation */ +void telnet_subnegotiation(telnet_t *telnet, unsigned char telopt, + const char *buffer, size_t size) { + unsigned char bytes[5]; + bytes[0] = TELNET_IAC; + bytes[1] = TELNET_SB; + bytes[2] = telopt; + bytes[3] = TELNET_IAC; + bytes[4] = TELNET_SE; + + _sendu(telnet, bytes, 3); + telnet_send(telnet, buffer, size); + _sendu(telnet, bytes + 3, 2); + +#if defined(HAVE_ZLIB) + /* if we're a proxy and we just sent the COMPRESS2 marker, we must + * make sure all further data is compressed if not already. + */ + if (telnet->flags & TELNET_FLAG_PROXY && + telopt == TELNET_TELOPT_COMPRESS2) { + telnet_event_t ev; + + if (_init_zlib(telnet, 1, 1) != TELNET_EOK) + return; + + /* notify app that compression was enabled */ + ev.type = TELNET_EV_COMPRESS; + ev.compress.state = 1; + telnet->eh(telnet, &ev, telnet->ud); + } +#endif /* defined(HAVE_ZLIB) */ +} + +void telnet_begin_compress2(telnet_t *telnet) { +#if defined(HAVE_ZLIB) + static const unsigned char compress2[] = { TELNET_IAC, TELNET_SB, + TELNET_TELOPT_COMPRESS2, TELNET_IAC, TELNET_SE }; + + telnet_event_t ev; + + /* attempt to create output stream first, bail if we can't */ + if (_init_zlib(telnet, 1, 0) != TELNET_EOK) + return; + + /* send compression marker. we send directly to the event handler + * instead of passing through _send because _send would result in + * the compress marker itself being compressed. + */ + ev.type = TELNET_EV_SEND; + ev.data.buffer = (const char*)compress2; + ev.data.size = sizeof(compress2); + telnet->eh(telnet, &ev, telnet->ud); + + /* notify app that compression was successfully enabled */ + ev.type = TELNET_EV_COMPRESS; + ev.compress.state = 1; + telnet->eh(telnet, &ev, telnet->ud); +#else + (void)telnet; +#endif /* defined(HAVE_ZLIB) */ +} + +/* send formatted data with \r and \n translation in addition to IAC IAC */ +int telnet_vprintf(telnet_t *telnet, const char *fmt, va_list va) { + va_list va_temp; + char buffer[1024]; + char *output = buffer; + unsigned int rs, i, l; + + /* format */ + va_copy(va_temp, va); + rs = vsnprintf(buffer, sizeof(buffer), fmt, va_temp); + va_end(va_temp); + + if (rs >= sizeof(buffer)) { + output = (char*)malloc(rs + 1); + if (output == 0) { + _error(telnet, __LINE__, __func__, TELNET_ENOMEM, 0, + "malloc() failed: %s", strerror(errno)); + return -1; + } + + va_copy(va_temp, va); + rs = vsnprintf(output, rs + 1, fmt, va_temp); + va_end(va_temp); + } + + /* send */ + for (l = i = 0; i != rs; ++i) { + /* special characters */ + if (output[i] == (char)TELNET_IAC || output[i] == '\r' || + output[i] == '\n') { + /* dump prior portion of text */ + if (i != l) + _send(telnet, output + l, i - l); + l = i + 1; + + /* IAC -> IAC IAC */ + if (output[i] == (char)TELNET_IAC) + telnet_iac(telnet, TELNET_IAC); + /* automatic translation of \r -> CRNUL */ + else if (output[i] == '\r') + _send(telnet, CRNUL, 2); + /* automatic translation of \n -> CRLF */ + else if (output[i] == '\n') + _send(telnet, CRLF, 2); + } + } + + /* send whatever portion of output is left */ + if (i != l) { + _send(telnet, output + l, i - l); + } + + /* free allocated memory, if any */ + if (output != buffer) { + free(output); + } + + return rs; +} + +/* see telnet_vprintf */ +int telnet_printf(telnet_t *telnet, const char *fmt, ...) { + va_list va; + int rs; + + va_start(va, fmt); + rs = telnet_vprintf(telnet, fmt, va); + va_end(va); + + return rs; +} + +/* send formatted data through telnet_send */ +int telnet_raw_vprintf(telnet_t *telnet, const char *fmt, va_list va) { + va_list va_temp; + char buffer[1024]; + char *output = buffer; + unsigned int rs; + + /* format; allocate more space if necessary */ + va_copy(va_temp, va); + rs = vsnprintf(buffer, sizeof(buffer), fmt, va_temp); + va_end(va_temp); + + if (rs >= sizeof(buffer)) { + output = (char*)malloc(rs + 1); + if (output == 0) { + _error(telnet, __LINE__, __func__, TELNET_ENOMEM, 0, + "malloc() failed: %s", strerror(errno)); + return -1; + } + + va_copy(va_temp, va); + rs = vsnprintf(output, rs + 1, fmt, va_temp); + va_end(va_temp); + } + + /* send out the formatted data */ + telnet_send(telnet, output, rs); + + /* release allocated memory, if any */ + if (output != buffer) { + free(output); + } + + return rs; +} + +/* see telnet_raw_vprintf */ +int telnet_raw_printf(telnet_t *telnet, const char *fmt, ...) { + va_list va; + int rs; + + va_start(va, fmt); + rs = telnet_raw_vprintf(telnet, fmt, va); + va_end(va); + + return rs; +} + +/* begin NEW-ENVIRON subnegotation */ +void telnet_begin_newenviron(telnet_t *telnet, unsigned char cmd) { + telnet_begin_sb(telnet, TELNET_TELOPT_NEW_ENVIRON); + telnet_send(telnet, (const char *)&cmd, 1); +} + +/* send a NEW-ENVIRON value */ +void telnet_newenviron_value(telnet_t *telnet, unsigned char type, + const char *string) { + telnet_send(telnet, (const char*)&type, 1); + + if (string != 0) { + telnet_send(telnet, string, strlen(string)); + } +} + +/* send TERMINAL-TYPE SEND command */ +void telnet_ttype_send(telnet_t *telnet) { + static const unsigned char SEND[] = { TELNET_IAC, TELNET_SB, + TELNET_TELOPT_TTYPE, TELNET_TTYPE_SEND, TELNET_IAC, TELNET_SE }; + _sendu(telnet, SEND, sizeof(SEND)); +} + +/* send TERMINAL-TYPE IS command */ +void telnet_ttype_is(telnet_t *telnet, const char* ttype) { + static const unsigned char IS[] = { TELNET_IAC, TELNET_SB, + TELNET_TELOPT_TTYPE, TELNET_TTYPE_IS }; + _sendu(telnet, IS, sizeof(IS)); + _send(telnet, ttype, strlen(ttype)); + telnet_finish_sb(telnet); +} + +/* send ZMP data */ +void telnet_send_zmp(telnet_t *telnet, size_t argc, const char **argv) { + size_t i; + + /* ZMP header */ + telnet_begin_zmp(telnet, argv[0]); + + /* send out each argument, including trailing NUL byte */ + for (i = 1; i != argc; ++i) + telnet_zmp_arg(telnet, argv[i]); + + /* ZMP footer */ + telnet_finish_zmp(telnet); +} + +/* send ZMP data using varargs */ +void telnet_send_vzmpv(telnet_t *telnet, va_list va) { + const char* arg; + + /* ZMP header */ + telnet_begin_sb(telnet, TELNET_TELOPT_ZMP); + + /* send out each argument, including trailing NUL byte */ + while ((arg = va_arg(va, const char *)) != 0) + telnet_zmp_arg(telnet, arg); + + /* ZMP footer */ + telnet_finish_zmp(telnet); +} + +/* see telnet_send_vzmpv */ +void telnet_send_zmpv(telnet_t *telnet, ...) { + va_list va; + + va_start(va, telnet); + telnet_send_vzmpv(telnet, va); + va_end(va); +} + +/* begin a ZMP command */ +void telnet_begin_zmp(telnet_t *telnet, const char *cmd) { + telnet_begin_sb(telnet, TELNET_TELOPT_ZMP); + telnet_zmp_arg(telnet, cmd); +} + +/* send a ZMP argument */ +void telnet_zmp_arg(telnet_t *telnet, const char* arg) { + telnet_send(telnet, arg, strlen(arg) + 1); +} diff --git a/src/vendors/libtelnet/libtelnet.h b/src/vendors/libtelnet/libtelnet.h new file mode 100644 index 0000000..e3e6048 --- /dev/null +++ b/src/vendors/libtelnet/libtelnet.h @@ -0,0 +1,691 @@ +/*! + * \brief libtelnet - TELNET protocol handling library + * + * SUMMARY: + * + * libtelnet is a library for handling the TELNET protocol. It includes + * routines for parsing incoming data from a remote peer as well as formatting + * data to send to the remote peer. + * + * libtelnet uses a callback-oriented API, allowing application-specific + * handling of various events. The callback system is also used for buffering + * outgoing protocol data, allowing the application to maintain control over + * the actual socket connection. + * + * Features supported include the full TELNET protocol, Q-method option + * negotiation, ZMP, MCCP2, MSSP, and NEW-ENVIRON. + * + * CONFORMS TO: + * + * RFC854 - http://www.faqs.org/rfcs/rfc854.html + * RFC855 - http://www.faqs.org/rfcs/rfc855.html + * RFC1091 - http://www.faqs.org/rfcs/rfc1091.html + * RFC1143 - http://www.faqs.org/rfcs/rfc1143.html + * RFC1408 - http://www.faqs.org/rfcs/rfc1408.html + * RFC1572 - http://www.faqs.org/rfcs/rfc1572.html + * + * LICENSE: + * + * The author or authors of this code dedicate any and all copyright interest + * in this code to the public domain. We make this dedication for the benefit + * of the public at large and to the detriment of our heirs and successors. We + * intend this dedication to be an overt act of relinquishment in perpetuity of + * all present and future rights to this code under copyright law. + * + * \file libtelnet.h + * + * \version 0.23 + * + * \author Sean Middleditch + */ + +#if !defined(LIBTELNET_INCLUDE) +#define LIBTELNET_INCLUDE 1 + +/* standard C headers necessary for the libtelnet API */ +#include +#include + +/* C++ support */ +#if defined(__cplusplus) +extern "C" { +#endif + +/* printf type checking feature in GCC and some other compilers */ +#if __GNUC__ +# define TELNET_GNU_PRINTF(f,a) __attribute__((format(printf, f, a))) /*!< internal helper */ +# define TELNET_GNU_SENTINEL __attribute__((sentinel)) /*!< internal helper */ +#else +# define TELNET_GNU_PRINTF(f,a) /*!< internal helper */ +# define TELNET_GNU_SENTINEL /*!< internal helper */ +#endif + +/* Disable environ macro for Visual C++ 2015. */ +#undef environ + +/*! Telnet state tracker object type. */ +typedef struct telnet_t telnet_t; + +/*! Telnet event object type. */ +typedef union telnet_event_t telnet_event_t; + +/*! Telnet option table element type. */ +typedef struct telnet_telopt_t telnet_telopt_t; + +/*! \name Telnet commands */ +/*@{*/ +/*! Telnet commands and special values. */ +#define TELNET_IAC 255 +#define TELNET_DONT 254 +#define TELNET_DO 253 +#define TELNET_WONT 252 +#define TELNET_WILL 251 +#define TELNET_SB 250 +#define TELNET_GA 249 +#define TELNET_EL 248 +#define TELNET_EC 247 +#define TELNET_AYT 246 +#define TELNET_AO 245 +#define TELNET_IP 244 +#define TELNET_BREAK 243 +#define TELNET_DM 242 +#define TELNET_NOP 241 +#define TELNET_SE 240 +#define TELNET_EOR 239 +#define TELNET_ABORT 238 +#define TELNET_SUSP 237 +#define TELNET_EOF 236 +/*@}*/ + +/*! \name Telnet option values. */ +/*@{*/ +/*! Telnet options. */ +#define TELNET_TELOPT_BINARY 0 +#define TELNET_TELOPT_ECHO 1 +#define TELNET_TELOPT_RCP 2 +#define TELNET_TELOPT_SGA 3 +#define TELNET_TELOPT_NAMS 4 +#define TELNET_TELOPT_STATUS 5 +#define TELNET_TELOPT_TM 6 +#define TELNET_TELOPT_RCTE 7 +#define TELNET_TELOPT_NAOL 8 +#define TELNET_TELOPT_NAOP 9 +#define TELNET_TELOPT_NAOCRD 10 +#define TELNET_TELOPT_NAOHTS 11 +#define TELNET_TELOPT_NAOHTD 12 +#define TELNET_TELOPT_NAOFFD 13 +#define TELNET_TELOPT_NAOVTS 14 +#define TELNET_TELOPT_NAOVTD 15 +#define TELNET_TELOPT_NAOLFD 16 +#define TELNET_TELOPT_XASCII 17 +#define TELNET_TELOPT_LOGOUT 18 +#define TELNET_TELOPT_BM 19 +#define TELNET_TELOPT_DET 20 +#define TELNET_TELOPT_SUPDUP 21 +#define TELNET_TELOPT_SUPDUPOUTPUT 22 +#define TELNET_TELOPT_SNDLOC 23 +#define TELNET_TELOPT_TTYPE 24 +#define TELNET_TELOPT_EOR 25 +#define TELNET_TELOPT_TUID 26 +#define TELNET_TELOPT_OUTMRK 27 +#define TELNET_TELOPT_TTYLOC 28 +#define TELNET_TELOPT_3270REGIME 29 +#define TELNET_TELOPT_X3PAD 30 +#define TELNET_TELOPT_NAWS 31 +#define TELNET_TELOPT_TSPEED 32 +#define TELNET_TELOPT_LFLOW 33 +#define TELNET_TELOPT_LINEMODE 34 +#define TELNET_TELOPT_XDISPLOC 35 +#define TELNET_TELOPT_ENVIRON 36 +#define TELNET_TELOPT_AUTHENTICATION 37 +#define TELNET_TELOPT_ENCRYPT 38 +#define TELNET_TELOPT_NEW_ENVIRON 39 +#define TELNET_TELOPT_MSSP 70 +#define TELNET_TELOPT_COMPRESS 85 +#define TELNET_TELOPT_COMPRESS2 86 +#define TELNET_TELOPT_ZMP 93 +#define TELNET_TELOPT_EXOPL 255 + +#define TELNET_TELOPT_MCCP2 86 +/*@}*/ + +/*! \name Protocol codes for TERMINAL-TYPE commands. */ +/*@{*/ +/*! TERMINAL-TYPE codes. */ +#define TELNET_TTYPE_IS 0 +#define TELNET_TTYPE_SEND 1 +/*@}*/ + +/*! \name Protocol codes for NEW-ENVIRON/ENVIRON commands. */ +/*@{*/ +/*! NEW-ENVIRON/ENVIRON codes. */ +#define TELNET_ENVIRON_IS 0 +#define TELNET_ENVIRON_SEND 1 +#define TELNET_ENVIRON_INFO 2 +#define TELNET_ENVIRON_VAR 0 +#define TELNET_ENVIRON_VALUE 1 +#define TELNET_ENVIRON_ESC 2 +#define TELNET_ENVIRON_USERVAR 3 +/*@}*/ + +/*! \name Protocol codes for MSSP commands. */ +/*@{*/ +/*! MSSP codes. */ +#define TELNET_MSSP_VAR 1 +#define TELNET_MSSP_VAL 2 +/*@}*/ + +/*! \name Telnet state tracker flags. */ +/*@{*/ +/*! Control behavior of telnet state tracker. */ +#define TELNET_FLAG_PROXY (1<<0) +#define TELNET_FLAG_NVT_EOL (1<<1) + +/* Internal-only bits in option flags */ +#define TELNET_FLAG_TRANSMIT_BINARY (1<<5) +#define TELNET_FLAG_RECEIVE_BINARY (1<<6) +#define TELNET_PFLAG_DEFLATE (1<<7) +/*@}*/ + +/*! + * error codes + */ +enum telnet_error_t { + TELNET_EOK = 0, /*!< no error */ + TELNET_EBADVAL, /*!< invalid parameter, or API misuse */ + TELNET_ENOMEM, /*!< memory allocation failure */ + TELNET_EOVERFLOW, /*!< data exceeds buffer size */ + TELNET_EPROTOCOL, /*!< invalid sequence of special bytes */ + TELNET_ECOMPRESS /*!< error handling compressed streams */ +}; +typedef enum telnet_error_t telnet_error_t; /*!< Error code type. */ + +/*! + * event codes + */ +enum telnet_event_type_t { + TELNET_EV_DATA = 0, /*!< raw text data has been received */ + TELNET_EV_SEND, /*!< data needs to be sent to the peer */ + TELNET_EV_IAC, /*!< generic IAC code received */ + TELNET_EV_WILL, /*!< WILL option negotiation received */ + TELNET_EV_WONT, /*!< WONT option neogitation received */ + TELNET_EV_DO, /*!< DO option negotiation received */ + TELNET_EV_DONT, /*!< DONT option negotiation received */ + TELNET_EV_SUBNEGOTIATION, /*!< sub-negotiation data received */ + TELNET_EV_COMPRESS, /*!< compression has been enabled */ + TELNET_EV_ZMP, /*!< ZMP command has been received */ + TELNET_EV_TTYPE, /*!< TTYPE command has been received */ + TELNET_EV_ENVIRON, /*!< ENVIRON command has been received */ + TELNET_EV_MSSP, /*!< MSSP command has been received */ + TELNET_EV_WARNING, /*!< recoverable error has occured */ + TELNET_EV_ERROR /*!< non-recoverable error has occured */ +}; +typedef enum telnet_event_type_t telnet_event_type_t; /*!< Telnet event type. */ + +/*! + * environ/MSSP command information + */ +struct telnet_environ_t { + unsigned char type; /*!< either TELNET_ENVIRON_VAR or TELNET_ENVIRON_USERVAR */ + char *var; /*!< name of the variable being set */ + char *value; /*!< value of variable being set; empty string if no value */ +}; + +/*! + * event information + */ +union telnet_event_t { + /*! + * \brief Event type + * + * The type field will determine which of the other event structure fields + * have been filled in. For instance, if the event type is TELNET_EV_ZMP, + * then the zmp event field (and ONLY the zmp event field) will be filled + * in. + */ + enum telnet_event_type_t type; + + /*! + * data event: for DATA and SEND events + */ + struct data_t { + enum telnet_event_type_t _type; /*!< alias for type */ + const char *buffer; /*!< byte buffer */ + size_t size; /*!< number of bytes in buffer */ + } data; /*!< DATA and SEND */ + + /*! + * WARNING and ERROR events + */ + struct error_t { + enum telnet_event_type_t _type; /*!< alias for type */ + const char *file; /*!< file the error occured in */ + const char *func; /*!< function the error occured in */ + const char *msg; /*!< error message string */ + int line; /*!< line of file error occured on */ + telnet_error_t errcode; /*!< error code */ + } error; /*!< WARNING and ERROR */ + + /*! + * command event: for IAC + */ + struct iac_t { + enum telnet_event_type_t _type; /*!< alias for type */ + unsigned char cmd; /*!< telnet command received */ + } iac; /*!< IAC */ + + /*! + * negotiation event: WILL, WONT, DO, DONT + */ + struct negotiate_t { + enum telnet_event_type_t _type; /*!< alias for type */ + unsigned char telopt; /*!< option being negotiated */ + } neg; /*!< WILL, WONT, DO, DONT */ + + /*! + * subnegotiation event + */ + struct subnegotiate_t { + enum telnet_event_type_t _type; /*!< alias for type */ + const char *buffer; /*!< data of sub-negotiation */ + size_t size; /*!< number of bytes in buffer */ + unsigned char telopt; /*!< option code for negotiation */ + } sub; /*!< SB */ + + /*! + * ZMP event + */ + struct zmp_t { + enum telnet_event_type_t _type; /*!< alias for type */ + const char **argv; /*!< array of argument string */ + size_t argc; /*!< number of elements in argv */ + } zmp; /*!< ZMP */ + + /*! + * TTYPE event + */ + struct ttype_t { + enum telnet_event_type_t _type; /*!< alias for type */ + unsigned char cmd; /*!< TELNET_TTYPE_IS or TELNET_TTYPE_SEND */ + const char* name; /*!< terminal type name (IS only) */ + } ttype; /*!< TTYPE */ + + /*! + * COMPRESS event + */ + struct compress_t { + enum telnet_event_type_t _type; /*!< alias for type */ + unsigned char state; /*!< 1 if compression is enabled, + 0 if disabled */ + } compress; /*!< COMPRESS */ + + /*! + * ENVIRON/NEW-ENVIRON event + */ + struct environ_t { + enum telnet_event_type_t _type; /*!< alias for type */ + const struct telnet_environ_t *values; /*!< array of variable values */ + size_t size; /*!< number of elements in values */ + unsigned char cmd; /*!< SEND, IS, or INFO */ + } environ; /*!< ENVIRON, NEW-ENVIRON */ + + /*! + * MSSP event + */ + struct mssp_t { + enum telnet_event_type_t _type; /*!< alias for type */ + const struct telnet_environ_t *values; /*!< array of variable values */ + size_t size; /*!< number of elements in values */ + } mssp; /*!< MSSP */ +}; + +/*! + * \brief event handler + * + * This is the type of function that must be passed to + * telnet_init() when creating a new telnet object. The + * function will be invoked once for every event generated + * by the libtelnet protocol parser. + * + * \param telnet The telnet object that generated the event + * \param event Event structure with details about the event + * \param user_data User-supplied pointer + */ +typedef void (*telnet_event_handler_t)(telnet_t *telnet, + telnet_event_t *event, void *user_data); + +/*! + * telopt support table element; use telopt of -1 for end marker + */ +struct telnet_telopt_t { + short telopt; /*!< one of the TELOPT codes or -1 */ + unsigned char us; /*!< TELNET_WILL or TELNET_WONT */ + unsigned char him; /*!< TELNET_DO or TELNET_DONT */ +}; + +/*! + * state tracker -- private data structure + */ +struct telnet_t; + +/*! + * \brief Initialize a telnet state tracker. + * + * This function initializes a new state tracker, which is used for all + * other libtelnet functions. Each connection must have its own + * telnet state tracker object. + * + * \param telopts Table of TELNET options the application supports. + * \param eh Event handler function called for every event. + * \param flags 0 or TELNET_FLAG_PROXY. + * \param user_data Optional data pointer that will be passsed to eh. + * \return Telnet state tracker object. + */ +extern telnet_t* telnet_init(const telnet_telopt_t *telopts, + telnet_event_handler_t eh, unsigned char flags, void *user_data); + +/*! + * \brief Free up any memory allocated by a state tracker. + * + * This function must be called when a telnet state tracker is no + * longer needed (such as after the connection has been closed) to + * release any memory resources used by the state tracker. + * + * \param telnet Telnet state tracker object. + */ +extern void telnet_free(telnet_t *telnet); + +/*! + * \brief Push a byte buffer into the state tracker. + * + * Passes one or more bytes to the telnet state tracker for + * protocol parsing. The byte buffer is most often going to be + * the buffer that recv() was called for while handling the + * connection. + * + * \param telnet Telnet state tracker object. + * \param buffer Pointer to byte buffer. + * \param size Number of bytes pointed to by buffer. + */ +extern void telnet_recv(telnet_t *telnet, const char *buffer, + size_t size); + +/*! + * \brief Send a telnet command. + * + * \param telnet Telnet state tracker object. + * \param cmd Command to send. + */ +extern void telnet_iac(telnet_t *telnet, unsigned char cmd); + +/*! + * \brief Send negotiation command. + * + * Internally, libtelnet uses RFC1143 option negotiation rules. + * The negotiation commands sent with this function may be ignored + * if they are determined to be redundant. + * + * \param telnet Telnet state tracker object. + * \param cmd TELNET_WILL, TELNET_WONT, TELNET_DO, or TELNET_DONT. + * \param opt One of the TELNET_TELOPT_* values. + */ +extern void telnet_negotiate(telnet_t *telnet, unsigned char cmd, + unsigned char opt); + +/*! + * Send non-command data (escapes IAC bytes). + * + * \param telnet Telnet state tracker object. + * \param buffer Buffer of bytes to send. + * \param size Number of bytes to send. + */ +extern void telnet_send(telnet_t *telnet, + const char *buffer, size_t size); + +/*! + * Send non-command text (escapes IAC bytes and translates + * \\r -> CR-NUL and \\n -> CR-LF unless in BINARY mode. + * + * \param telnet Telnet state tracker object. + * \param buffer Buffer of bytes to send. + * \param size Number of bytes to send. + */ +extern void telnet_send_text(telnet_t *telnet, + const char *buffer, size_t size); + +/*! + * \brief Begin a sub-negotiation command. + * + * Sends IAC SB followed by the telopt code. All following data sent + * will be part of the sub-negotiation, until telnet_finish_sb() is + * called. + * + * \param telnet Telnet state tracker object. + * \param telopt One of the TELNET_TELOPT_* values. + */ +extern void telnet_begin_sb(telnet_t *telnet, + unsigned char telopt); + +/*! + * \brief Finish a sub-negotiation command. + * + * This must be called after a call to telnet_begin_sb() to finish a + * sub-negotiation command. + * + * \param telnet Telnet state tracker object. + */ +#define telnet_finish_sb(telnet) telnet_iac((telnet), TELNET_SE) + +/*! + * \brief Shortcut for sending a complete subnegotiation buffer. + * + * Equivalent to: + * telnet_begin_sb(telnet, telopt); + * telnet_send(telnet, buffer, size); + * telnet_finish_sb(telnet); + * + * \param telnet Telnet state tracker format. + * \param telopt One of the TELNET_TELOPT_* values. + * \param buffer Byte buffer for sub-negotiation data. + * \param size Number of bytes to use for sub-negotiation data. + */ +extern void telnet_subnegotiation(telnet_t *telnet, unsigned char telopt, + const char *buffer, size_t size); + +/*! + * \brief Begin sending compressed data. + * + * This function will begein sending data using the COMPRESS2 option, + * which enables the use of zlib to compress data sent to the client. + * The client must offer support for COMPRESS2 with option negotiation, + * and zlib support must be compiled into libtelnet. + * + * Only the server may call this command. + * + * \param telnet Telnet state tracker object. + */ +extern void telnet_begin_compress2(telnet_t *telnet); + +/*! + * \brief Send formatted data. + * + * This function is a wrapper around telnet_send(). It allows using + * printf-style formatting. + * + * Additionally, this function will translate \\r to the CR NUL construct and + * \\n with CR LF, as well as automatically escaping IAC bytes like + * telnet_send(). + * + * \param telnet Telnet state tracker object. + * \param fmt Format string. + * \return Number of bytes sent. + */ +extern int telnet_printf(telnet_t *telnet, const char *fmt, ...) + TELNET_GNU_PRINTF(2, 3); + +/*! + * \brief Send formatted data. + * + * See telnet_printf(). + */ +extern int telnet_vprintf(telnet_t *telnet, const char *fmt, va_list va); + +/*! + * \brief Send formatted data (no newline escaping). + * + * This behaves identically to telnet_printf(), except that the \\r and \\n + * characters are not translated. The IAC byte is still escaped as normal + * with telnet_send(). + * + * \param telnet Telnet state tracker object. + * \param fmt Format string. + * \return Number of bytes sent. + */ +extern int telnet_raw_printf(telnet_t *telnet, const char *fmt, ...) + TELNET_GNU_PRINTF(2, 3); + +/*! + * \brief Send formatted data (no newline escaping). + * + * See telnet_raw_printf(). + */ +extern int telnet_raw_vprintf(telnet_t *telnet, const char *fmt, va_list va); + +/*! + * \brief Begin a new set of NEW-ENVIRON values to request or send. + * + * This function will begin the sub-negotiation block for sending or + * requesting NEW-ENVIRON values. + * + * The telnet_finish_newenviron() macro must be called after this + * function to terminate the NEW-ENVIRON command. + * + * \param telnet Telnet state tracker object. + * \param type One of TELNET_ENVIRON_SEND, TELNET_ENVIRON_IS, or + * TELNET_ENVIRON_INFO. + */ +extern void telnet_begin_newenviron(telnet_t *telnet, unsigned char type); + +/*! + * \brief Send a NEW-ENVIRON variable name or value. + * + * This can only be called between calls to telnet_begin_newenviron() and + * telnet_finish_newenviron(). + * + * \param telnet Telnet state tracker object. + * \param type One of TELNET_ENVIRON_VAR, TELNET_ENVIRON_USERVAR, or + * TELNET_ENVIRON_VALUE. + * \param string Variable name or value. + */ +extern void telnet_newenviron_value(telnet_t* telnet, unsigned char type, + const char *string); + +/*! + * \brief Finish a NEW-ENVIRON command. + * + * This must be called after a call to telnet_begin_newenviron() to finish a + * NEW-ENVIRON variable list. + * + * \param telnet Telnet state tracker object. + */ +#define telnet_finish_newenviron(telnet) telnet_finish_sb((telnet)) + +/*! + * \brief Send the TERMINAL-TYPE SEND command. + * + * Sends the sequence IAC TERMINAL-TYPE SEND. + * + * \param telnet Telnet state tracker object. + */ +extern void telnet_ttype_send(telnet_t *telnet); + +/*! + * \brief Send the TERMINAL-TYPE IS command. + * + * Sends the sequence IAC TERMINAL-TYPE IS "string". + * + * According to the RFC, the recipient of a TERMINAL-TYPE SEND shall + * send the next possible terminal-type the client supports. Upon sending + * the type, the client should switch modes to begin acting as the terminal + * type is just sent. + * + * The server may continue sending TERMINAL-TYPE IS until it receives a + * terminal type is understands. To indicate to the server that it has + * reached the end of the available optoins, the client must send the last + * terminal type a second time. When the server receives the same terminal + * type twice in a row, it knows it has seen all available terminal types. + * + * After the last terminal type is sent, if the client receives another + * TERMINAL-TYPE SEND command, it must begin enumerating the available + * terminal types from the very beginning. This allows the server to + * scan the available types for a preferred terminal type and, if none + * is found, to then ask the client to switch to an acceptable + * alternative. + * + * Note that if the client only supports a single terminal type, then + * simply sending that one type in response to every SEND will satisfy + * the behavior requirements. + * + * \param telnet Telnet state tracker object. + * \param ttype Name of the terminal-type being sent. + */ +extern void telnet_ttype_is(telnet_t *telnet, const char* ttype); + +/*! + * \brief Send a ZMP command. + * + * \param telnet Telnet state tracker object. + * \param argc Number of ZMP commands being sent. + * \param argv Array of argument strings. + */ +extern void telnet_send_zmp(telnet_t *telnet, size_t argc, const char **argv); + +/*! + * \brief Send a ZMP command. + * + * Arguments are listed out in var-args style. After the last argument, a + * NULL pointer must be passed in as a sentinel value. + * + * \param telnet Telnet state tracker object. + */ +extern void telnet_send_zmpv(telnet_t *telnet, ...) TELNET_GNU_SENTINEL; + +/*! + * \brief Send a ZMP command. + * + * See telnet_send_zmpv(). + */ +extern void telnet_send_vzmpv(telnet_t *telnet, va_list va); + +/*! + * \brief Begin sending a ZMP command + * + * \param telnet Telnet state tracker object. + * \param cmd The first argument (command name) for the ZMP command. + */ +extern void telnet_begin_zmp(telnet_t *telnet, const char *cmd); + +/*! + * \brief Send a ZMP command argument. + * + * \param telnet Telnet state tracker object. + * \param arg Telnet argument string. + */ +extern void telnet_zmp_arg(telnet_t *telnet, const char *arg); + +/*! + * \brief Finish a ZMP command. + * + * This must be called after a call to telnet_begin_zmp() to finish a + * ZMP argument list. + * + * \param telnet Telnet state tracker object. + */ +#define telnet_finish_zmp(telnet) telnet_finish_sb((telnet)) + +/* C++ support */ +#if defined(__cplusplus) +} /* extern "C" */ +#endif + +#endif /* !defined(LIBTELNET_INCLUDE) */ From dbbb9dac6854a8cd13d7dd934adc774d49a1bc07 Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Sun, 27 Jun 2021 16:48:08 +0100 Subject: [PATCH 02/22] Some very much not working telnet cocde --- src/amnuts230.c | 24 +++++-- src/includes/globals.h | 5 ++ src/includes/prototypes.h | 10 ++- src/includes/telnet.h | 17 +++++ src/objects.c | 3 + src/strings.c | 3 +- src/telnet.c | 136 ++++++++++++++++++++++++++++++++++++++ 7 files changed, 190 insertions(+), 8 deletions(-) create mode 100644 src/includes/telnet.h create mode 100644 src/telnet.c diff --git a/src/amnuts230.c b/src/amnuts230.c index bdcbf02..2fd6991 100644 --- a/src/amnuts230.c +++ b/src/amnuts230.c @@ -16,6 +16,7 @@ #include "globals.h" #include "commands.h" #include "prototypes.h" +#include "telnet.h" #undef __MAIN_FILE__ #endif @@ -369,18 +370,26 @@ main(int argc, char **argv) continue; } /* ignore control code replies */ + /* if (*inpstr == '\xff') { continue; } + */ + + telnet_recv(user->telnet, inpstr, len); + /* Deal with input chars. If the following if test succeeds we are dealing with a character mode client so call function. */ + /* if (!iscntrl((int) inpstr[len - 1]) || user->buffpos) { if (!get_charclient_line(user, inpstr, len)) { continue; } - } + }*/ + + curstr = next_str = inpstr; last_ptr = inpstr + len; for (;;) { @@ -842,6 +851,7 @@ accept_connection(int lsock) return; } user->socket = accept_sock; + user->telnet = telnet_init(telopts, telnet_event_handler, 0, user); user->login = LOGIN_NAME; user->last_input = time(0); #ifdef WIZPORT @@ -853,7 +863,8 @@ accept_connection(int lsock) strcpy(user->site, hostname); strcpy(user->ipsite, hostaddr); sprintf(user->site_port, "%d", ntohs(sa.sin_port)); - echo_on(user); + //echo_on(user); + telnet_negotiate(user->telnet, TELNET_WILL, TELNET_TELOPT_ECHO); write_user(user, "Give me a name: "); ++amsys->num_of_logins; #ifdef IDENTD @@ -3579,7 +3590,8 @@ write_user(UR_OBJECT user, const char *str) /* Flush buffer if above high water mark; * 6 chars is max a single char can expand into */ if (buffpos > OUT_BUFF_SIZE - 6) { - send(user->socket, buff, buffpos, 0); + telnet_printf(user->telnet, buff); + //send(user->socket, buff, buffpos, 0); buffpos = 0; } if (*s == '\n') { @@ -3628,11 +3640,13 @@ write_user(UR_OBJECT user, const char *str) } } if (buffpos) { - send(user->socket, buff, buffpos, 0); + telnet_printf(user->telnet, buff); + //send(user->socket, buff, buffpos, 0); } /* Reset terminal at end of string */ if (user->colour) { - write_sock(user->socket, colour_codes[0].esc_code); + telnet_printf(user->telnet, colour_codes[0].esc_code); + //write_sock(user->socket, colour_codes[0].esc_code); } } diff --git a/src/includes/globals.h b/src/includes/globals.h index 2a83252..7438e14 100644 --- a/src/includes/globals.h +++ b/src/includes/globals.h @@ -13,6 +13,8 @@ #ifndef AMNUTS_GLOBALS_H #define AMNUTS_GLOBALS_H +#include "../vendors/libtelnet/libtelnet.h" + #define ML_ENTRY(a) ML_EXPAND a /* Levels */ @@ -169,6 +171,8 @@ struct user_struct { int wizport; #endif int socket; + char telnet_line_buf[256]; + int telnet_line_pos; int buffpos; int filepos; int charcnt; @@ -230,6 +234,7 @@ struct user_struct { int money; int bank; int inctime; + telnet_t *telnet; }; /* diff --git a/src/includes/prototypes.h b/src/includes/prototypes.h index cd20d4c..db067cd 100644 --- a/src/includes/prototypes.h +++ b/src/includes/prototypes.h @@ -542,7 +542,7 @@ void show_spodlist(UR_OBJECT); /* - * functions in strings.h + * functions in strings.c */ int get_charclient_line(UR_OBJECT, char *, int); void terminate(char *); @@ -578,4 +578,12 @@ size_t teslen(const char *, size_t); void get_soundex(const char *, char *); char *word_time(int); +/* + * functions in telnet.c + */ +void telnet_event_handler(telnet_t *telnet, telnet_event_t *ev, void *user_data); +void user_telnet_input(UR_OBJECT user, const char *buffer, size_t size); +void user_telnet_online(const char *line, size_t overflow, void *user_data); +void user_telnet_send(int sock, const char *buffer, size_t size); + #endif diff --git a/src/includes/telnet.h b/src/includes/telnet.h new file mode 100644 index 0000000..c8e4ee5 --- /dev/null +++ b/src/includes/telnet.h @@ -0,0 +1,17 @@ +#ifndef AMNUTS_TELNET_H +#define AMNUTS_TELNET_H + +#include "../vendors/libtelnet/libtelnet.h" + +static const telnet_telopt_t telopts[] = { + { TELNET_TELOPT_ECHO, TELNET_WILL, TELNET_DONT }, + { TELNET_TELOPT_TTYPE, TELNET_WILL, TELNET_DONT }, + { TELNET_TELOPT_COMPRESS2, TELNET_WONT, TELNET_DO }, + { TELNET_TELOPT_ZMP, TELNET_WONT, TELNET_DO }, + { TELNET_TELOPT_MSSP, TELNET_WONT, TELNET_DO }, + { TELNET_TELOPT_BINARY, TELNET_WILL, TELNET_DO }, + { TELNET_TELOPT_NAWS, TELNET_WILL, TELNET_DONT }, + { -1, 0, 0 } +}; + +#endif diff --git a/src/objects.c b/src/objects.c index 18abf49..03b2263 100644 --- a/src/objects.c +++ b/src/objects.c @@ -375,6 +375,9 @@ destruct_user(UR_OBJECT user) } if (user) { + if (user->telnet) { + telnet_free(user->telnet); + } memset(user, 0, (sizeof *user)); free(user); user = NULL; diff --git a/src/strings.c b/src/strings.c index 14b32b2..75dea81 100644 --- a/src/strings.c +++ b/src/strings.c @@ -609,8 +609,7 @@ align_string(int pos, int cstrlen, int mark, const char *marker, break; case 1: /* centre align */ - sprintf(text2, "%*.*s%s%*.*s", spc, spc, "", vtext, spc - odd, spc - odd, - ""); + sprintf(text2, "%*.*s%s%*.*s", spc, spc, "", vtext, spc - odd, spc - odd, ""); break; case 2: /* right align */ diff --git a/src/telnet.c b/src/telnet.c new file mode 100644 index 0000000..e4da26e --- /dev/null +++ b/src/telnet.c @@ -0,0 +1,136 @@ +/**************************************************************************** + Amnuts version 2.3.0 - Copyright (C) Andrew Collington, 2003 + Last update: 2003-08-04 + + amnuts@talker.com + http://amnuts.talker.com/ + + based on + + NUTS version 3.3.3 (Triple Three :) - Copyright (C) Neil Robertson 1996 + ***************************************************************************/ + +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" +#include "telnet.h" + +/***************************************************************************/ + + +void +telnet_event_handler(telnet_t *telnet, telnet_event_t *ev, void *user_data) +{ + UR_OBJECT user = (UR_OBJECT)user_data; + + switch (ev->type) { + /* data received */ + case TELNET_EV_DATA: + user_telnet_input(user, ev->data.buffer, ev->data.size); + telnet_negotiate(telnet, TELNET_WONT, TELNET_TELOPT_ECHO); + telnet_negotiate(telnet, TELNET_WILL, TELNET_TELOPT_ECHO); + break; + /* data must be sent */ + case TELNET_EV_SEND: + write_sock(user->socket, (const char *)*ev->data.buffer); + + //user_telnet_send(user->socket, ev->data.buffer, ev->data.size); + break; + /* enable compress2 if accepted by client */ + case TELNET_EV_DO: + if (ev->neg.telopt == TELNET_TELOPT_COMPRESS2) { + telnet_begin_compress2(telnet); + } + break; + /* error */ + case TELNET_EV_ERROR: + write_syslog(ERRLOG, 1, "TELNET: Error during telnet event handler for %s\n", user->name); + destruct_user(user); + break; + /* ignore */ + default: + break; + } +} + + +void +linebuffer_push(char *buffer, size_t size, int *linepos, char ch, void *ud) { + + UR_OBJECT user = (UR_OBJECT)ud; + + /* CRLF -- line terminator */ + if (ch == '\n' && *linepos > 0 && buffer[*linepos - 1] == '\r') { + /* NUL terminate (replaces \r in buffer), notify app, clear */ + buffer[*linepos - 1] = 0; + *linepos = 0; + + /* CRNUL -- just a CR */ + } else if (ch == 0 && *linepos > 0 && buffer[*linepos - 1] == '\r') { + /* do nothing, the CR is already in the buffer */ + + /* anything else (including technically invalid CR followed by + * anything besides LF or NUL -- just buffer if we have room + * \r + */ + } else if (*linepos != (int)size) { + buffer[(*linepos)++] = ch; + + /* buffer overflow */ + } else { + /* terminate (NOTE: eats a byte), notify app, clear buffer */ + buffer[size - 1] = 0; + *linepos = 0; + } + if (user->charmode_echo + && ((user->login != LOGIN_PASSWD && user->login != LOGIN_CONFIRM) + || user->show_pass)) + send(user->socket, buffer, (size_t) linepos, 0); +} + +void +user_telnet_input(UR_OBJECT user, const char *buffer, size_t size) { + unsigned int i; + *user->buff = '\0'; + user->buffpos = 0; + for (i = 0; i != size; ++i) { + linebuffer_push(user->buff, sizeof(user->buff), &user->buffpos, (char)buffer[i], user); + } +} + + +/* process input line */ +void +user_telnet_online(const char *line, size_t overflow, void *user_data) { + UR_OBJECT user = (UR_OBJECT)user_data; + //login(user, (char*)line); + //write_user(user, "Hey!"); +} + +void user_telnet_send(int sock, const char *buffer, size_t size) { + int rs; + + /* ignore on invalid socket */ + if (sock == -1) + return; + + /* send data */ + while (size > 0) { + if ((rs = send(sock, buffer, (int)size, 0)) == -1) { + if (errno != EINTR && errno != ECONNRESET) { + fprintf(stderr, "send() failed: %s\n", strerror(errno)); + exit(1); + } else { + return; + } + } else if (rs == 0) { + fprintf(stderr, "send() unexpectedly returned 0\n"); + exit(1); + } + + /* update pointer and size to see if we've got more to send */ + buffer += rs; + size -= rs; + } +} \ No newline at end of file From b6d754df6302875f6542189288d13cc8e4402718 Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Fri, 8 Oct 2021 20:39:55 +0100 Subject: [PATCH 03/22] Tiny progression on libtelnet integration --- src/amnuts230.c | 291 +++++++++++++++++++------------------- src/includes/globals.h | 2 - src/includes/prototypes.h | 4 +- src/telnet.c | 100 ++----------- 4 files changed, 159 insertions(+), 238 deletions(-) diff --git a/src/amnuts230.c b/src/amnuts230.c index 2fd6991..02a4556 100644 --- a/src/amnuts230.c +++ b/src/amnuts230.c @@ -31,7 +31,7 @@ main(int argc, char **argv) struct timeval timeout; time_t beat; int len; - char inpstr[ARR_SIZE], future[ARR_SIZE], *next_str, *curstr, *last_ptr; + char inpstr[ARR_SIZE]; #ifdef IDENTD sds buffer; UR_OBJECT u; @@ -369,163 +369,156 @@ main(int argc, char **argv) disconnect_user(user); continue; } - /* ignore control code replies */ - /* - if (*inpstr == '\xff') { - continue; - } - */ - telnet_recv(user->telnet, inpstr, len); + } + } + return 0; /* This does not seem to be possible */ +} - /* - Deal with input chars. If the following if test succeeds we - are dealing with a character mode client so call function. - */ - /* - if (!iscntrl((int) inpstr[len - 1]) || user->buffpos) { - if (!get_charclient_line(user, inpstr, len)) { - continue; - } - }*/ +void +handle_user_input(UR_OBJECT user, char *inpstr, int len) { + char future[ARR_SIZE], *next_str, *curstr, *last_ptr; + /* + Deal with input chars. If the following if test succeeds we + are dealing with a character mode client so call function. + */ + if (user->buffpos) { + if (!get_charclient_line(user, inpstr, len)) { + return; + } + } + curstr = next_str = inpstr; + last_ptr = inpstr + len; + for (;;) { + curstr = next_str; + if (!curstr) { + break; + } + strcpy(future, curstr); + terminate(future); + next_str = strlen(future) + curstr + 1; - curstr = next_str = inpstr; - last_ptr = inpstr + len; - for (;;) { - curstr = next_str; - if (!curstr) { - break; - } - strcpy(future, curstr); - terminate(future); - next_str = strlen(future) + curstr + 1; - while (*next_str == '\n' || *next_str == '\r') { - ++next_str; - } - curstr = future; - if (next_str >= last_ptr - 2) { - next_str = NULL; - } + while (*next_str == '\n' || *next_str == '\r') { + ++next_str; + } + curstr = future; + if (next_str >= last_ptr - 2) { + next_str = NULL; + } - no_prompt = 0; - force_listen = 0; - destructed = 0; - *user->buff = '\0'; - user->buffpos = 0; - user->last_input = time(0); - if (user->login > 0) { - login(user, curstr); - continue; - } - /* - * If a dot on its own then execute last inpstr unless its a - * misc op or the user is on a remote site - */ - if (!user->misc_op) { - if ((!strcmp(curstr, ".")) && *user->inpstr_old) { - strcpy(curstr, user->inpstr_old); - vwrite_user(user, "%s\n", curstr); - }/* else save current one for next time */ - else { - if (*curstr) { - *user->inpstr_old = '\0'; - strncat(user->inpstr_old, curstr, REVIEW_LEN); - } - } - } - /* Main input check */ - clear_words(); - check_macros(user, curstr); - word_count = wordfind(curstr); - if (user->afk) { - if (user->afk == 2) { - if (!word_count) { - if (user->command_mode) { - prompt(user); - } - continue; - } - if (strcmp(user->pass, crypt(word[0], user->pass))) { - write_user(user, "Incorrect password.\n"); - prompt(user); - continue; - } - cls(user); - write_user(user, "Session unlocked, you are no longer AFK.\n"); - } else { - write_user(user, "You are no longer AFK.\n"); - } - *user->afk_mesg = '\0'; - if (has_review(user, rbfAFK)) { - write_user(user, - "\nYou have some tells in your afk review buffer. Use ~FCrevafk~RS to view them.\n\n"); - } - if (user->vis) { - vwrite_room_except(user->room, user, - "%s~RS comes back from being AFK.\n", - user->recap); - } - if (user->afk == 2) { - user->afk = 0; - prompt(user); - continue; - } - user->afk = 0; + no_prompt = 0; + force_listen = 0; + destructed = 0; + *user->buff = '\0'; + user->buffpos = 0; + user->last_input = time(0); + if (user->login > 0) { + login(user, curstr); + return; + } + /* + * If a dot on its own then execute last inpstr unless its a + * misc op or the user is on a remote site + */ + if (!user->misc_op) { + if ((!strcmp(curstr, ".")) && *user->inpstr_old) { + strcpy(curstr, user->inpstr_old); + vwrite_user(user, "%s\n", curstr); + }/* else save current one for next time */ + else { + if (*curstr) { + *user->inpstr_old = '\0'; + strncat(user->inpstr_old, curstr, REVIEW_LEN); } + } + } + /* Main input check */ + clear_words(); + check_macros(user, curstr); + word_count = wordfind(curstr); + if (user->afk) { + if (user->afk == 2) { if (!word_count) { - if (misc_ops(user, curstr)) { - continue; - } -#ifdef NETLINKS - action_nl(user, "", NULL); -#endif if (user->command_mode) { prompt(user); } - continue; + return; } - if (misc_ops(user, curstr)) { - continue; + if (strcmp(user->pass, crypt(word[0], user->pass)) != 0) { + write_user(user, "Incorrect password.\n"); + prompt(user); + return; } - if (!word_count) { - if (user->command_mode) { - prompt(user); - } - continue; - } - com_num = COUNT; - exec_com(user, curstr, user->command_mode ? COUNT : SAY); - if (!destructed) { - if (user->room) { - prompt(user); - } else { - switch (com_num) { + cls(user); + write_user(user, "Session unlocked, you are no longer AFK.\n"); + } else { + write_user(user, "You are no longer AFK.\n"); + } + *user->afk_mesg = '\0'; + if (has_review(user, rbfAFK)) { + write_user(user, + "\nYou have some tells in your afk review buffer. Use ~FCrevafk~RS to view them.\n\n"); + } + if (user->vis) { + vwrite_room_except(user->room, user, + "%s~RS comes back from being AFK.\n", + user->recap); + } + if (user->afk == 2) { + user->afk = 0; + prompt(user); + return; + } + user->afk = 0; + } + if (!word_count) { + if (misc_ops(user, curstr)) { + return; + } #ifdef NETLINKS - case HOME: + action_nl(user, "", NULL); #endif - case QUIT: - case MODE: - case PROMPT: - case SUICIDE: - case REBOOT: - case SHUTDOWN: - prompt(user); - break; - default: /* Not in enumerated values - Unknown command */ - break; - } - } + if (user->command_mode) { + prompt(user); + } + return; + } + if (misc_ops(user, curstr)) { + return; + } + if (!word_count) { + if (user->command_mode) { + prompt(user); + } + return; + } + com_num = COUNT; + exec_com(user, curstr, user->command_mode ? COUNT : SAY); + if (!destructed) { + if (user->room) { + prompt(user); + } else { + switch (com_num) { +#ifdef NETLINKS + case HOME: +#endif + case QUIT: + case MODE: + case PROMPT: + case SUICIDE: + case REBOOT: + case SHUTDOWN: + prompt(user); + break; + default: /* Not in enumerated values - Unknown command */ + break; } - } } } - return 0; /* This does not seem to be possible */ } - - /****************************************************************************** General functions used by the talker *****************************************************************************/ @@ -863,9 +856,10 @@ accept_connection(int lsock) strcpy(user->site, hostname); strcpy(user->ipsite, hostaddr); sprintf(user->site_port, "%d", ntohs(sa.sin_port)); - //echo_on(user); - telnet_negotiate(user->telnet, TELNET_WILL, TELNET_TELOPT_ECHO); + // echo_on(user); + telnet_negotiate(user->telnet, TELNET_WILL, TELNET_TELOPT_COMPRESS2); write_user(user, "Give me a name: "); + telnet_negotiate(user->telnet, TELNET_WILL, TELNET_TELOPT_ECHO); ++amsys->num_of_logins; #ifdef IDENTD if (amsys->resolve_ip == 3 && amsys->ident_state) { @@ -3590,8 +3584,9 @@ write_user(UR_OBJECT user, const char *str) /* Flush buffer if above high water mark; * 6 chars is max a single char can expand into */ if (buffpos > OUT_BUFF_SIZE - 6) { - telnet_printf(user->telnet, buff); - //send(user->socket, buff, buffpos, 0); + //telnet_printf(user->telnet, "%s", buff); + //telnet_send(user->telnet, buff, strlen(buff)); + send(user->socket, buff, buffpos, 0); buffpos = 0; } if (*s == '\n') { @@ -3640,13 +3635,15 @@ write_user(UR_OBJECT user, const char *str) } } if (buffpos) { - telnet_printf(user->telnet, buff); - //send(user->socket, buff, buffpos, 0); + //telnet_printf(user->telnet, "%s", buff); + //telnet_send(user->telnet, buff, strlen(buff)); + send(user->socket, buff, buffpos, 0); } /* Reset terminal at end of string */ if (user->colour) { - telnet_printf(user->telnet, colour_codes[0].esc_code); - //write_sock(user->socket, colour_codes[0].esc_code); + //telnet_printf(user->telnet, "%s", colour_codes[0].esc_code); + //telnet_send(user->telnet, buff, strlen(buff)); + write_sock(user->socket, colour_codes[0].esc_code); } } @@ -3948,7 +3945,7 @@ write_friends(UR_OBJECT user, const char *str, int revt) /* * Write a string to system log * type = what syslog(s) to write to - * write_time = whether or not you have a time stamp imcluded + * write_time = whether or not you have a time stamp included * str = string passed - possibly with %s, %d, etc * ... = variable length args passed */ diff --git a/src/includes/globals.h b/src/includes/globals.h index 7438e14..3f9a457 100644 --- a/src/includes/globals.h +++ b/src/includes/globals.h @@ -171,8 +171,6 @@ struct user_struct { int wizport; #endif int socket; - char telnet_line_buf[256]; - int telnet_line_pos; int buffpos; int filepos; int charcnt; diff --git a/src/includes/prototypes.h b/src/includes/prototypes.h index db067cd..8b7e173 100644 --- a/src/includes/prototypes.h +++ b/src/includes/prototypes.h @@ -40,6 +40,7 @@ extern "C" { * functions in amnuts230.c */ int main(int, char **); +void handle_user_input(UR_OBJECT user, char *inpstr, int len); void check_directories(void); int find_user_listed(const char *); int user_logged_on(const char *); @@ -582,8 +583,5 @@ char *word_time(int); * functions in telnet.c */ void telnet_event_handler(telnet_t *telnet, telnet_event_t *ev, void *user_data); -void user_telnet_input(UR_OBJECT user, const char *buffer, size_t size); -void user_telnet_online(const char *line, size_t overflow, void *user_data); -void user_telnet_send(int sock, const char *buffer, size_t size); #endif diff --git a/src/telnet.c b/src/telnet.c index e4da26e..9199a22 100644 --- a/src/telnet.c +++ b/src/telnet.c @@ -27,15 +27,13 @@ telnet_event_handler(telnet_t *telnet, telnet_event_t *ev, void *user_data) switch (ev->type) { /* data received */ case TELNET_EV_DATA: - user_telnet_input(user, ev->data.buffer, ev->data.size); + handle_user_input(user, (char *)ev->data.buffer, ev->data.size); telnet_negotiate(telnet, TELNET_WONT, TELNET_TELOPT_ECHO); telnet_negotiate(telnet, TELNET_WILL, TELNET_TELOPT_ECHO); break; /* data must be sent */ case TELNET_EV_SEND: - write_sock(user->socket, (const char *)*ev->data.buffer); - - //user_telnet_send(user->socket, ev->data.buffer, ev->data.size); + write_sock(user->socket, ev->data.buffer); break; /* enable compress2 if accepted by client */ case TELNET_EV_DO: @@ -46,91 +44,21 @@ telnet_event_handler(telnet_t *telnet, telnet_event_t *ev, void *user_data) /* error */ case TELNET_EV_ERROR: write_syslog(ERRLOG, 1, "TELNET: Error during telnet event handler for %s\n", user->name); - destruct_user(user); + disconnect_user(user); break; /* ignore */ + case TELNET_EV_IAC: + case TELNET_EV_WILL: + case TELNET_EV_WONT: + case TELNET_EV_DONT: + case TELNET_EV_SUBNEGOTIATION: + case TELNET_EV_COMPRESS: + case TELNET_EV_ZMP: + case TELNET_EV_TTYPE: + case TELNET_EV_ENVIRON: + case TELNET_EV_MSSP: + case TELNET_EV_WARNING: default: break; } } - - -void -linebuffer_push(char *buffer, size_t size, int *linepos, char ch, void *ud) { - - UR_OBJECT user = (UR_OBJECT)ud; - - /* CRLF -- line terminator */ - if (ch == '\n' && *linepos > 0 && buffer[*linepos - 1] == '\r') { - /* NUL terminate (replaces \r in buffer), notify app, clear */ - buffer[*linepos - 1] = 0; - *linepos = 0; - - /* CRNUL -- just a CR */ - } else if (ch == 0 && *linepos > 0 && buffer[*linepos - 1] == '\r') { - /* do nothing, the CR is already in the buffer */ - - /* anything else (including technically invalid CR followed by - * anything besides LF or NUL -- just buffer if we have room - * \r - */ - } else if (*linepos != (int)size) { - buffer[(*linepos)++] = ch; - - /* buffer overflow */ - } else { - /* terminate (NOTE: eats a byte), notify app, clear buffer */ - buffer[size - 1] = 0; - *linepos = 0; - } - if (user->charmode_echo - && ((user->login != LOGIN_PASSWD && user->login != LOGIN_CONFIRM) - || user->show_pass)) - send(user->socket, buffer, (size_t) linepos, 0); -} - -void -user_telnet_input(UR_OBJECT user, const char *buffer, size_t size) { - unsigned int i; - *user->buff = '\0'; - user->buffpos = 0; - for (i = 0; i != size; ++i) { - linebuffer_push(user->buff, sizeof(user->buff), &user->buffpos, (char)buffer[i], user); - } -} - - -/* process input line */ -void -user_telnet_online(const char *line, size_t overflow, void *user_data) { - UR_OBJECT user = (UR_OBJECT)user_data; - //login(user, (char*)line); - //write_user(user, "Hey!"); -} - -void user_telnet_send(int sock, const char *buffer, size_t size) { - int rs; - - /* ignore on invalid socket */ - if (sock == -1) - return; - - /* send data */ - while (size > 0) { - if ((rs = send(sock, buffer, (int)size, 0)) == -1) { - if (errno != EINTR && errno != ECONNRESET) { - fprintf(stderr, "send() failed: %s\n", strerror(errno)); - exit(1); - } else { - return; - } - } else if (rs == 0) { - fprintf(stderr, "send() unexpectedly returned 0\n"); - exit(1); - } - - /* update pointer and size to see if we've got more to send */ - buffer += rs; - size -= rs; - } -} \ No newline at end of file From e6189a1c758d6cf40776e72e7d294afe78b14d4a Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Tue, 12 Nov 2024 00:35:08 +0000 Subject: [PATCH 04/22] Write via libtelnet and flexible write_sock/write_telnet functions. --- src/amnuts.c | 72 ++++++++++++++++++++++++++++++--------- src/includes/defines.h | 7 ++++ src/includes/prototypes.h | 6 +++- src/includes/telnet.h | 16 ++++----- src/strings.c | 10 ++---- src/telnet.c | 15 +------- 6 files changed, 79 insertions(+), 47 deletions(-) diff --git a/src/amnuts.c b/src/amnuts.c index 140fa13..0eee0d6 100644 --- a/src/amnuts.c +++ b/src/amnuts.c @@ -386,7 +386,7 @@ handle_user_input(UR_OBJECT user, char *inpstr, int len) { Deal with input chars. If the following if test succeeds we are dealing with a character mode client so call function. */ - if (user->buffpos) { + if (!iscntrl((int) inpstr[len - 1]) || user->buffpos) { if (!get_charclient_line(user, inpstr, len)) { return; } @@ -861,10 +861,8 @@ accept_connection(int lsock) strcpy(user->site, hostname); strcpy(user->ipsite, hostaddr); sprintf(user->site_port, "%d", ntohs(sa.sin_port)); - // echo_on(user); - telnet_negotiate(user->telnet, TELNET_WILL, TELNET_TELOPT_COMPRESS2); + echo_on(user); write_user(user, "Give me a name: "); - telnet_negotiate(user->telnet, TELNET_WILL, TELNET_TELOPT_ECHO); ++amsys->num_of_logins; #ifdef IDENTD if (amsys->resolve_ip == 3 && amsys->ident_state) { @@ -3521,7 +3519,7 @@ count_lines(char *filename) *****************************************************************************/ /* - * Write a NULL terminated string to a socket + * Write a NULL terminated string to a socket. */ void write_sock(int s, const char *str) @@ -3529,6 +3527,34 @@ write_sock(int s, const char *str) send(s, str, strlen(str), 0); } +void +write_sock_with_size(int s, const char *str, size_t length) { + send(s, str, length, 0); +} + +void +write_sock_with_size_and_flags(int s, const char *str, size_t length, int flag) { + send(s, str, length, flag); +} + +/* + * Write a string via libtelnet + */ +void +write_telnet(telnet_t *t, const char *str) +{ + telnet_printf(t, str); +} + +void +write_telnet_with_size(telnet_t *t, const char *str, size_t length) +{ + sds buff; + buff = sdscatprintf(sdsempty(), "%.*s", (int)length, str); + telnet_printf(t, buff); + sdsfree(buff); +} + /* * a vargs wrapper for the write_user function. * This will enable you to send arguments directly to this function. @@ -3589,9 +3615,11 @@ write_user(UR_OBJECT user, const char *str) /* Flush buffer if above high watermark; * 6 chars is max a single char can expand into */ if (buffpos > OUT_BUFF_SIZE - 6) { - //telnet_printf(user->telnet, "%s", buff); - //telnet_send(user->telnet, buff, strlen(buff)); - send(user->socket, buff, buffpos, 0); + if (user->telnet) { + write_telnet(user->telnet, buff, buffpos); + } else { + write_sock(user->socket, buff, buffpos); + } buffpos = 0; } if (*s == '\n') { @@ -3640,15 +3668,19 @@ write_user(UR_OBJECT user, const char *str) } } if (buffpos) { - //telnet_printf(user->telnet, "%s", buff); - //telnet_send(user->telnet, buff, strlen(buff)); - send(user->socket, buff, buffpos, 0); + if (user->telnet) { + write_telnet(user->telnet, buff, buffpos); + } else { + write_sock(user->socket, buff, buffpos, 0); + } } /* Reset terminal at end of string */ if (user->colour) { - //telnet_printf(user->telnet, "%s", colour_codes[0].esc_code); - //telnet_send(user->telnet, buff, strlen(buff)); - write_sock(user->socket, colour_codes[0].esc_code); + if (user->telnet) { + write_telnet(user->telnet, colour_codes[0].esc_code); + } else { + write_sock(user->socket, colour_codes[0].esc_code); + } } } @@ -4158,7 +4190,11 @@ more(UR_OBJECT user, int sock, const char *filename) /* Process line from file */ for (s = str; *s; ++s) { if (buffpos > OUT_BUFF_SIZE - (6 < USER_NAME_LEN ? USER_NAME_LEN : 6)) { - send(sock, buff, buffpos, 0); + if (user && user->telnet) { + write_telnet(user->telnet, buff, buffpos); + } else { + write_sock(sock, buff, buffpos, 0); + } buffpos = 0; } if (*s == '\n') { @@ -4219,7 +4255,11 @@ more(UR_OBJECT user, int sock, const char *filename) lines += len / SCREEN_WRAP + (len < SCREEN_WRAP); } if (buffpos && sock != -1) { - send(sock, buff, buffpos, 0); + if (user && user->telnet) { + write_telnet(user->telnet, buff, buffpos); + } else { + write_sock(sock, buff, buffpos, 0); + } } /* if user is logging on dont page file */ if (!user) { diff --git a/src/includes/defines.h b/src/includes/defines.h index 6421a55..15f253d 100644 --- a/src/includes/defines.h +++ b/src/includes/defines.h @@ -206,3 +206,10 @@ #define rbfAFK BIT(2) #endif + +/* macros for some variable length functions */ +#define write_sock(...) write_sock_dispatch(__VA_ARGS__, write_sock_with_size_and_flags, write_sock_with_size, write_sock)(__VA_ARGS__) +#define write_sock_dispatch(_1, _2, _3, _4, NAME, ...) NAME + +#define write_telnet(...) write_telnet_dispatch(__VA_ARGS__, write_telnet_with_size, write_telnet)(__VA_ARGS__) +#define write_telnet_dispatch(_1, _2, _3, NAME, ...) NAME diff --git a/src/includes/prototypes.h b/src/includes/prototypes.h index 3f4682c..1e1fbe4 100644 --- a/src/includes/prototypes.h +++ b/src/includes/prototypes.h @@ -73,7 +73,11 @@ void parse_commands(void); void clean_files(char *); int remove_top_bottom(char *, int); int count_lines(char *); -void write_sock(int, const char *); +void write_sock(int s, const char *str); +void write_sock_with_size(int s, const char *str, size_t length); +void write_sock_with_size_and_flags(int s, const char *str, size_t length, int flag); +void write_telnet(telnet_t *t, const char *str); +void write_telnet_with_size(telnet_t *t, const char *str, size_t length); void vwrite_user(UR_OBJECT, const char *, ...) __attribute__((__format__(__printf__, 2, 3))); void write_user(UR_OBJECT, const char *); diff --git a/src/includes/telnet.h b/src/includes/telnet.h index c8e4ee5..4811024 100644 --- a/src/includes/telnet.h +++ b/src/includes/telnet.h @@ -4,14 +4,14 @@ #include "../vendors/libtelnet/libtelnet.h" static const telnet_telopt_t telopts[] = { - { TELNET_TELOPT_ECHO, TELNET_WILL, TELNET_DONT }, - { TELNET_TELOPT_TTYPE, TELNET_WILL, TELNET_DONT }, - { TELNET_TELOPT_COMPRESS2, TELNET_WONT, TELNET_DO }, - { TELNET_TELOPT_ZMP, TELNET_WONT, TELNET_DO }, - { TELNET_TELOPT_MSSP, TELNET_WONT, TELNET_DO }, - { TELNET_TELOPT_BINARY, TELNET_WILL, TELNET_DO }, - { TELNET_TELOPT_NAWS, TELNET_WILL, TELNET_DONT }, - { -1, 0, 0 } + { TELNET_TELOPT_BINARY, TELNET_WONT, TELNET_DO }, + { TELNET_TELOPT_COMPRESS2, TELNET_WILL, TELNET_DONT }, + { TELNET_TELOPT_ECHO, TELNET_WILL, TELNET_DONT }, + { TELNET_TELOPT_MSSP, TELNET_WONT, TELNET_DO }, + { TELNET_TELOPT_NAWS, TELNET_WILL, TELNET_DONT }, + { TELNET_TELOPT_TTYPE, TELNET_WONT, TELNET_DO }, + { TELNET_TELOPT_ZMP, TELNET_WONT, TELNET_DO }, + { -1, 0, 0 } }; #endif diff --git a/src/strings.c b/src/strings.c index b55bfd3..aa4ac6b 100644 --- a/src/strings.c +++ b/src/strings.c @@ -201,10 +201,7 @@ resolve_check(const char *wd) void echo_off(UR_OBJECT user) { - if (user->show_pass) { - return; - } - vwrite_user(user, "%c%c%c", '\xff', '\xfb', '\x01'); + telnet_negotiate(user->telnet, TELNET_WILL, TELNET_TELOPT_ECHO); } /* @@ -213,10 +210,7 @@ echo_off(UR_OBJECT user) void echo_on(UR_OBJECT user) { - if (user->show_pass) { - return; - } - vwrite_user(user, "%c%c%c", '\xff', '\xfc', '\x01'); + telnet_negotiate(user->telnet, TELNET_WONT, TELNET_TELOPT_ECHO); } /* diff --git a/src/telnet.c b/src/telnet.c index 9199a22..23ce5ad 100644 --- a/src/telnet.c +++ b/src/telnet.c @@ -28,12 +28,10 @@ telnet_event_handler(telnet_t *telnet, telnet_event_t *ev, void *user_data) /* data received */ case TELNET_EV_DATA: handle_user_input(user, (char *)ev->data.buffer, ev->data.size); - telnet_negotiate(telnet, TELNET_WONT, TELNET_TELOPT_ECHO); - telnet_negotiate(telnet, TELNET_WILL, TELNET_TELOPT_ECHO); break; /* data must be sent */ case TELNET_EV_SEND: - write_sock(user->socket, ev->data.buffer); + write_sock(user->socket, ev->data.buffer, ev->data.size); break; /* enable compress2 if accepted by client */ case TELNET_EV_DO: @@ -47,17 +45,6 @@ telnet_event_handler(telnet_t *telnet, telnet_event_t *ev, void *user_data) disconnect_user(user); break; /* ignore */ - case TELNET_EV_IAC: - case TELNET_EV_WILL: - case TELNET_EV_WONT: - case TELNET_EV_DONT: - case TELNET_EV_SUBNEGOTIATION: - case TELNET_EV_COMPRESS: - case TELNET_EV_ZMP: - case TELNET_EV_TTYPE: - case TELNET_EV_ENVIRON: - case TELNET_EV_MSSP: - case TELNET_EV_WARNING: default: break; } From 450071e97b83269afe6ccd938b0802b6f388a2b2 Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Tue, 12 Nov 2024 00:40:06 +0000 Subject: [PATCH 05/22] Updated headers --- src/includes/telnet.h | 11 +++++++++++ src/telnet.c | 10 +++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/includes/telnet.h b/src/includes/telnet.h index 4811024..066d274 100644 --- a/src/includes/telnet.h +++ b/src/includes/telnet.h @@ -1,3 +1,14 @@ +/**************************************************************************** + Amnuts - Copyright (C) Andrew Collington, 1996-2024 + Last update: Sometime in 2024 + + talker@amnuts.net - https://amnuts.net/ + + based on + + NUTS version 3.3.3 (Triple Three :) - Copyright (C) Neil Robertson 1996 + ***************************************************************************/ + #ifndef AMNUTS_TELNET_H #define AMNUTS_TELNET_H diff --git a/src/telnet.c b/src/telnet.c index 23ce5ad..253ae3e 100644 --- a/src/telnet.c +++ b/src/telnet.c @@ -1,15 +1,15 @@ /**************************************************************************** - Amnuts version 2.3.0 - Copyright (C) Andrew Collington, 2003 - Last update: 2003-08-04 + Amnuts - Copyright (C) Andrew Collington, 1996-2024 + Last update: Sometime in 2024 - amnuts@talker.com - http://amnuts.talker.com/ + talker@amnuts.net - https://amnuts.net/ - based on + based on NUTS version 3.3.3 (Triple Three :) - Copyright (C) Neil Robertson 1996 ***************************************************************************/ + #include "defines.h" #include "globals.h" #include "commands.h" From a33994b06f855eb5fc907795d83691c6ed360983 Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Sat, 23 Nov 2024 11:24:01 +0000 Subject: [PATCH 06/22] Don't be implicit about where headers are located --- src/admin.c | 8 ++++---- src/amnuts.c | 10 +++++----- src/games.c | 8 ++++---- src/messages.c | 8 ++++---- src/netlinks.c | 8 ++++---- src/objects.c | 8 ++++---- src/pager.c | 8 ++++---- src/reboot.c | 8 ++++---- src/rooms.c | 10 +++++----- src/speech.c | 8 ++++---- src/spodlist.c | 10 +++++----- src/strings.c | 8 ++++---- src/telnet.c | 10 +++++----- 13 files changed, 56 insertions(+), 56 deletions(-) diff --git a/src/admin.c b/src/admin.c index 19c90fa..ef56d63 100644 --- a/src/admin.c +++ b/src/admin.c @@ -9,10 +9,10 @@ NUTS version 3.3.3 (Triple Three :) - Copyright (C) Neil Robertson 1996 ***************************************************************************/ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "./includes/defines.h" +#include "./includes/globals.h" +#include "./includes/commands.h" +#include "./includes/prototypes.h" /*****************************************************************************/ diff --git a/src/amnuts.c b/src/amnuts.c index 0eee0d6..3c7070b 100644 --- a/src/amnuts.c +++ b/src/amnuts.c @@ -11,11 +11,11 @@ #ifndef __MAIN_FILE__ #define __MAIN_FILE__ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" -#include "telnet.h" +#include "./includes/defines.h" +#include "./includes/globals.h" +#include "./includes/commands.h" +#include "./includes/prototypes.h" +#include "./includes/telnet.h" #undef __MAIN_FILE__ #endif diff --git a/src/games.c b/src/games.c index c4315c1..3cd8ac2 100644 --- a/src/games.c +++ b/src/games.c @@ -11,10 +11,10 @@ #ifdef GAMES -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "./includes/defines.h" +#include "./includes/globals.h" +#include "./includes/commands.h" +#include "./includes/prototypes.h" /*****************************************************************************/ diff --git a/src/messages.c b/src/messages.c index 9156981..f2d74af 100644 --- a/src/messages.c +++ b/src/messages.c @@ -9,10 +9,10 @@ NUTS version 3.3.3 (Triple Three :) - Copyright (C) Neil Robertson 1996 ***************************************************************************/ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "./includes/defines.h" +#include "./includes/globals.h" +#include "./includes/commands.h" +#include "./includes/prototypes.h" /***************************************************************************/ diff --git a/src/netlinks.c b/src/netlinks.c index 4fd3bd9..4c56e73 100644 --- a/src/netlinks.c +++ b/src/netlinks.c @@ -10,10 +10,10 @@ ***************************************************************************/ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "./includes/defines.h" +#include "./includes/globals.h" +#include "./includes/commands.h" +#include "./includes/prototypes.h" #ifndef __SDS_H #include "./vendors/sds/sds.h" #endif diff --git a/src/objects.c b/src/objects.c index 5f9a1d0..5b3138e 100644 --- a/src/objects.c +++ b/src/objects.c @@ -9,10 +9,10 @@ NUTS version 3.3.3 (Triple Three :) - Copyright (C) Neil Robertson 1996 ***************************************************************************/ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "./includes/defines.h" +#include "./includes/globals.h" +#include "./includes/commands.h" +#include "./includes/prototypes.h" /***************************************************************************/ diff --git a/src/pager.c b/src/pager.c index 70f9a30..5924370 100644 --- a/src/pager.c +++ b/src/pager.c @@ -9,10 +9,10 @@ NUTS version 3.3.3 (Triple Three :) - Copyright (C) Neil Robertson 1996 ***************************************************************************/ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "./includes/defines.h" +#include "./includes/globals.h" +#include "./includes/commands.h" +#include "./includes/prototypes.h" /*************************************************************************** diff --git a/src/reboot.c b/src/reboot.c index b73fa15..16d2851 100644 --- a/src/reboot.c +++ b/src/reboot.c @@ -9,10 +9,10 @@ NUTS version 3.3.3 (Triple Three :) - Copyright (C) Neil Robertson 1996 ***************************************************************************/ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "./includes/defines.h" +#include "./includes/globals.h" +#include "./includes/commands.h" +#include "./includes/prototypes.h" /*************************************************************************** diff --git a/src/rooms.c b/src/rooms.c index b910e4e..80a6e5c 100644 --- a/src/rooms.c +++ b/src/rooms.c @@ -9,11 +9,11 @@ NUTS version 3.3.3 (Triple Three :) - Copyright (C) Neil Robertson 1996 ***************************************************************************/ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" -#include "rooms.h" +#include "./includes/defines.h" +#include "./includes/globals.h" +#include "./includes/commands.h" +#include "./includes/prototypes.h" +#include "./includes/rooms.h" /***************************************************************************/ diff --git a/src/speech.c b/src/speech.c index aa7a9ca..8194a0b 100644 --- a/src/speech.c +++ b/src/speech.c @@ -9,10 +9,10 @@ NUTS version 3.3.3 (Triple Three :) - Copyright (C) Neil Robertson 1996 ***************************************************************************/ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "./includes/defines.h" +#include "./includes/globals.h" +#include "./includes/commands.h" +#include "./includes/prototypes.h" /***************************************************************************/ diff --git a/src/spodlist.c b/src/spodlist.c index b72ae68..f5e5687 100644 --- a/src/spodlist.c +++ b/src/spodlist.c @@ -9,11 +9,11 @@ NUTS version 3.3.3 (Triple Three :) - Copyright (C) Neil Robertson 1996 ***************************************************************************/ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "spodlist.h" -#include "prototypes.h" +#include "./includes/defines.h" +#include "./includes/globals.h" +#include "./includes/commands.h" +#include "./includes/spodlist.h" +#include "./includes/prototypes.h" /*************************************************************************** diff --git a/src/strings.c b/src/strings.c index aa4ac6b..863f1dd 100644 --- a/src/strings.c +++ b/src/strings.c @@ -9,10 +9,10 @@ NUTS version 3.3.3 (Triple Three :) - Copyright (C) Neil Robertson 1996 ***************************************************************************/ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "./includes/defines.h" +#include "./includes/globals.h" +#include "./includes/commands.h" +#include "./includes/prototypes.h" /***************************************************************************/ diff --git a/src/telnet.c b/src/telnet.c index 253ae3e..9d7758b 100644 --- a/src/telnet.c +++ b/src/telnet.c @@ -10,11 +10,11 @@ ***************************************************************************/ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" -#include "telnet.h" +#include "./includes/defines.h" +#include "./includes/globals.h" +#include "./includes/commands.h" +#include "./includes/prototypes.h" +#include "./includes/telnet.h" /***************************************************************************/ From b30be996230ce7f0c50d05dbb413a45034855d78 Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Sat, 23 Nov 2024 11:39:07 +0000 Subject: [PATCH 07/22] Don't be implicit about where headers are located --- src/commands/account.c | 8 ++++---- src/commands/accreq.c | 8 ++++---- src/commands/addhistory.c | 8 ++++---- src/commands/afk.c | 8 ++++---- src/commands/allclones.c | 8 ++++---- src/commands/arrest.c | 8 ++++---- src/commands/ban.c | 8 ++++---- src/commands/bcast.c | 8 ++++---- src/commands/beep.c | 8 ++++---- src/commands/bring.c | 8 ++++---- src/commands/cafk.c | 8 ++++---- src/commands/calendar.c | 8 ++++---- src/commands/cedit.c | 8 ++++---- src/commands/change_pass.c | 8 ++++---- src/commands/charecho.c | 8 ++++---- src/commands/clearline.c | 8 ++++---- src/commands/clone_emote.c | 8 ++++---- src/commands/clone_hear.c | 8 ++++---- src/commands/clone_say.c | 8 ++++---- src/commands/clone_switch.c | 8 ++++---- src/commands/cls.c | 8 ++++---- src/commands/cmdcount.c | 8 ++++---- src/commands/colour.c | 8 ++++---- src/commands/connect_netlink.c | 8 ++++---- src/commands/copyto.c | 8 ++++---- src/commands/create_clone.c | 8 ++++---- src/commands/cshouts.c | 8 ++++---- src/commands/ctells.c | 8 ++++---- src/commands/ctopic.c | 8 ++++---- src/commands/delete_suggestions.c | 8 ++++---- src/commands/delete_user.c | 8 ++++---- src/commands/demote.c | 8 ++++---- src/commands/destroy_clone.c | 8 ++++---- src/commands/disconnect_netlink.c | 8 ++++---- src/commands/display.c | 8 ++++---- src/commands/dmail.c | 8 ++++---- src/commands/dump.c | 8 ++++---- src/commands/echo.c | 8 ++++---- src/commands/emote.c | 8 ++++---- src/commands/enter_profile.c | 8 ++++---- src/commands/examine.c | 8 ++++---- src/commands/expires.c | 8 ++++---- src/commands/fix.c | 8 ++++---- src/commands/flagged.c | 8 ++++---- src/commands/fmail.c | 8 ++++---- src/commands/force.c | 8 ++++---- src/commands/friend_emote.c | 8 ++++---- src/commands/friend_say.c | 8 ++++---- src/commands/friends.c | 8 ++++---- src/commands/fsmail.c | 8 ++++---- src/commands/gcom.c | 8 ++++---- src/commands/go.c | 8 ++++---- src/commands/greet.c | 8 ++++---- src/commands/grepusers.c | 8 ++++---- src/commands/help.c | 8 ++++---- src/commands/history.c | 8 ++++---- src/commands/home.c | 8 ++++---- src/commands/ignlist.c | 8 ++++---- src/commands/ignuser.c | 8 ++++---- src/commands/invite.c | 8 ++++---- src/commands/join.c | 8 ++++---- src/commands/kill_user.c | 8 ++++---- src/commands/last.c | 8 ++++---- src/commands/letmein.c | 8 ++++---- src/commands/listbans.c | 8 ++++---- src/commands/listen.c | 8 ++++---- src/commands/lmail.c | 8 ++++---- src/commands/logging.c | 8 ++++---- src/commands/look.c | 8 ++++---- src/commands/macros.c | 8 ++++---- src/commands/mail_from.c | 8 ++++---- src/commands/minlogin.c | 8 ++++---- src/commands/mkinvis.c | 8 ++++---- src/commands/mkvis.c | 8 ++++---- src/commands/morph.c | 8 ++++---- src/commands/move.c | 8 ++++---- src/commands/mutter.c | 8 ++++---- src/commands/muzzle.c | 8 ++++---- src/commands/myclones.c | 8 ++++---- src/commands/myroom.c | 8 ++++---- src/commands/myroom_admin.c | 8 ++++---- src/commands/myroom_bgone.c | 8 ++++---- src/commands/myroom_key.c | 8 ++++---- src/commands/myroom_lock.c | 8 ++++---- src/commands/myroom_paint.c | 8 ++++---- src/commands/myroom_rename.c | 8 ++++---- src/commands/netdata.c | 8 ++++---- src/commands/netstat.c | 8 ++++---- src/commands/pemote.c | 8 ++++---- src/commands/picture_all.c | 8 ++++---- src/commands/picture_tell.c | 8 ++++---- src/commands/plead.c | 8 ++++---- src/commands/preview.c | 8 ++++---- src/commands/promote.c | 8 ++++---- src/commands/promote_temporary.c | 8 ++++---- src/commands/purge.c | 8 ++++---- src/commands/quick_call.c | 8 ++++---- src/commands/ranks.c | 8 ++++---- src/commands/rcountu.c | 8 ++++---- src/commands/read_board.c | 8 ++++---- src/commands/reboot_talker.c | 8 ++++---- src/commands/recount.c | 8 ++++---- src/commands/reload_room.c | 8 ++++---- src/commands/reminder.c | 8 ++++---- src/commands/remote_stat.c | 8 ++++---- src/commands/resite.c | 8 ++++---- src/commands/retire.c | 8 ++++---- src/commands/revafk.c | 8 ++++---- src/commands/revclr.c | 8 ++++---- src/commands/revedit.c | 8 ++++---- src/commands/review.c | 8 ++++---- src/commands/revshout.c | 8 ++++---- src/commands/revtell.c | 8 ++++---- src/commands/rmail.c | 8 ++++---- src/commands/room.c | 8 ++++---- src/commands/samesite.c | 8 ++++---- src/commands/say.c | 8 ++++---- src/commands/sayto.c | 8 ++++---- src/commands/search_boards.c | 8 ++++---- src/commands/semote.c | 8 ++++---- src/commands/set.c | 8 ++++---- src/commands/set_desc.c | 8 ++++---- src/commands/set_ignore.c | 8 ++++---- src/commands/set_iophrase.c | 8 ++++---- src/commands/set_room_access.c | 8 ++++---- src/commands/set_topic.c | 8 ++++---- src/commands/setcmdlev.c | 8 ++++---- src/commands/sfrom.c | 8 ++++---- src/commands/shackle.c | 8 ++++---- src/commands/shout.c | 8 ++++---- src/commands/show.c | 8 ++++---- src/commands/show_version.c | 8 ++++---- src/commands/shutdown_com.c | 8 ++++---- src/commands/sing_it.c | 8 ++++---- src/commands/site.c | 8 ++++---- src/commands/smail.c | 8 ++++---- src/commands/sreboot.c | 8 ++++---- src/commands/status.c | 8 ++++---- src/commands/sto.c | 8 ++++---- src/commands/suggestions.c | 8 ++++---- src/commands/suicide.c | 8 ++++---- src/commands/system.c | 8 ++++---- src/commands/tell_user.c | 8 ++++---- src/commands/think_it.c | 8 ++++---- src/commands/time.c | 8 ++++---- src/commands/toggle_ignall.c | 8 ++++---- src/commands/toggle_mode.c | 8 ++++---- src/commands/toggle_prompt.c | 8 ++++---- src/commands/toggle_swearban.c | 8 ++++---- src/commands/unarrest.c | 8 ++++---- src/commands/unban.c | 8 ++++---- src/commands/uninvite.c | 8 ++++---- src/commands/unmuzzle.c | 8 ++++---- src/commands/unretire.c | 8 ++++---- src/commands/unshackle.c | 8 ++++---- src/commands/verify.c | 8 ++++---- src/commands/viewlog.c | 8 ++++---- src/commands/visibility.c | 8 ++++---- src/commands/visit.c | 8 ++++---- src/commands/wake.c | 8 ++++---- src/commands/who.c | 8 ++++---- src/commands/wipe_board.c | 8 ++++---- src/commands/wizemote.c | 8 ++++---- src/commands/wizlist.c | 8 ++++---- src/commands/wizshout.c | 8 ++++---- src/commands/write_board.c | 8 ++++---- src/commands/xcom.c | 8 ++++---- 167 files changed, 668 insertions(+), 668 deletions(-) diff --git a/src/commands/account.c b/src/commands/account.c index 4ffaba5..233484f 100644 --- a/src/commands/account.c +++ b/src/commands/account.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Create an account for a user if new users from their site have been diff --git a/src/commands/accreq.c b/src/commands/accreq.c index c488b23..05f48af 100644 --- a/src/commands/accreq.c +++ b/src/commands/accreq.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * A newbie is requesting an account. Get his email address off him so we diff --git a/src/commands/addhistory.c b/src/commands/addhistory.c index bf74180..82d3e9c 100644 --- a/src/commands/addhistory.c +++ b/src/commands/addhistory.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * allows a user to add to another users history list diff --git a/src/commands/afk.c b/src/commands/afk.c index 5416136..4532e6b 100644 --- a/src/commands/afk.c +++ b/src/commands/afk.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Do AFK diff --git a/src/commands/allclones.c b/src/commands/allclones.c index b874ba3..6c9d907 100644 --- a/src/commands/allclones.c +++ b/src/commands/allclones.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Show all clones on the system diff --git a/src/commands/arrest.c b/src/commands/arrest.c index d15319b..52cb455 100644 --- a/src/commands/arrest.c +++ b/src/commands/arrest.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Put annoying user in jail diff --git a/src/commands/ban.c b/src/commands/ban.c index ebc3abe..54692ff 100644 --- a/src/commands/ban.c +++ b/src/commands/ban.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Ban a site, domain or user diff --git a/src/commands/bcast.c b/src/commands/bcast.c index 7ef7b7d..a7db68b 100644 --- a/src/commands/bcast.c +++ b/src/commands/bcast.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Broadcast an important message diff --git a/src/commands/beep.c b/src/commands/beep.c index 22e6ad7..1bec8ea 100644 --- a/src/commands/beep.c +++ b/src/commands/beep.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Beep a user - as tell but with audio warning diff --git a/src/commands/bring.c b/src/commands/bring.c index 27d7bc1..aadb623 100644 --- a/src/commands/bring.c +++ b/src/commands/bring.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * bring a user to the same room diff --git a/src/commands/cafk.c b/src/commands/cafk.c index ce63702..10ce796 100644 --- a/src/commands/cafk.c +++ b/src/commands/cafk.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Clear the tell buffer of the user diff --git a/src/commands/calendar.c b/src/commands/calendar.c index cf8f400..094027b 100644 --- a/src/commands/calendar.c +++ b/src/commands/calendar.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * display the calendar to the user diff --git a/src/commands/cedit.c b/src/commands/cedit.c index 34bb367..ab52b7b 100644 --- a/src/commands/cedit.c +++ b/src/commands/cedit.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Clear the tell buffer of the user diff --git a/src/commands/change_pass.c b/src/commands/change_pass.c index 99288f8..f317b12 100644 --- a/src/commands/change_pass.c +++ b/src/commands/change_pass.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Change users password. Only GODs and above can change another users diff --git a/src/commands/charecho.c b/src/commands/charecho.c index 1471437..8f5f3e5 100644 --- a/src/commands/charecho.c +++ b/src/commands/charecho.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Set the character mode echo on or off. This is only for users logging in diff --git a/src/commands/clearline.c b/src/commands/clearline.c index 3592a60..7ce5742 100644 --- a/src/commands/clearline.c +++ b/src/commands/clearline.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Free a hung socket diff --git a/src/commands/clone_emote.c b/src/commands/clone_emote.c index 5533cb8..7e8340d 100644 --- a/src/commands/clone_emote.c +++ b/src/commands/clone_emote.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Make a clone emote diff --git a/src/commands/clone_hear.c b/src/commands/clone_hear.c index 7d144ec..6d127a3 100644 --- a/src/commands/clone_hear.c +++ b/src/commands/clone_hear.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Set what a clone will hear, either all speech , just bad language diff --git a/src/commands/clone_say.c b/src/commands/clone_say.c index 5529a0a..a32a0f7 100644 --- a/src/commands/clone_say.c +++ b/src/commands/clone_say.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Make a clone speak diff --git a/src/commands/clone_switch.c b/src/commands/clone_switch.c index 4d0e503..17bfad7 100644 --- a/src/commands/clone_switch.c +++ b/src/commands/clone_switch.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * User swaps places with his own clone. All we do is swap the rooms the objects are in diff --git a/src/commands/cls.c b/src/commands/cls.c index 4ac45c3..73fc1b5 100644 --- a/src/commands/cls.c +++ b/src/commands/cls.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Clear the screen diff --git a/src/commands/cmdcount.c b/src/commands/cmdcount.c index bce35aa..5969cc3 100644 --- a/src/commands/cmdcount.c +++ b/src/commands/cmdcount.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Display how many times a command has been used, and its overall diff --git a/src/commands/colour.c b/src/commands/colour.c index 19a0272..1bf2ad5 100644 --- a/src/commands/colour.c +++ b/src/commands/colour.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Display colours to user diff --git a/src/commands/connect_netlink.c b/src/commands/connect_netlink.c index 908cc9b..46a44bc 100644 --- a/src/commands/connect_netlink.c +++ b/src/commands/connect_netlink.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" #ifdef NETLINKS diff --git a/src/commands/copyto.c b/src/commands/copyto.c index 5b69683..9afae47 100644 --- a/src/commands/copyto.c +++ b/src/commands/copyto.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * get users which to send copies of smail to diff --git a/src/commands/create_clone.c b/src/commands/create_clone.c index c315b24..d1cc293 100644 --- a/src/commands/create_clone.c +++ b/src/commands/create_clone.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Clone a user in another room diff --git a/src/commands/cshouts.c b/src/commands/cshouts.c index 95fbcbd..c032edc 100644 --- a/src/commands/cshouts.c +++ b/src/commands/cshouts.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Clear the shout buffer of the talker diff --git a/src/commands/ctells.c b/src/commands/ctells.c index de05a4a..7ee4f31 100644 --- a/src/commands/ctells.c +++ b/src/commands/ctells.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Clear the tell buffer of the user diff --git a/src/commands/ctopic.c b/src/commands/ctopic.c index 0f2b7e9..6c4a142 100644 --- a/src/commands/ctopic.c +++ b/src/commands/ctopic.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * clears a room topic diff --git a/src/commands/delete_suggestions.c b/src/commands/delete_suggestions.c index 1ff646c..bd071ac 100644 --- a/src/commands/delete_suggestions.c +++ b/src/commands/delete_suggestions.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * delete suggestions from the board diff --git a/src/commands/delete_user.c b/src/commands/delete_user.c index f795c67..78e8da8 100644 --- a/src/commands/delete_user.c +++ b/src/commands/delete_user.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Delete a user diff --git a/src/commands/demote.c b/src/commands/demote.c index f27b602..9e876cc 100644 --- a/src/commands/demote.c +++ b/src/commands/demote.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Demote a user diff --git a/src/commands/destroy_clone.c b/src/commands/destroy_clone.c index 7649979..caadede 100644 --- a/src/commands/destroy_clone.c +++ b/src/commands/destroy_clone.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Destroy user clone diff --git a/src/commands/disconnect_netlink.c b/src/commands/disconnect_netlink.c index 127f5b1..e6e0072 100644 --- a/src/commands/disconnect_netlink.c +++ b/src/commands/disconnect_netlink.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" #ifdef NETLINKS diff --git a/src/commands/display.c b/src/commands/display.c index d4f06c9..c82bfb0 100644 --- a/src/commands/display.c +++ b/src/commands/display.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Display some files to the user. This was once integrated with the ".help" command, diff --git a/src/commands/dmail.c b/src/commands/dmail.c index 87390b0..9679143 100644 --- a/src/commands/dmail.c +++ b/src/commands/dmail.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Delete some or all of your mail. A problem here is once we have deleted diff --git a/src/commands/dump.c b/src/commands/dump.c index bf8fdbb..b2021a9 100644 --- a/src/commands/dump.c +++ b/src/commands/dump.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Allows you to dump certain things to files as a record diff --git a/src/commands/echo.c b/src/commands/echo.c index 7f2b688..b07242b 100644 --- a/src/commands/echo.c +++ b/src/commands/echo.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Echo something to screen diff --git a/src/commands/emote.c b/src/commands/emote.c index 81afc71..105dcaa 100644 --- a/src/commands/emote.c +++ b/src/commands/emote.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Emote something diff --git a/src/commands/enter_profile.c b/src/commands/enter_profile.c index 52565ae..bd6d38a 100644 --- a/src/commands/enter_profile.c +++ b/src/commands/enter_profile.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Enter user profile diff --git a/src/commands/examine.c b/src/commands/examine.c index 21fb388..ec9e4dc 100644 --- a/src/commands/examine.c +++ b/src/commands/examine.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Examine a user diff --git a/src/commands/expires.c b/src/commands/expires.c index ceba7b9..545d3d0 100644 --- a/src/commands/expires.c +++ b/src/commands/expires.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Set a user to either expire after a set time, or never expire diff --git a/src/commands/fix.c b/src/commands/fix.c index 1108026..ceccbd9 100644 --- a/src/commands/fix.c +++ b/src/commands/fix.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Change whether a rooms access is fixed or not diff --git a/src/commands/flagged.c b/src/commands/flagged.c index 557b03c..10c971b 100644 --- a/src/commands/flagged.c +++ b/src/commands/flagged.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * See if user is banned diff --git a/src/commands/fmail.c b/src/commands/fmail.c index 91b65c4..1b65529 100644 --- a/src/commands/fmail.c +++ b/src/commands/fmail.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * allows a user to email specific messages to themselves diff --git a/src/commands/force.c b/src/commands/force.c index db2c4fd..7261d93 100644 --- a/src/commands/force.c +++ b/src/commands/force.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Force a user to do something diff --git a/src/commands/friend_emote.c b/src/commands/friend_emote.c index 8458879..a5e6e3b 100644 --- a/src/commands/friend_emote.c +++ b/src/commands/friend_emote.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Emote something to all the people on the suers friends list diff --git a/src/commands/friend_say.c b/src/commands/friend_say.c index 2f45a08..7274003 100644 --- a/src/commands/friend_say.c +++ b/src/commands/friend_say.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Say user speech to all people listed on users friends list diff --git a/src/commands/friends.c b/src/commands/friends.c index ee283b7..fddf67c 100644 --- a/src/commands/friends.c +++ b/src/commands/friends.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * take a users name and add it to friends list diff --git a/src/commands/fsmail.c b/src/commands/fsmail.c index 414681b..46b53fb 100644 --- a/src/commands/fsmail.c +++ b/src/commands/fsmail.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Send mail message to all people on your friends list diff --git a/src/commands/gcom.c b/src/commands/gcom.c index 04dcf6d..dd107df 100644 --- a/src/commands/gcom.c +++ b/src/commands/gcom.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * stop a user from using a certain command diff --git a/src/commands/go.c b/src/commands/go.c index e5091d7..21d44b9 100644 --- a/src/commands/go.c +++ b/src/commands/go.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Move to another room diff --git a/src/commands/greet.c b/src/commands/greet.c index 682405e..da7c448 100644 --- a/src/commands/greet.c +++ b/src/commands/greet.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * print out greeting in large letters diff --git a/src/commands/grepusers.c b/src/commands/grepusers.c index 37e0bc7..617d896 100644 --- a/src/commands/grepusers.c +++ b/src/commands/grepusers.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * This command allows you to do a search for any user names that match diff --git a/src/commands/help.c b/src/commands/help.c index 2050f07..f0ce44f 100644 --- a/src/commands/help.c +++ b/src/commands/help.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Show the list of commands, credits, and display the help files for the given command diff --git a/src/commands/history.c b/src/commands/history.c index 69ba87b..a585abf 100644 --- a/src/commands/history.c +++ b/src/commands/history.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * shows the history file of a given user diff --git a/src/commands/home.c b/src/commands/home.c index dfc80be..051a585 100644 --- a/src/commands/home.c +++ b/src/commands/home.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" #ifdef NETLINKS diff --git a/src/commands/ignlist.c b/src/commands/ignlist.c index 29d1af8..67f5c9b 100644 --- a/src/commands/ignlist.c +++ b/src/commands/ignlist.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * displays what the user is currently listening to/ignoring diff --git a/src/commands/ignuser.c b/src/commands/ignuser.c index 1a52990..e6f9e54 100644 --- a/src/commands/ignuser.c +++ b/src/commands/ignuser.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * set to ignore/listen to a user diff --git a/src/commands/invite.c b/src/commands/invite.c index 54b4969..63aabdc 100644 --- a/src/commands/invite.c +++ b/src/commands/invite.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Invite a user into a private room diff --git a/src/commands/join.c b/src/commands/join.c index 9c94172..a0727bd 100644 --- a/src/commands/join.c +++ b/src/commands/join.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Join a user in another room diff --git a/src/commands/kill_user.c b/src/commands/kill_user.c index 1994d2d..e9538f4 100644 --- a/src/commands/kill_user.c +++ b/src/commands/kill_user.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Kill a user - bump them off the talker diff --git a/src/commands/last.c b/src/commands/last.c index 54b4f39..18b8a6a 100644 --- a/src/commands/last.c +++ b/src/commands/last.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Shows when a user was last logged on diff --git a/src/commands/letmein.c b/src/commands/letmein.c index cf8d672..a5880aa 100644 --- a/src/commands/letmein.c +++ b/src/commands/letmein.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Ask to be let into a private room diff --git a/src/commands/listbans.c b/src/commands/listbans.c index ef6fa54..6cd3955 100644 --- a/src/commands/listbans.c +++ b/src/commands/listbans.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * List banned sites or users diff --git a/src/commands/listen.c b/src/commands/listen.c index 9a9c32b..9ac7801 100644 --- a/src/commands/listen.c +++ b/src/commands/listen.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Allows a user to listen to everything again diff --git a/src/commands/lmail.c b/src/commands/lmail.c index b49c00c..3e50094 100644 --- a/src/commands/lmail.c +++ b/src/commands/lmail.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Send mail message to everyone diff --git a/src/commands/logging.c b/src/commands/logging.c index 35b10f3..56ec6d2 100644 --- a/src/commands/logging.c +++ b/src/commands/logging.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Turn on and off each individual system log, or globally on and off diff --git a/src/commands/look.c b/src/commands/look.c index f621370..83f41bb 100644 --- a/src/commands/look.c +++ b/src/commands/look.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Display details of room diff --git a/src/commands/macros.c b/src/commands/macros.c index 3b63b49..02a4922 100644 --- a/src/commands/macros.c +++ b/src/commands/macros.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Display user macros diff --git a/src/commands/mail_from.c b/src/commands/mail_from.c index 3b56313..1c7ae28 100644 --- a/src/commands/mail_from.c +++ b/src/commands/mail_from.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Show list of people your mail is from without seeing the whole lot diff --git a/src/commands/minlogin.c b/src/commands/minlogin.c index d7091ee..9116bf3 100644 --- a/src/commands/minlogin.c +++ b/src/commands/minlogin.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Set minlogin level diff --git a/src/commands/mkinvis.c b/src/commands/mkinvis.c index 360c9d6..65e497d 100644 --- a/src/commands/mkinvis.c +++ b/src/commands/mkinvis.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Force a user to become invisible diff --git a/src/commands/mkvis.c b/src/commands/mkvis.c index efc5f19..b87bb0d 100644 --- a/src/commands/mkvis.c +++ b/src/commands/mkvis.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Force a user to become visible diff --git a/src/commands/morph.c b/src/commands/morph.c index 99cee2c..0ab51bd 100644 --- a/src/commands/morph.c +++ b/src/commands/morph.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" #ifndef __SDS_H #include "../vendors/sds/sds.h" #endif diff --git a/src/commands/move.c b/src/commands/move.c index 6ef49b4..34fccc8 100644 --- a/src/commands/move.c +++ b/src/commands/move.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Wizard moves a user to another room diff --git a/src/commands/mutter.c b/src/commands/mutter.c index 6b3de5c..271cfcd 100644 --- a/src/commands/mutter.c +++ b/src/commands/mutter.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Tell something to everyone but one person diff --git a/src/commands/muzzle.c b/src/commands/muzzle.c index 5d739c5..55ab543 100644 --- a/src/commands/muzzle.c +++ b/src/commands/muzzle.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Muzzle an annoying user so he cant speak, emote, echo, write, smail diff --git a/src/commands/myclones.c b/src/commands/myclones.c index eb61892..5b5261f 100644 --- a/src/commands/myclones.c +++ b/src/commands/myclones.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Show users own clones diff --git a/src/commands/myroom.c b/src/commands/myroom.c index 7504f4c..2f3e1b4 100644 --- a/src/commands/myroom.c +++ b/src/commands/myroom.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * lets a user enter their own room. It creates the room if !exists diff --git a/src/commands/myroom_admin.c b/src/commands/myroom_admin.c index f680658..a7568fb 100644 --- a/src/commands/myroom_admin.c +++ b/src/commands/myroom_admin.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" #ifndef __SDS_H #include "../vendors/sds/sds.h" #endif diff --git a/src/commands/myroom_bgone.c b/src/commands/myroom_bgone.c index 63e1c75..a49cc22 100644 --- a/src/commands/myroom_bgone.c +++ b/src/commands/myroom_bgone.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * allow a user to bump others from their personal room diff --git a/src/commands/myroom_key.c b/src/commands/myroom_key.c index 94a3bf7..00dce7a 100644 --- a/src/commands/myroom_key.c +++ b/src/commands/myroom_key.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * this function allows users to give access to others even if their personal room diff --git a/src/commands/myroom_lock.c b/src/commands/myroom_lock.c index a4acd38..f81ac3f 100644 --- a/src/commands/myroom_lock.c +++ b/src/commands/myroom_lock.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * allows a user to lock their room out to access from anyone diff --git a/src/commands/myroom_paint.c b/src/commands/myroom_paint.c index 78d82ba..01a9ded 100644 --- a/src/commands/myroom_paint.c +++ b/src/commands/myroom_paint.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Enter a description for a personal room diff --git a/src/commands/myroom_rename.c b/src/commands/myroom_rename.c index 1f6f981..294e9bf 100644 --- a/src/commands/myroom_rename.c +++ b/src/commands/myroom_rename.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * allows a user to rename their room diff --git a/src/commands/netdata.c b/src/commands/netdata.c index e9039b2..11ada40 100644 --- a/src/commands/netdata.c +++ b/src/commands/netdata.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" #ifdef NETLINKS diff --git a/src/commands/netstat.c b/src/commands/netstat.c index bf205b9..6c2c67c 100644 --- a/src/commands/netstat.c +++ b/src/commands/netstat.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" #ifdef NETLINKS diff --git a/src/commands/pemote.c b/src/commands/pemote.c index 3d2e705..27ed50f 100644 --- a/src/commands/pemote.c +++ b/src/commands/pemote.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Do a private emote diff --git a/src/commands/picture_all.c b/src/commands/picture_all.c index 5b51bcd..5c9556f 100644 --- a/src/commands/picture_all.c +++ b/src/commands/picture_all.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" #ifndef __SDS_H #include "../vendors/sds/sds.h" #endif diff --git a/src/commands/picture_tell.c b/src/commands/picture_tell.c index e4ee583..8099f89 100644 --- a/src/commands/picture_tell.c +++ b/src/commands/picture_tell.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" #ifndef __SDS_H #include "../vendors/sds/sds.h" #endif diff --git a/src/commands/plead.c b/src/commands/plead.c index eb4eb9f..3b3d8ab 100644 --- a/src/commands/plead.c +++ b/src/commands/plead.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * ask all the law, (sos), no muzzle restrictions diff --git a/src/commands/preview.c b/src/commands/preview.c index 812b409..fcb348b 100644 --- a/src/commands/preview.c +++ b/src/commands/preview.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" #ifndef __SDS_H #include "../vendors/sds/sds.h" #endif diff --git a/src/commands/promote.c b/src/commands/promote.c index aa1fec0..8a82fe1 100644 --- a/src/commands/promote.c +++ b/src/commands/promote.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Promote a user diff --git a/src/commands/promote_temporary.c b/src/commands/promote_temporary.c index 194be1d..8fa13cb 100644 --- a/src/commands/promote_temporary.c +++ b/src/commands/promote_temporary.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * do a promotion of a user that lasts only for the current session diff --git a/src/commands/purge.c b/src/commands/purge.c index 4528968..789bc5a 100644 --- a/src/commands/purge.c +++ b/src/commands/purge.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * allows the user to call the purge function diff --git a/src/commands/quick_call.c b/src/commands/quick_call.c index c0c05fb..56dc334 100644 --- a/src/commands/quick_call.c +++ b/src/commands/quick_call.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * set a name for a quick call diff --git a/src/commands/ranks.c b/src/commands/ranks.c index d47c6b2..545ea2f 100644 --- a/src/commands/ranks.c +++ b/src/commands/ranks.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * show the ranks and commands per level for the talker diff --git a/src/commands/rcountu.c b/src/commands/rcountu.c index 1522c3d..f8f0cb6 100644 --- a/src/commands/rcountu.c +++ b/src/commands/rcountu.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * read all the user files to check if a user exists diff --git a/src/commands/read_board.c b/src/commands/read_board.c index 12d02b5..b056c0f 100644 --- a/src/commands/read_board.c +++ b/src/commands/read_board.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Read the message board diff --git a/src/commands/reboot_talker.c b/src/commands/reboot_talker.c index 035b88e..2bfd00c 100644 --- a/src/commands/reboot_talker.c +++ b/src/commands/reboot_talker.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Reboot talker interface func diff --git a/src/commands/recount.c b/src/commands/recount.c index 391264b..cb3ddab 100644 --- a/src/commands/recount.c +++ b/src/commands/recount.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Remove any expired messages from boards unless force = 2 in which case diff --git a/src/commands/reload_room.c b/src/commands/reload_room.c index f21ba2d..b5e2792 100644 --- a/src/commands/reload_room.c +++ b/src/commands/reload_room.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Reloads the description for one or all rooms--in case you have edited the diff --git a/src/commands/reminder.c b/src/commands/reminder.c index 2a37e97..50fe080 100644 --- a/src/commands/reminder.c +++ b/src/commands/reminder.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Display the reminders a user has to them diff --git a/src/commands/remote_stat.c b/src/commands/remote_stat.c index c11013a..ae8899c 100644 --- a/src/commands/remote_stat.c +++ b/src/commands/remote_stat.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" #ifdef NETLINKS diff --git a/src/commands/resite.c b/src/commands/resite.c index 10593bd..6e58939 100644 --- a/src/commands/resite.c +++ b/src/commands/resite.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" #ifdef IDENTD diff --git a/src/commands/retire.c b/src/commands/retire.c index 5ca7f11..5ddfbc8 100644 --- a/src/commands/retire.c +++ b/src/commands/retire.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Retire a user--i.e., remove from the wizlist but do not alter level diff --git a/src/commands/revafk.c b/src/commands/revafk.c index 17ffcdb..f85b844 100644 --- a/src/commands/revafk.c +++ b/src/commands/revafk.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Show recorded tells and pemotes diff --git a/src/commands/revclr.c b/src/commands/revclr.c index eb48ada..a6d3e3f 100644 --- a/src/commands/revclr.c +++ b/src/commands/revclr.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Clear the review buffer diff --git a/src/commands/revedit.c b/src/commands/revedit.c index b54b488..e3e0908 100644 --- a/src/commands/revedit.c +++ b/src/commands/revedit.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Show recorded tells and pemotes diff --git a/src/commands/review.c b/src/commands/review.c index b55f6bb..b433b56 100644 --- a/src/commands/review.c +++ b/src/commands/review.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * See review of conversation diff --git a/src/commands/revshout.c b/src/commands/revshout.c index 90ce20b..eaa0c5f 100644 --- a/src/commands/revshout.c +++ b/src/commands/revshout.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * See review of shouts diff --git a/src/commands/revtell.c b/src/commands/revtell.c index 4c373fa..7742be3 100644 --- a/src/commands/revtell.c +++ b/src/commands/revtell.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Show recorded tells and pemotes diff --git a/src/commands/rmail.c b/src/commands/rmail.c index fe1c706..313b3a1 100644 --- a/src/commands/rmail.c +++ b/src/commands/rmail.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Read your mail diff --git a/src/commands/room.c b/src/commands/room.c index 50a69bf..2e50606 100644 --- a/src/commands/room.c +++ b/src/commands/room.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" #include "rooms.h" /* diff --git a/src/commands/samesite.c b/src/commands/samesite.c index 56911d7..87cee3e 100644 --- a/src/commands/samesite.c +++ b/src/commands/samesite.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Display all the people logged on from the same site as user diff --git a/src/commands/say.c b/src/commands/say.c index 3973771..1fb46f1 100644 --- a/src/commands/say.c +++ b/src/commands/say.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Say user speech. diff --git a/src/commands/sayto.c b/src/commands/sayto.c index f01bcf5..b78b665 100644 --- a/src/commands/sayto.c +++ b/src/commands/sayto.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Direct a say to someone, even though the whole room can hear it diff --git a/src/commands/search_boards.c b/src/commands/search_boards.c index 5e5e0f6..26ec731 100644 --- a/src/commands/search_boards.c +++ b/src/commands/search_boards.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Search all the boards for the words given in the list. Rooms fixed to diff --git a/src/commands/semote.c b/src/commands/semote.c index 25f7a87..7d1d281 100644 --- a/src/commands/semote.c +++ b/src/commands/semote.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Do a shout emote diff --git a/src/commands/set.c b/src/commands/set.c index fdcacdd..14bb3eb 100644 --- a/src/commands/set.c +++ b/src/commands/set.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Set the user attributes diff --git a/src/commands/set_desc.c b/src/commands/set_desc.c index e354585..74b7bfb 100644 --- a/src/commands/set_desc.c +++ b/src/commands/set_desc.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Set user description diff --git a/src/commands/set_ignore.c b/src/commands/set_ignore.c index b4d9d9b..6665832 100644 --- a/src/commands/set_ignore.c +++ b/src/commands/set_ignore.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * sets up a channel for the user to ignore diff --git a/src/commands/set_iophrase.c b/src/commands/set_iophrase.c index 6da2f98..a20135e 100644 --- a/src/commands/set_iophrase.c +++ b/src/commands/set_iophrase.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Set in and out phrases diff --git a/src/commands/set_room_access.c b/src/commands/set_room_access.c index f46c1be..5177420 100644 --- a/src/commands/set_room_access.c +++ b/src/commands/set_room_access.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Set rooms to public or private diff --git a/src/commands/set_topic.c b/src/commands/set_topic.c index 9f1e33c..2cc8a24 100644 --- a/src/commands/set_topic.c +++ b/src/commands/set_topic.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Set the room topic diff --git a/src/commands/setcmdlev.c b/src/commands/setcmdlev.c index edf8934..772dc15 100644 --- a/src/commands/setcmdlev.c +++ b/src/commands/setcmdlev.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Allows a user to alter the minimum level which can use the command given diff --git a/src/commands/sfrom.c b/src/commands/sfrom.c index 3e96266..5c68de4 100644 --- a/src/commands/sfrom.c +++ b/src/commands/sfrom.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Show list of people suggestions are from without seeing the whole lot diff --git a/src/commands/shackle.c b/src/commands/shackle.c index 6d24e0e..8c87a1b 100644 --- a/src/commands/shackle.c +++ b/src/commands/shackle.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Stop a user from using the go command and leaving the room they are currently in diff --git a/src/commands/shout.c b/src/commands/shout.c index 4c7505b..755a8f7 100644 --- a/src/commands/shout.c +++ b/src/commands/shout.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Shout something diff --git a/src/commands/show.c b/src/commands/show.c index 5b0ca21..54f9481 100644 --- a/src/commands/show.c +++ b/src/commands/show.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Show command, i.e., "Type --> " diff --git a/src/commands/show_version.c b/src/commands/show_version.c index 7aa9fe2..37e843f 100644 --- a/src/commands/show_version.c +++ b/src/commands/show_version.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Show version number and some small stats of the talker diff --git a/src/commands/shutdown_com.c b/src/commands/shutdown_com.c index b7df079..7205310 100644 --- a/src/commands/shutdown_com.c +++ b/src/commands/shutdown_com.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Shutdown talker interface func. Countdown time is entered in seconds so diff --git a/src/commands/sing_it.c b/src/commands/sing_it.c index 0c27d38..36f580b 100644 --- a/src/commands/sing_it.c +++ b/src/commands/sing_it.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * put speech in a music notes diff --git a/src/commands/site.c b/src/commands/site.c index 2e480d4..97f0d26 100644 --- a/src/commands/site.c +++ b/src/commands/site.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Site a user diff --git a/src/commands/smail.c b/src/commands/smail.c index 082e50c..81fe13c 100644 --- a/src/commands/smail.c +++ b/src/commands/smail.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Send mail message diff --git a/src/commands/sreboot.c b/src/commands/sreboot.c index c9c1d64..450b6d7 100644 --- a/src/commands/sreboot.c +++ b/src/commands/sreboot.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Seamless reboot talker interface func diff --git a/src/commands/status.c b/src/commands/status.c index bae4002..b728f21 100644 --- a/src/commands/status.c +++ b/src/commands/status.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Show some user stats diff --git a/src/commands/sto.c b/src/commands/sto.c index 3395316..e91094d 100644 --- a/src/commands/sto.c +++ b/src/commands/sto.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Shout something to someone diff --git a/src/commands/suggestions.c b/src/commands/suggestions.c index 362a03c..83e2854 100644 --- a/src/commands/suggestions.c +++ b/src/commands/suggestions.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Write a suggestion to the board, or read if if you can diff --git a/src/commands/suicide.c b/src/commands/suicide.c index 4ce9222..b9ed38c 100644 --- a/src/commands/suicide.c +++ b/src/commands/suicide.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Allow a user to delete their own account diff --git a/src/commands/system.c b/src/commands/system.c index 9cc4fde..00456e8 100644 --- a/src/commands/system.c +++ b/src/commands/system.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Show talker system parameters etc diff --git a/src/commands/tell_user.c b/src/commands/tell_user.c index c50586e..af0048b 100644 --- a/src/commands/tell_user.c +++ b/src/commands/tell_user.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Tell another user something diff --git a/src/commands/think_it.c b/src/commands/think_it.c index 36a365d..7cb3892 100644 --- a/src/commands/think_it.c +++ b/src/commands/think_it.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * put speech in a think bubbles diff --git a/src/commands/time.c b/src/commands/time.c index f5c8e00..09c71a5 100644 --- a/src/commands/time.c +++ b/src/commands/time.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Get current system time diff --git a/src/commands/toggle_ignall.c b/src/commands/toggle_ignall.c index 45f6961..97b0d5a 100644 --- a/src/commands/toggle_ignall.c +++ b/src/commands/toggle_ignall.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Switch ignoring all on and off diff --git a/src/commands/toggle_mode.c b/src/commands/toggle_mode.c index eb5cd6c..ae43462 100644 --- a/src/commands/toggle_mode.c +++ b/src/commands/toggle_mode.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Switch between command and speech mode diff --git a/src/commands/toggle_prompt.c b/src/commands/toggle_prompt.c index f415ea0..7c1cfa9 100644 --- a/src/commands/toggle_prompt.c +++ b/src/commands/toggle_prompt.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Switch prompt on and off diff --git a/src/commands/toggle_swearban.c b/src/commands/toggle_swearban.c index d1e4cd3..e1baf91 100644 --- a/src/commands/toggle_swearban.c +++ b/src/commands/toggle_swearban.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Switch swearing ban on and off diff --git a/src/commands/unarrest.c b/src/commands/unarrest.c index 199b08a..9425673 100644 --- a/src/commands/unarrest.c +++ b/src/commands/unarrest.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Unarrest a user who is currently under arrest and in jail diff --git a/src/commands/unban.c b/src/commands/unban.c index 6c2514e..db1e864 100644 --- a/src/commands/unban.c +++ b/src/commands/unban.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * uban a site (or domain) or user diff --git a/src/commands/uninvite.c b/src/commands/uninvite.c index 6f84405..d0f9eda 100644 --- a/src/commands/uninvite.c +++ b/src/commands/uninvite.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * no longer invite a user to the room you are in if you invited them diff --git a/src/commands/unmuzzle.c b/src/commands/unmuzzle.c index a63364e..f69afc1 100644 --- a/src/commands/unmuzzle.c +++ b/src/commands/unmuzzle.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Unmuzzle the bastard now he has apologised and grovelled enough via email diff --git a/src/commands/unretire.c b/src/commands/unretire.c index c027caa..0fe37b7 100644 --- a/src/commands/unretire.c +++ b/src/commands/unretire.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Unretire a user--i.e., put them back on show on the wizlist diff --git a/src/commands/unshackle.c b/src/commands/unshackle.c index cbc1295..f0f222d 100644 --- a/src/commands/unshackle.c +++ b/src/commands/unshackle.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Allow a user to move between rooms again diff --git a/src/commands/verify.c b/src/commands/verify.c index 77a7cdf..5dec86e 100644 --- a/src/commands/verify.c +++ b/src/commands/verify.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * verify that mail has been sent to the address supplied diff --git a/src/commands/viewlog.c b/src/commands/viewlog.c index c59be3c..94fb4c9 100644 --- a/src/commands/viewlog.c +++ b/src/commands/viewlog.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * View the system log diff --git a/src/commands/visibility.c b/src/commands/visibility.c index ea47b8d..f68813a 100644 --- a/src/commands/visibility.c +++ b/src/commands/visibility.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Set user visible or invisible diff --git a/src/commands/visit.c b/src/commands/visit.c index 196e1b3..fe162ad 100644 --- a/src/commands/visit.c +++ b/src/commands/visit.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" #ifndef __SDS_H #include "../vendors/sds/sds.h" #endif diff --git a/src/commands/wake.c b/src/commands/wake.c index 95993f9..2873395 100644 --- a/src/commands/wake.c +++ b/src/commands/wake.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Wake up some idle sod diff --git a/src/commands/who.c b/src/commands/who.c index 3f1e10c..d41c0ea 100644 --- a/src/commands/who.c +++ b/src/commands/who.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Show who is on. type 0=who, 1=fwho, 2=people diff --git a/src/commands/wipe_board.c b/src/commands/wipe_board.c index a0bc097..d470069 100644 --- a/src/commands/wipe_board.c +++ b/src/commands/wipe_board.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Wipe some messages off the board diff --git a/src/commands/wizemote.c b/src/commands/wizemote.c index 2f45aa4..6d2e291 100644 --- a/src/commands/wizemote.c +++ b/src/commands/wizemote.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Emote something to other wizes and gods. If the level isn't given it diff --git a/src/commands/wizlist.c b/src/commands/wizlist.c index 380cf28..0df3415 100644 --- a/src/commands/wizlist.c +++ b/src/commands/wizlist.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Show the wizzes that are currently logged on, and get a list of names from the lists saved diff --git a/src/commands/wizshout.c b/src/commands/wizshout.c index fba6046..5e071f4 100644 --- a/src/commands/wizshout.c +++ b/src/commands/wizshout.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Shout something to other wizes and gods. If the level isn't given it diff --git a/src/commands/write_board.c b/src/commands/write_board.c index 0e0fdd3..91debd3 100644 --- a/src/commands/write_board.c +++ b/src/commands/write_board.c @@ -1,8 +1,8 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * Write on the message board diff --git a/src/commands/xcom.c b/src/commands/xcom.c index 56551f2..466b4b9 100644 --- a/src/commands/xcom.c +++ b/src/commands/xcom.c @@ -1,7 +1,7 @@ -#include "defines.h" -#include "globals.h" -#include "commands.h" -#include "prototypes.h" +#include "../includes/defines.h" +#include "../includes/globals.h" +#include "../includes/commands.h" +#include "../includes/prototypes.h" /* * stop a user from using a certain command From 6b52627f611ae0d6e9d517fc9ed6818a8548b714 Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Sat, 23 Nov 2024 13:51:47 +0000 Subject: [PATCH 08/22] Updated vendors --- src/vendors/libtelnet/libtelnet.c | 33 +++-- src/vendors/sds/sds.c | 232 +++++++++++++++--------------- src/vendors/sds/sds.h | 20 +-- src/vendors/sds/sdsalloc.h | 2 +- 4 files changed, 143 insertions(+), 144 deletions(-) diff --git a/src/vendors/libtelnet/libtelnet.c b/src/vendors/libtelnet/libtelnet.c index 71dc5f3..3d09e53 100644 --- a/src/vendors/libtelnet/libtelnet.c +++ b/src/vendors/libtelnet/libtelnet.c @@ -407,7 +407,6 @@ static void _negotiate(telnet_t *telnet, unsigned char telopt) { break; case Q_WANTNO_OP: _set_rfc1143(telnet, telopt, Q_US(q), Q_YES); - NEGOTIATE_EVENT(telnet, TELNET_EV_WILL, telopt); _error(telnet, __LINE__, __func__, TELNET_EPROTOCOL, 0, "DONT answered by WILL"); break; @@ -437,7 +436,8 @@ static void _negotiate(telnet_t *telnet, unsigned char telopt) { break; case Q_WANTNO_OP: _set_rfc1143(telnet, telopt, Q_US(q), Q_WANTYES); - NEGOTIATE_EVENT(telnet, TELNET_EV_DO, telopt); + _send_negotiate(telnet, TELNET_DO, telopt); + NEGOTIATE_EVENT(telnet, TELNET_EV_WONT, telopt); break; case Q_WANTYES: case Q_WANTYES_OP: @@ -465,7 +465,6 @@ static void _negotiate(telnet_t *telnet, unsigned char telopt) { break; case Q_WANTNO_OP: _set_rfc1143(telnet, telopt, Q_YES, Q_HIM(q)); - NEGOTIATE_EVENT(telnet, TELNET_EV_DO, telopt); _error(telnet, __LINE__, __func__, TELNET_EPROTOCOL, 0, "WONT answered by DO"); break; @@ -491,12 +490,12 @@ static void _negotiate(telnet_t *telnet, unsigned char telopt) { break; case Q_WANTNO: _set_rfc1143(telnet, telopt, Q_NO, Q_HIM(q)); - NEGOTIATE_EVENT(telnet, TELNET_EV_WONT, telopt); + NEGOTIATE_EVENT(telnet, TELNET_EV_DONT, telopt); break; case Q_WANTNO_OP: _set_rfc1143(telnet, telopt, Q_WANTYES, Q_HIM(q)); _send_negotiate(telnet, TELNET_WILL, telopt); - NEGOTIATE_EVENT(telnet, TELNET_EV_WILL, telopt); + NEGOTIATE_EVENT(telnet, TELNET_EV_DONT, telopt); break; case Q_WANTYES: case Q_WANTYES_OP: @@ -553,7 +552,7 @@ static int _environ_telnet(telnet_t *telnet, unsigned char type, ev.type = TELNET_EV_ENVIRON; telnet->eh(telnet, &ev, telnet->ud); - return 1; + return 0; } /* very second byte must be VAR or USERVAR, if present */ @@ -657,7 +656,7 @@ static int _environ_telnet(telnet_t *telnet, unsigned char type, /* clean up */ free(values); - return 1; + return 0; } /* process an MSSP subnegotiation buffer */ @@ -849,17 +848,14 @@ static int _subnegotiate(telnet_t *telnet) { * start handling the compressed stream if it's not already. */ case TELNET_TELOPT_COMPRESS2: - if (telnet->sb_telopt == TELNET_TELOPT_COMPRESS2) { - if (_init_zlib(telnet, 0, 1) != TELNET_EOK) - return 0; + if (_init_zlib(telnet, 0, 1) != TELNET_EOK) + return 0; - /* notify app that compression was enabled */ - ev.type = TELNET_EV_COMPRESS; - ev.compress.state = 1; - telnet->eh(telnet, &ev, telnet->ud); - return 1; - } - return 0; + /* notify app that compression was enabled */ + ev.type = TELNET_EV_COMPRESS; + ev.compress.state = 1; + telnet->eh(telnet, &ev, telnet->ud); + return 1; #endif /* defined(HAVE_ZLIB) */ /* specially handled subnegotiation telopt types */ @@ -1613,6 +1609,9 @@ void telnet_ttype_send(telnet_t *telnet) { void telnet_ttype_is(telnet_t *telnet, const char* ttype) { static const unsigned char IS[] = { TELNET_IAC, TELNET_SB, TELNET_TELOPT_TTYPE, TELNET_TTYPE_IS }; + if (!ttype) { + ttype = "NVT"; + } _sendu(telnet, IS, sizeof(IS)); _send(telnet, ttype, strlen(ttype)); telnet_finish_sb(telnet); diff --git a/src/vendors/sds/sds.c b/src/vendors/sds/sds.c index 3943189..836e757 100644 --- a/src/vendors/sds/sds.c +++ b/src/vendors/sds/sds.c @@ -638,66 +638,66 @@ sds sdscatfmt(sds s, char const *fmt, ...) { } switch(*f) { - case '%': - next = *(f+1); - if (next == '\0') break; - f++; - switch(next) { - case 's': - case 'S': - str = va_arg(ap,char*); - l = (next == 's') ? strlen(str) : sdslen(str); - if (sdsavail(s) < l) { - s = sdsMakeRoomFor(s,l); - } - memcpy(s+i,str,l); - sdsinclen(s,l); - i += l; - break; - case 'i': - case 'I': - if (next == 'i') - num = va_arg(ap,int); - else - num = va_arg(ap,long long); - { - char buf[SDS_LLSTR_SIZE]; - l = sdsll2str(buf,num); - if (sdsavail(s) < l) { - s = sdsMakeRoomFor(s,l); - } - memcpy(s+i,buf,l); - sdsinclen(s,l); - i += l; - } - break; - case 'u': - case 'U': - if (next == 'u') - unum = va_arg(ap,unsigned int); - else - unum = va_arg(ap,unsigned long long); - { - char buf[SDS_LLSTR_SIZE]; - l = sdsull2str(buf,unum); - if (sdsavail(s) < l) { - s = sdsMakeRoomFor(s,l); - } - memcpy(s+i,buf,l); - sdsinclen(s,l); - i += l; - } - break; - default: /* Handle %% and generally %. */ - s[i++] = next; - sdsinclen(s,1); - break; + case '%': + next = *(f+1); + if (next == '\0') break; + f++; + switch(next) { + case 's': + case 'S': + str = va_arg(ap,char*); + l = (next == 's') ? strlen(str) : sdslen(str); + if (sdsavail(s) < l) { + s = sdsMakeRoomFor(s,l); + } + memcpy(s+i,str,l); + sdsinclen(s,l); + i += l; + break; + case 'i': + case 'I': + if (next == 'i') + num = va_arg(ap,int); + else + num = va_arg(ap,long long); + { + char buf[SDS_LLSTR_SIZE]; + l = sdsll2str(buf,num); + if (sdsavail(s) < l) { + s = sdsMakeRoomFor(s,l); + } + memcpy(s+i,buf,l); + sdsinclen(s,l); + i += l; + } + break; + case 'u': + case 'U': + if (next == 'u') + unum = va_arg(ap,unsigned int); + else + unum = va_arg(ap,unsigned long long); + { + char buf[SDS_LLSTR_SIZE]; + l = sdsull2str(buf,unum); + if (sdsavail(s) < l) { + s = sdsMakeRoomFor(s,l); + } + memcpy(s+i,buf,l); + sdsinclen(s,l); + i += l; } break; - default: - s[i++] = *f; + default: /* Handle %% and generally %. */ + s[i++] = next; sdsinclen(s,1); break; + } + break; + default: + s[i++] = *f; + sdsinclen(s,1); + break; } f++; } @@ -871,7 +871,7 @@ sds *sdssplitlen(const char *s, ssize_t len, const char *sep, int seplen, int *c *count = elements; return tokens; - cleanup: +cleanup: { int i; for (i = 0; i < elements; i++) sdsfree(tokens[i]); @@ -899,21 +899,21 @@ sds sdscatrepr(sds s, const char *p, size_t len) { s = sdscatlen(s,"\"",1); while(len--) { switch(*p) { - case '\\': - case '"': - s = sdscatprintf(s,"\\%c",*p); - break; - case '\n': s = sdscatlen(s,"\\n",2); break; - case '\r': s = sdscatlen(s,"\\r",2); break; - case '\t': s = sdscatlen(s,"\\t",2); break; - case '\a': s = sdscatlen(s,"\\a",2); break; - case '\b': s = sdscatlen(s,"\\b",2); break; - default: - if (isprint(*p)) - s = sdscatprintf(s,"%c",*p); - else - s = sdscatprintf(s,"\\x%02x",(unsigned char)*p); - break; + case '\\': + case '"': + s = sdscatprintf(s,"\\%c",*p); + break; + case '\n': s = sdscatlen(s,"\\n",2); break; + case '\r': s = sdscatlen(s,"\\r",2); break; + case '\t': s = sdscatlen(s,"\\t",2); break; + case '\a': s = sdscatlen(s,"\\a",2); break; + case '\b': s = sdscatlen(s,"\\b",2); break; + default: + if (isprint(*p)) + s = sdscatprintf(s,"%c",*p); + else + s = sdscatprintf(s,"\\x%02x",(unsigned char)*p); + break; } p++; } @@ -931,23 +931,23 @@ int is_hex_digit(char c) { * integer from 0 to 15 */ int hex_digit_to_int(char c) { switch(c) { - case '0': return 0; - case '1': return 1; - case '2': return 2; - case '3': return 3; - case '4': return 4; - case '5': return 5; - case '6': return 6; - case '7': return 7; - case '8': return 8; - case '9': return 9; - case 'a': case 'A': return 10; - case 'b': case 'B': return 11; - case 'c': case 'C': return 12; - case 'd': case 'D': return 13; - case 'e': case 'E': return 14; - case 'f': case 'F': return 15; - default: return 0; + case '0': return 0; + case '1': return 1; + case '2': return 2; + case '3': return 3; + case '4': return 4; + case '5': return 5; + case '6': return 6; + case '7': return 7; + case '8': return 8; + case '9': return 9; + case 'a': case 'A': return 10; + case 'b': case 'B': return 11; + case 'c': case 'C': return 12; + case 'd': case 'D': return 13; + case 'e': case 'E': return 14; + case 'f': case 'F': return 15; + default: return 0; } } @@ -989,13 +989,13 @@ sds *sdssplitargs(const char *line, int *argc) { while(!done) { if (inq) { if (*p == '\\' && *(p+1) == 'x' && - is_hex_digit(*(p+2)) && - is_hex_digit(*(p+3))) + is_hex_digit(*(p+2)) && + is_hex_digit(*(p+3))) { unsigned char byte; byte = (hex_digit_to_int(*(p+2))*16)+ - hex_digit_to_int(*(p+3)); + hex_digit_to_int(*(p+3)); current = sdscatlen(current,(char*)&byte,1); p += 3; } else if (*p == '\\' && *(p+1)) { @@ -1003,12 +1003,12 @@ sds *sdssplitargs(const char *line, int *argc) { p++; switch(*p) { - case 'n': c = '\n'; break; - case 'r': c = '\r'; break; - case 't': c = '\t'; break; - case 'b': c = '\b'; break; - case 'a': c = '\a'; break; - default: c = *p; break; + case 'n': c = '\n'; break; + case 'r': c = '\r'; break; + case 't': c = '\t'; break; + case 'b': c = '\b'; break; + case 'a': c = '\a'; break; + default: c = *p; break; } current = sdscatlen(current,&c,1); } else if (*p == '"') { @@ -1039,22 +1039,22 @@ sds *sdssplitargs(const char *line, int *argc) { } } else { switch(*p) { - case ' ': - case '\n': - case '\r': - case '\t': - case '\0': - done=1; - break; - case '"': - inq=1; - break; - case '\'': - insq=1; - break; - default: - current = sdscatlen(current,p,1); - break; + case ' ': + case '\n': + case '\r': + case '\t': + case '\0': + done=1; + break; + case '"': + inq=1; + break; + case '\'': + insq=1; + break; + default: + current = sdscatlen(current,p,1); + break; } } if (*p) p++; @@ -1071,7 +1071,7 @@ sds *sdssplitargs(const char *line, int *argc) { } } - err: +err: while((*argc)--) sdsfree(vector[*argc]); s_free(vector); @@ -1325,4 +1325,4 @@ int sdsTest(void) { int main(void) { return sdsTest(); } -#endif +#endif \ No newline at end of file diff --git a/src/vendors/sds/sds.h b/src/vendors/sds/sds.h index 87d76fc..7f6a08b 100644 --- a/src/vendors/sds/sds.h +++ b/src/vendors/sds/sds.h @@ -131,10 +131,10 @@ static inline void sdssetlen(sds s, size_t newlen) { unsigned char flags = s[-1]; switch(flags&SDS_TYPE_MASK) { case SDS_TYPE_5: - { - unsigned char *fp = ((unsigned char*)s)-1; - *fp = SDS_TYPE_5 | (newlen << SDS_TYPE_BITS); - } + { + unsigned char *fp = ((unsigned char*)s)-1; + *fp = SDS_TYPE_5 | (newlen << SDS_TYPE_BITS); + } break; case SDS_TYPE_8: SDS_HDR(8,s)->len = newlen; @@ -155,11 +155,11 @@ static inline void sdsinclen(sds s, size_t inc) { unsigned char flags = s[-1]; switch(flags&SDS_TYPE_MASK) { case SDS_TYPE_5: - { - unsigned char *fp = ((unsigned char*)s)-1; - unsigned char newlen = SDS_TYPE_5_LEN(flags)+inc; - *fp = SDS_TYPE_5 | (newlen << SDS_TYPE_BITS); - } + { + unsigned char *fp = ((unsigned char*)s)-1; + unsigned char newlen = SDS_TYPE_5_LEN(flags)+inc; + *fp = SDS_TYPE_5 | (newlen << SDS_TYPE_BITS); + } break; case SDS_TYPE_8: SDS_HDR(8,s)->len += inc; @@ -271,4 +271,4 @@ void sds_free(void *ptr); int sdsTest(int argc, char *argv[]); #endif -#endif +#endif \ No newline at end of file diff --git a/src/vendors/sds/sdsalloc.h b/src/vendors/sds/sdsalloc.h index f43023c..e556f70 100644 --- a/src/vendors/sds/sdsalloc.h +++ b/src/vendors/sds/sdsalloc.h @@ -39,4 +39,4 @@ #define s_malloc malloc #define s_realloc realloc -#define s_free free +#define s_free free \ No newline at end of file From 2bb1ccad4f144b1fcc4bc95582ef0b3868edbe3b Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Sat, 23 Nov 2024 14:47:11 +0000 Subject: [PATCH 09/22] Fixed segfault with cmdcount due to % libtelnet didn't like the '%%', which required it to be '%%%%'. Also revamped the code to be a bit neater and use sds. --- src/commands/cmdcount.c | 90 +++++++++++++++++++---------------------- 1 file changed, 42 insertions(+), 48 deletions(-) diff --git a/src/commands/cmdcount.c b/src/commands/cmdcount.c index 5969cc3..4290764 100644 --- a/src/commands/cmdcount.c +++ b/src/commands/cmdcount.c @@ -11,78 +11,72 @@ void show_command_counts(UR_OBJECT user) { CMD_OBJECT cmd; - int total_hits, total_cmds, cmds_used, i, x; - char text2[ARR_SIZE]; + int total_hits = 0, total_cmds = 0, cmds_used = 0, i, x = 0; - x = i = total_hits = total_cmds = cmds_used = 0; - *text2 = '\0'; - /* get totals of commands and hits */ for (cmd = first_command; cmd; cmd = cmd->next) { total_hits += cmd->count; ++total_cmds; } + start_pager(user); write_user(user, - "\n+----------------------------------------------------------------------------+\n"); + "\n+----------------------------------------------------------------------------+\n"); write_user(user, - "| ~FC~OLCommand usage statistics~RS |\n"); + "| ~FC~OLCommand usage statistics~RS |\n"); write_user(user, - "+----------------------------------------------------------------------------+\n"); + "+----------------------------------------------------------------------------+\n"); + + sds row = sdsempty(); for (cmd = first_command; cmd; cmd = cmd->next) { - /* skip if command has not been used so as not to cause crash by trying to / by 0 */ - if (!cmd->count) { + if (cmd->count == 0 || cmd->level > user->level) { continue; } ++cmds_used; - /* skip if user cannot use that command anyway */ - if (cmd->level > user->level) { - continue; - } - i = ((cmd->count * 10000) / total_hits); - /* build up first half of the string */ - if (!x) { - sprintf(text, "| %11.11s %4d %3d%% ", cmd->name, cmd->count, i / 100); + i = (cmd->count * 10000) / total_hits; + sds entry = sdsempty(); + entry = sdscatprintf(entry, "%12.12s %4d %3d%%%%", cmd->name, cmd->count, i / 100); + + if (x == 0) { + row = sdscatprintf(row, "| %s ", entry); ++x; - } /* build up full line and print to user */ - else if (x == 1) { - sprintf(text2, " %11.11s %4d %3d%% ", cmd->name, cmd->count, - i / 100); - strcat(text, text2); - write_user(user, text); - *text = '\0'; - *text2 = '\0'; + } else if (x == 1) { + row = sdscatprintf(row, " %s ", entry); ++x; } else { - sprintf(text2, " %11.11s %4d %3d%% |\n", cmd->name, cmd->count, - i / 100); - strcat(text, text2); - write_user(user, text); - *text = '\0'; - *text2 = '\0'; + row = sdscatprintf(row, " %s |\n", entry); + write_user(user, row); + sdsfree(row); + row = sdsempty(); x = 0; } + sdsfree(entry); } - /* If you have only printed first half of the string */ + if (x == 1) { - strcat(text, " |\n"); - write_user(user, text); - } - if (x == 2) { - strcat(text, " |\n"); - write_user(user, text); + row = sdscat(row, " |\n"); + write_user(user, row); + } else if (x == 2) { + row = sdscat(row, " |\n"); + write_user(user, row); } + + sdsfree(row); + write_user(user, - "| |\n"); + "| |\n"); write_user(user, - "| Any other commands have not yet been used, or you cannot view them |\n"); + "| Any other commands have not yet been used, or you cannot view them |\n"); write_user(user, - "+----------------------------------------------------------------------------+\n"); - sprintf(text2, - "Total of ~OL%d~RS commands. ~OL%d~RS command%s used a total of ~OL%d~RS time%s.", - total_cmds, cmds_used, PLTEXT_S(cmds_used), total_hits, - PLTEXT_S(total_hits)); - vwrite_user(user, "| %-92s |\n", text2); + "+----------------------------------------------------------------------------+\n"); + + char *summary = sdscatprintf(sdsempty(), + "Total of ~OL%d~RS commands. ~OL%d~RS command%s used a total of ~OL%d~RS time%s.", + total_cmds, cmds_used, PLTEXT_S(cmds_used), total_hits, PLTEXT_S(total_hits)); + vwrite_user(user, "| %-92s |\n", summary); + sdsfree(summary); + write_user(user, - "+----------------------------------------------------------------------------+\n"); + "+----------------------------------------------------------------------------+\n"); + stop_pager(user); } From c6693b9e905736d13f1561a20adda46352badd31 Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Sat, 23 Nov 2024 15:09:31 +0000 Subject: [PATCH 10/22] Fixed same %%issue with the more functionality --- src/amnuts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amnuts.c b/src/amnuts.c index 3c7070b..4b47c7c 100644 --- a/src/amnuts.c +++ b/src/amnuts.c @@ -4289,7 +4289,7 @@ more(UR_OBJECT user, int sock, const char *filename) quit the user */ vwrite_user(user, - "~BB~FG-=[~OL%d%%~RS~BB~FG]=- (~OLR~RS~BB~FG)EDISPLAY, (~OLB~RS~BB~FG)ACK, (~OLE~RS~BB~FG)XIT, TO CONTINUE:~RS ", + "~BB~FG-=[~OL%d%%%%~RS~BB~FG]=- (~OLR~RS~BB~FG)EDISPLAY, (~OLB~RS~BB~FG)ACK, (~OLE~RS~BB~FG)XIT, TO CONTINUE:~RS ", fstat(fileno(fp), &stbuf) == -1 ? -1 : (100 * user->filepos) / (int) stbuf.st_size); no_prompt = 1; From 962ef1e193ceaf6089d7f9d786aedcae1de80b84 Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Sat, 23 Nov 2024 15:15:40 +0000 Subject: [PATCH 11/22] Fixed formatting issue with preview --- src/commands/preview.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/commands/preview.c b/src/commands/preview.c index fcb348b..7bd8c71 100644 --- a/src/commands/preview.c +++ b/src/commands/preview.c @@ -16,8 +16,7 @@ preview(UR_OBJECT user) #if !!0 static const char usage[] = "Usage: preview []\n"; #endif - sds filename; - char line[100]; + sds filename, text; FILE *fp; DIR *dirp; struct dirent *dp; @@ -30,8 +29,8 @@ preview(UR_OBJECT user) write_user(user, "No list of the picture files is availiable.\n"); return; } - *line = '\0'; cnt = total = 0; + text = sdsempty(); /* go through directory and list files */ for (dp = readdir(dirp); dp; dp = readdir(dirp)) { if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) { @@ -45,18 +44,18 @@ preview(UR_OBJECT user) write_user(user, "+----------------------------------------------------------------------------+\n"); } - sprintf(text, "%-12.12s ", dp->d_name); - strcat(line, text); + text = sdscatprintf(text, "%-12.12s ", dp->d_name); if (++cnt == 5) { - write_user(user, align_string(ALIGN_LEFT, 78, 1, "|", " %s", line)); - *line = '\0'; + text = sdscatfmt(sdsempty(), "%s\n", align_string(ALIGN_LEFT, 78, 1, "|", " %s", text)); + write_user(user, text); + text = sdsempty(); cnt = 0; } } closedir(dirp); if (total) { if (cnt) { - write_user(user, align_string(ALIGN_LEFT, 78, 1, "|", " %s", line)); + text = sdscatfmt(sdsempty(), "%s\n", align_string(ALIGN_LEFT, 78, 1, "|", " %s", text)); } write_user(user, "+----------------------------------------------------------------------------+\n"); @@ -68,6 +67,8 @@ preview(UR_OBJECT user) } else { write_user(user, "There are no pictures available to be viewed.\n"); } + + sdsfree(text); return; } if (strpbrk(word[1], "./")) { From 3494e19cbaa8b96db2d60491bede510751a92030 Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Sat, 23 Nov 2024 16:17:40 +0000 Subject: [PATCH 12/22] Fixed percentage output for speech, previews, pager, etc. by just flat-out double escaping any before telnet write. --- src/amnuts.c | 8 +++++++- src/commands/cmdcount.c | 2 +- src/includes/prototypes.h | 1 + src/strings.c | 22 ++++++++++++++++++++++ 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/amnuts.c b/src/amnuts.c index 4b47c7c..980f3bf 100644 --- a/src/amnuts.c +++ b/src/amnuts.c @@ -3608,6 +3608,9 @@ write_user(UR_OBJECT user, const char *str) return; } } + + str = escape_percentages(user, str); + /* Process string and write to buffer */ cnt = 0; buffpos = 0; @@ -4187,6 +4190,9 @@ more(UR_OBJECT user, int sock, const char *filename) continue; } #endif + + str = escape_percentages(user, str); + /* Process line from file */ for (s = str; *s; ++s) { if (buffpos > OUT_BUFF_SIZE - (6 < USER_NAME_LEN ? USER_NAME_LEN : 6)) { @@ -4289,7 +4295,7 @@ more(UR_OBJECT user, int sock, const char *filename) quit the user */ vwrite_user(user, - "~BB~FG-=[~OL%d%%%%~RS~BB~FG]=- (~OLR~RS~BB~FG)EDISPLAY, (~OLB~RS~BB~FG)ACK, (~OLE~RS~BB~FG)XIT, TO CONTINUE:~RS ", + "~BB~FG-=[~OL%d%%~RS~BB~FG]=- (~OLR~RS~BB~FG)EDISPLAY, (~OLB~RS~BB~FG)ACK, (~OLE~RS~BB~FG)XIT, TO CONTINUE:~RS ", fstat(fileno(fp), &stbuf) == -1 ? -1 : (100 * user->filepos) / (int) stbuf.st_size); no_prompt = 1; diff --git a/src/commands/cmdcount.c b/src/commands/cmdcount.c index 4290764..0adcc58 100644 --- a/src/commands/cmdcount.c +++ b/src/commands/cmdcount.c @@ -34,7 +34,7 @@ show_command_counts(UR_OBJECT user) ++cmds_used; i = (cmd->count * 10000) / total_hits; sds entry = sdsempty(); - entry = sdscatprintf(entry, "%12.12s %4d %3d%%%%", cmd->name, cmd->count, i / 100); + entry = sdscatprintf(entry, "%12.12s %4d %3d%%", cmd->name, cmd->count, i / 100); if (x == 0) { row = sdscatprintf(row, "| %s ", entry); diff --git a/src/includes/prototypes.h b/src/includes/prototypes.h index 1e1fbe4..e29eb3d 100644 --- a/src/includes/prototypes.h +++ b/src/includes/prototypes.h @@ -581,6 +581,7 @@ void split_command_string(char *); size_t teslen(const char *, size_t); void get_soundex(const char *, char *); char *word_time(int); +const char *escape_percentages(UR_OBJECT user, const char *str); /* * functions in telnet.c diff --git a/src/strings.c b/src/strings.c index 863f1dd..031c78c 100644 --- a/src/strings.c +++ b/src/strings.c @@ -944,3 +944,25 @@ word_time(int t) *fill++ = '\0'; return time_string; } + +/** + * Work around a problem with sending escapes through telnet_printf() + */ +const char * +escape_percentages(UR_OBJECT user, const char *str) +{ + if (user && user->telnet) { + sds escaped_str = sdsnew(""); + for (const char *p = str; *p != '\0'; ++p) { + if (*p == '%') { + escaped_str = sdscat(escaped_str, "%%"); + } else { + escaped_str = sdscatlen(escaped_str, p, 1); + } + } + str = escaped_str; + sdsfree(escaped_str); + } + + return str; +} From cf666b3b918fd045cac9dfd469eff114f6eb4ad4 Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Sat, 23 Nov 2024 16:19:47 +0000 Subject: [PATCH 13/22] Fixed typos --- src/amnuts.c | 16 ++++++++-------- src/netlinks.c | 10 +++++----- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/amnuts.c b/src/amnuts.c index 980f3bf..58f12eb 100644 --- a/src/amnuts.c +++ b/src/amnuts.c @@ -2138,8 +2138,8 @@ sig_handler(int sig) switch (amsys->crash_action) { case 0: write_room(NULL, - "\n\n\07~OLSYSTEM:~FR~LI WARNING - An illegal instruction has just occured!\n\n"); - write_syslog(SYSLOG, 1, "WARNING: An illegal instruction occured!\n"); + "\n\n\07~OLSYSTEM:~FR~LI WARNING - An illegal instruction has just occurred!\n\n"); + write_syslog(SYSLOG, 1, "WARNING: An illegal instruction occurred!\n"); abort(); break; case 1: @@ -2177,8 +2177,8 @@ sig_handler(int sig) switch (amsys->crash_action) { case 0: write_room(NULL, - "\n\n\07~OLSYSTEM:~FR~LI WARNING - An arithmetic exception has just occured!\n\n"); - write_syslog(SYSLOG, 1, "WARNING: An arithmetic exception occured!\n"); + "\n\n\07~OLSYSTEM:~FR~LI WARNING - An arithmetic exception has just occurred!\n\n"); + write_syslog(SYSLOG, 1, "WARNING: An arithmetic exception occurred!\n"); abort(); break; case 1: @@ -2216,8 +2216,8 @@ sig_handler(int sig) switch (amsys->crash_action) { case 0: write_room(NULL, - "\n\n\07~OLSYSTEM:~FR~LI WARNING - A segmentation fault has just occured!\n\n"); - write_syslog(SYSLOG, 1, "WARNING: A segmentation fault occured!\n"); + "\n\n\07~OLSYSTEM:~FR~LI WARNING - A segmentation fault has just occurred!\n\n"); + write_syslog(SYSLOG, 1, "WARNING: A segmentation fault occurred!\n"); abort(); break; case 1: @@ -2255,8 +2255,8 @@ sig_handler(int sig) switch (amsys->crash_action) { case 0: write_room(NULL, - "\n\n\07~OLSYSTEM:~FR~LI WARNING - A bus error has just occured!\n\n"); - write_syslog(SYSLOG, 1, "WARNING: A bus error occured!\n"); + "\n\n\07~OLSYSTEM:~FR~LI WARNING - A bus error has just occurred!\n\n"); + write_syslog(SYSLOG, 1, "WARNING: A bus error occurred!\n"); abort(); break; case 1: diff --git a/src/netlinks.c b/src/netlinks.c index 4c56e73..58fdceb 100644 --- a/src/netlinks.c +++ b/src/netlinks.c @@ -1095,11 +1095,11 @@ nl_user_exist(NL_OBJECT nl, char *to, char *from) user = get_user(from); if (user) { sprintf(text, - "~OLSYSTEM:~RS An error occured during mail delivery to %s@%s.\n", + "~OLSYSTEM:~RS An error occurred during mail delivery to %s@%s.\n", to, nl->service); write_user(user, text); } else { - sprintf(text2, "An error occured during mail delivery to %s@%s.\n", to, + sprintf(text2, "An error occurred during mail delivery to %s@%s.\n", to, nl->service); send_mail(NULL, from, text2, 0); } @@ -1224,7 +1224,7 @@ nl_endmail(NL_OBJECT nl) } /* - * An error occured at remote site + * An error occurred at remote site */ void nl_mailerror(NL_OBJECT nl, char *to, char *from) @@ -1234,11 +1234,11 @@ nl_mailerror(NL_OBJECT nl, char *to, char *from) user = get_user(from); if (user) { sprintf(text, - "~OLSYSTEM:~RS An error occured during mail delivery to %s@%s.\n", + "~OLSYSTEM:~RS An error occurred during mail delivery to %s@%s.\n", to, nl->service); write_user(user, text); } else { - sprintf(text, "An error occured during mail delivery to %s@%s.\n", to, + sprintf(text, "An error occurred during mail delivery to %s@%s.\n", to, nl->service); send_mail(NULL, from, text, 0); } From a800df6da21c80569c04ab8c403e133faf05bebf Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Sat, 23 Nov 2024 21:15:31 +0000 Subject: [PATCH 14/22] Excellent PR feedback from @Uzume --- src/admin.c | 8 ++++---- src/amnuts.c | 10 +++++----- src/commands/account.c | 8 ++++---- src/commands/accreq.c | 8 ++++---- src/commands/addhistory.c | 8 ++++---- src/commands/afk.c | 8 ++++---- src/commands/allclones.c | 8 ++++---- src/commands/arrest.c | 8 ++++---- src/commands/ban.c | 8 ++++---- src/commands/bcast.c | 8 ++++---- src/commands/beep.c | 8 ++++---- src/commands/bring.c | 8 ++++---- src/commands/cafk.c | 8 ++++---- src/commands/calendar.c | 8 ++++---- src/commands/cedit.c | 8 ++++---- src/commands/change_pass.c | 8 ++++---- src/commands/charecho.c | 8 ++++---- src/commands/clearline.c | 8 ++++---- src/commands/clone_emote.c | 8 ++++---- src/commands/clone_hear.c | 8 ++++---- src/commands/clone_say.c | 8 ++++---- src/commands/clone_switch.c | 8 ++++---- src/commands/cls.c | 8 ++++---- src/commands/cmdcount.c | 8 ++++---- src/commands/colour.c | 8 ++++---- src/commands/connect_netlink.c | 8 ++++---- src/commands/copyto.c | 8 ++++---- src/commands/create_clone.c | 8 ++++---- src/commands/cshouts.c | 8 ++++---- src/commands/ctells.c | 8 ++++---- src/commands/ctopic.c | 8 ++++---- src/commands/delete_suggestions.c | 8 ++++---- src/commands/delete_user.c | 8 ++++---- src/commands/demote.c | 8 ++++---- src/commands/destroy_clone.c | 8 ++++---- src/commands/disconnect_netlink.c | 8 ++++---- src/commands/display.c | 8 ++++---- src/commands/dmail.c | 8 ++++---- src/commands/dump.c | 8 ++++---- src/commands/echo.c | 8 ++++---- src/commands/emote.c | 8 ++++---- src/commands/enter_profile.c | 8 ++++---- src/commands/examine.c | 8 ++++---- src/commands/expires.c | 8 ++++---- src/commands/fix.c | 8 ++++---- src/commands/flagged.c | 8 ++++---- src/commands/fmail.c | 8 ++++---- src/commands/force.c | 8 ++++---- src/commands/friend_emote.c | 8 ++++---- src/commands/friend_say.c | 8 ++++---- src/commands/friends.c | 8 ++++---- src/commands/fsmail.c | 8 ++++---- src/commands/gcom.c | 8 ++++---- src/commands/go.c | 8 ++++---- src/commands/greet.c | 8 ++++---- src/commands/grepusers.c | 8 ++++---- src/commands/help.c | 8 ++++---- src/commands/history.c | 8 ++++---- src/commands/home.c | 8 ++++---- src/commands/ignlist.c | 8 ++++---- src/commands/ignuser.c | 8 ++++---- src/commands/invite.c | 8 ++++---- src/commands/join.c | 8 ++++---- src/commands/kill_user.c | 8 ++++---- src/commands/last.c | 8 ++++---- src/commands/letmein.c | 8 ++++---- src/commands/listbans.c | 8 ++++---- src/commands/listen.c | 8 ++++---- src/commands/lmail.c | 8 ++++---- src/commands/logging.c | 8 ++++---- src/commands/look.c | 8 ++++---- src/commands/macros.c | 8 ++++---- src/commands/mail_from.c | 8 ++++---- src/commands/minlogin.c | 8 ++++---- src/commands/mkinvis.c | 8 ++++---- src/commands/mkvis.c | 8 ++++---- src/commands/morph.c | 8 ++++---- src/commands/move.c | 8 ++++---- src/commands/mutter.c | 8 ++++---- src/commands/muzzle.c | 8 ++++---- src/commands/myclones.c | 8 ++++---- src/commands/myroom.c | 8 ++++---- src/commands/myroom_admin.c | 8 ++++---- src/commands/myroom_bgone.c | 8 ++++---- src/commands/myroom_key.c | 8 ++++---- src/commands/myroom_lock.c | 8 ++++---- src/commands/myroom_paint.c | 8 ++++---- src/commands/myroom_rename.c | 8 ++++---- src/commands/netdata.c | 8 ++++---- src/commands/netstat.c | 8 ++++---- src/commands/pemote.c | 8 ++++---- src/commands/picture_all.c | 8 ++++---- src/commands/picture_tell.c | 8 ++++---- src/commands/plead.c | 8 ++++---- src/commands/preview.c | 8 ++++---- src/commands/promote.c | 8 ++++---- src/commands/promote_temporary.c | 8 ++++---- src/commands/purge.c | 8 ++++---- src/commands/quick_call.c | 8 ++++---- src/commands/ranks.c | 8 ++++---- src/commands/rcountu.c | 8 ++++---- src/commands/read_board.c | 8 ++++---- src/commands/reboot_talker.c | 8 ++++---- src/commands/recount.c | 8 ++++---- src/commands/reload_room.c | 8 ++++---- src/commands/reminder.c | 8 ++++---- src/commands/remote_stat.c | 8 ++++---- src/commands/resite.c | 8 ++++---- src/commands/retire.c | 8 ++++---- src/commands/revafk.c | 8 ++++---- src/commands/revclr.c | 8 ++++---- src/commands/revedit.c | 8 ++++---- src/commands/review.c | 8 ++++---- src/commands/revshout.c | 8 ++++---- src/commands/revtell.c | 8 ++++---- src/commands/rmail.c | 8 ++++---- src/commands/room.c | 8 ++++---- src/commands/samesite.c | 8 ++++---- src/commands/say.c | 8 ++++---- src/commands/sayto.c | 8 ++++---- src/commands/search_boards.c | 8 ++++---- src/commands/semote.c | 8 ++++---- src/commands/set.c | 8 ++++---- src/commands/set_desc.c | 8 ++++---- src/commands/set_ignore.c | 8 ++++---- src/commands/set_iophrase.c | 8 ++++---- src/commands/set_room_access.c | 8 ++++---- src/commands/set_topic.c | 8 ++++---- src/commands/setcmdlev.c | 8 ++++---- src/commands/sfrom.c | 8 ++++---- src/commands/shackle.c | 8 ++++---- src/commands/shout.c | 8 ++++---- src/commands/show.c | 8 ++++---- src/commands/show_version.c | 8 ++++---- src/commands/shutdown_com.c | 8 ++++---- src/commands/sing_it.c | 8 ++++---- src/commands/site.c | 8 ++++---- src/commands/smail.c | 8 ++++---- src/commands/sreboot.c | 8 ++++---- src/commands/status.c | 8 ++++---- src/commands/sto.c | 8 ++++---- src/commands/suggestions.c | 8 ++++---- src/commands/suicide.c | 8 ++++---- src/commands/system.c | 8 ++++---- src/commands/tell_user.c | 8 ++++---- src/commands/think_it.c | 8 ++++---- src/commands/time.c | 8 ++++---- src/commands/toggle_ignall.c | 8 ++++---- src/commands/toggle_mode.c | 8 ++++---- src/commands/toggle_prompt.c | 8 ++++---- src/commands/toggle_swearban.c | 8 ++++---- src/commands/unarrest.c | 8 ++++---- src/commands/unban.c | 8 ++++---- src/commands/uninvite.c | 8 ++++---- src/commands/unmuzzle.c | 8 ++++---- src/commands/unretire.c | 8 ++++---- src/commands/unshackle.c | 8 ++++---- src/commands/verify.c | 8 ++++---- src/commands/viewlog.c | 8 ++++---- src/commands/visibility.c | 8 ++++---- src/commands/visit.c | 8 ++++---- src/commands/wake.c | 8 ++++---- src/commands/who.c | 8 ++++---- src/commands/wipe_board.c | 8 ++++---- src/commands/wizemote.c | 8 ++++---- src/commands/wizlist.c | 8 ++++---- src/commands/wizshout.c | 8 ++++---- src/commands/write_board.c | 8 ++++---- src/commands/xcom.c | 8 ++++---- src/games.c | 8 ++++---- src/messages.c | 8 ++++---- src/netlinks.c | 8 ++++---- src/objects.c | 8 ++++---- src/pager.c | 8 ++++---- src/reboot.c | 8 ++++---- src/rooms.c | 10 +++++----- src/speech.c | 8 ++++---- src/spodlist.c | 10 +++++----- src/strings.c | 8 ++++---- src/telnet.c | 10 +++++----- 180 files changed, 724 insertions(+), 724 deletions(-) diff --git a/src/admin.c b/src/admin.c index ef56d63..19c90fa 100644 --- a/src/admin.c +++ b/src/admin.c @@ -9,10 +9,10 @@ NUTS version 3.3.3 (Triple Three :) - Copyright (C) Neil Robertson 1996 ***************************************************************************/ -#include "./includes/defines.h" -#include "./includes/globals.h" -#include "./includes/commands.h" -#include "./includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /*****************************************************************************/ diff --git a/src/amnuts.c b/src/amnuts.c index 58f12eb..379481d 100644 --- a/src/amnuts.c +++ b/src/amnuts.c @@ -11,11 +11,11 @@ #ifndef __MAIN_FILE__ #define __MAIN_FILE__ -#include "./includes/defines.h" -#include "./includes/globals.h" -#include "./includes/commands.h" -#include "./includes/prototypes.h" -#include "./includes/telnet.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" +#include "telnet.h" #undef __MAIN_FILE__ #endif diff --git a/src/commands/account.c b/src/commands/account.c index 233484f..4ffaba5 100644 --- a/src/commands/account.c +++ b/src/commands/account.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Create an account for a user if new users from their site have been diff --git a/src/commands/accreq.c b/src/commands/accreq.c index 05f48af..c488b23 100644 --- a/src/commands/accreq.c +++ b/src/commands/accreq.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * A newbie is requesting an account. Get his email address off him so we diff --git a/src/commands/addhistory.c b/src/commands/addhistory.c index 82d3e9c..bf74180 100644 --- a/src/commands/addhistory.c +++ b/src/commands/addhistory.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * allows a user to add to another users history list diff --git a/src/commands/afk.c b/src/commands/afk.c index 4532e6b..5416136 100644 --- a/src/commands/afk.c +++ b/src/commands/afk.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Do AFK diff --git a/src/commands/allclones.c b/src/commands/allclones.c index 6c9d907..b874ba3 100644 --- a/src/commands/allclones.c +++ b/src/commands/allclones.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Show all clones on the system diff --git a/src/commands/arrest.c b/src/commands/arrest.c index 52cb455..d15319b 100644 --- a/src/commands/arrest.c +++ b/src/commands/arrest.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Put annoying user in jail diff --git a/src/commands/ban.c b/src/commands/ban.c index 54692ff..ebc3abe 100644 --- a/src/commands/ban.c +++ b/src/commands/ban.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Ban a site, domain or user diff --git a/src/commands/bcast.c b/src/commands/bcast.c index a7db68b..7ef7b7d 100644 --- a/src/commands/bcast.c +++ b/src/commands/bcast.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Broadcast an important message diff --git a/src/commands/beep.c b/src/commands/beep.c index 1bec8ea..22e6ad7 100644 --- a/src/commands/beep.c +++ b/src/commands/beep.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Beep a user - as tell but with audio warning diff --git a/src/commands/bring.c b/src/commands/bring.c index aadb623..27d7bc1 100644 --- a/src/commands/bring.c +++ b/src/commands/bring.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * bring a user to the same room diff --git a/src/commands/cafk.c b/src/commands/cafk.c index 10ce796..ce63702 100644 --- a/src/commands/cafk.c +++ b/src/commands/cafk.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Clear the tell buffer of the user diff --git a/src/commands/calendar.c b/src/commands/calendar.c index 094027b..cf8f400 100644 --- a/src/commands/calendar.c +++ b/src/commands/calendar.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * display the calendar to the user diff --git a/src/commands/cedit.c b/src/commands/cedit.c index ab52b7b..34bb367 100644 --- a/src/commands/cedit.c +++ b/src/commands/cedit.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Clear the tell buffer of the user diff --git a/src/commands/change_pass.c b/src/commands/change_pass.c index f317b12..99288f8 100644 --- a/src/commands/change_pass.c +++ b/src/commands/change_pass.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Change users password. Only GODs and above can change another users diff --git a/src/commands/charecho.c b/src/commands/charecho.c index 8f5f3e5..1471437 100644 --- a/src/commands/charecho.c +++ b/src/commands/charecho.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Set the character mode echo on or off. This is only for users logging in diff --git a/src/commands/clearline.c b/src/commands/clearline.c index 7ce5742..3592a60 100644 --- a/src/commands/clearline.c +++ b/src/commands/clearline.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Free a hung socket diff --git a/src/commands/clone_emote.c b/src/commands/clone_emote.c index 7e8340d..5533cb8 100644 --- a/src/commands/clone_emote.c +++ b/src/commands/clone_emote.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Make a clone emote diff --git a/src/commands/clone_hear.c b/src/commands/clone_hear.c index 6d127a3..7d144ec 100644 --- a/src/commands/clone_hear.c +++ b/src/commands/clone_hear.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Set what a clone will hear, either all speech , just bad language diff --git a/src/commands/clone_say.c b/src/commands/clone_say.c index a32a0f7..5529a0a 100644 --- a/src/commands/clone_say.c +++ b/src/commands/clone_say.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Make a clone speak diff --git a/src/commands/clone_switch.c b/src/commands/clone_switch.c index 17bfad7..4d0e503 100644 --- a/src/commands/clone_switch.c +++ b/src/commands/clone_switch.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * User swaps places with his own clone. All we do is swap the rooms the objects are in diff --git a/src/commands/cls.c b/src/commands/cls.c index 73fc1b5..4ac45c3 100644 --- a/src/commands/cls.c +++ b/src/commands/cls.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Clear the screen diff --git a/src/commands/cmdcount.c b/src/commands/cmdcount.c index 0adcc58..7eb17cf 100644 --- a/src/commands/cmdcount.c +++ b/src/commands/cmdcount.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Display how many times a command has been used, and its overall diff --git a/src/commands/colour.c b/src/commands/colour.c index 1bf2ad5..19a0272 100644 --- a/src/commands/colour.c +++ b/src/commands/colour.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Display colours to user diff --git a/src/commands/connect_netlink.c b/src/commands/connect_netlink.c index 46a44bc..908cc9b 100644 --- a/src/commands/connect_netlink.c +++ b/src/commands/connect_netlink.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" #ifdef NETLINKS diff --git a/src/commands/copyto.c b/src/commands/copyto.c index 9afae47..5b69683 100644 --- a/src/commands/copyto.c +++ b/src/commands/copyto.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * get users which to send copies of smail to diff --git a/src/commands/create_clone.c b/src/commands/create_clone.c index d1cc293..c315b24 100644 --- a/src/commands/create_clone.c +++ b/src/commands/create_clone.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Clone a user in another room diff --git a/src/commands/cshouts.c b/src/commands/cshouts.c index c032edc..95fbcbd 100644 --- a/src/commands/cshouts.c +++ b/src/commands/cshouts.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Clear the shout buffer of the talker diff --git a/src/commands/ctells.c b/src/commands/ctells.c index 7ee4f31..de05a4a 100644 --- a/src/commands/ctells.c +++ b/src/commands/ctells.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Clear the tell buffer of the user diff --git a/src/commands/ctopic.c b/src/commands/ctopic.c index 6c4a142..0f2b7e9 100644 --- a/src/commands/ctopic.c +++ b/src/commands/ctopic.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * clears a room topic diff --git a/src/commands/delete_suggestions.c b/src/commands/delete_suggestions.c index bd071ac..1ff646c 100644 --- a/src/commands/delete_suggestions.c +++ b/src/commands/delete_suggestions.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * delete suggestions from the board diff --git a/src/commands/delete_user.c b/src/commands/delete_user.c index 78e8da8..f795c67 100644 --- a/src/commands/delete_user.c +++ b/src/commands/delete_user.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Delete a user diff --git a/src/commands/demote.c b/src/commands/demote.c index 9e876cc..f27b602 100644 --- a/src/commands/demote.c +++ b/src/commands/demote.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Demote a user diff --git a/src/commands/destroy_clone.c b/src/commands/destroy_clone.c index caadede..7649979 100644 --- a/src/commands/destroy_clone.c +++ b/src/commands/destroy_clone.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Destroy user clone diff --git a/src/commands/disconnect_netlink.c b/src/commands/disconnect_netlink.c index e6e0072..127f5b1 100644 --- a/src/commands/disconnect_netlink.c +++ b/src/commands/disconnect_netlink.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" #ifdef NETLINKS diff --git a/src/commands/display.c b/src/commands/display.c index c82bfb0..d4f06c9 100644 --- a/src/commands/display.c +++ b/src/commands/display.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Display some files to the user. This was once integrated with the ".help" command, diff --git a/src/commands/dmail.c b/src/commands/dmail.c index 9679143..87390b0 100644 --- a/src/commands/dmail.c +++ b/src/commands/dmail.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Delete some or all of your mail. A problem here is once we have deleted diff --git a/src/commands/dump.c b/src/commands/dump.c index b2021a9..bf8fdbb 100644 --- a/src/commands/dump.c +++ b/src/commands/dump.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Allows you to dump certain things to files as a record diff --git a/src/commands/echo.c b/src/commands/echo.c index b07242b..7f2b688 100644 --- a/src/commands/echo.c +++ b/src/commands/echo.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Echo something to screen diff --git a/src/commands/emote.c b/src/commands/emote.c index 105dcaa..81afc71 100644 --- a/src/commands/emote.c +++ b/src/commands/emote.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Emote something diff --git a/src/commands/enter_profile.c b/src/commands/enter_profile.c index bd6d38a..52565ae 100644 --- a/src/commands/enter_profile.c +++ b/src/commands/enter_profile.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Enter user profile diff --git a/src/commands/examine.c b/src/commands/examine.c index ec9e4dc..21fb388 100644 --- a/src/commands/examine.c +++ b/src/commands/examine.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Examine a user diff --git a/src/commands/expires.c b/src/commands/expires.c index 545d3d0..ceba7b9 100644 --- a/src/commands/expires.c +++ b/src/commands/expires.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Set a user to either expire after a set time, or never expire diff --git a/src/commands/fix.c b/src/commands/fix.c index ceccbd9..1108026 100644 --- a/src/commands/fix.c +++ b/src/commands/fix.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Change whether a rooms access is fixed or not diff --git a/src/commands/flagged.c b/src/commands/flagged.c index 10c971b..557b03c 100644 --- a/src/commands/flagged.c +++ b/src/commands/flagged.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * See if user is banned diff --git a/src/commands/fmail.c b/src/commands/fmail.c index 1b65529..91b65c4 100644 --- a/src/commands/fmail.c +++ b/src/commands/fmail.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * allows a user to email specific messages to themselves diff --git a/src/commands/force.c b/src/commands/force.c index 7261d93..db2c4fd 100644 --- a/src/commands/force.c +++ b/src/commands/force.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Force a user to do something diff --git a/src/commands/friend_emote.c b/src/commands/friend_emote.c index a5e6e3b..8458879 100644 --- a/src/commands/friend_emote.c +++ b/src/commands/friend_emote.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Emote something to all the people on the suers friends list diff --git a/src/commands/friend_say.c b/src/commands/friend_say.c index 7274003..2f45a08 100644 --- a/src/commands/friend_say.c +++ b/src/commands/friend_say.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Say user speech to all people listed on users friends list diff --git a/src/commands/friends.c b/src/commands/friends.c index fddf67c..ee283b7 100644 --- a/src/commands/friends.c +++ b/src/commands/friends.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * take a users name and add it to friends list diff --git a/src/commands/fsmail.c b/src/commands/fsmail.c index 46b53fb..414681b 100644 --- a/src/commands/fsmail.c +++ b/src/commands/fsmail.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Send mail message to all people on your friends list diff --git a/src/commands/gcom.c b/src/commands/gcom.c index dd107df..04dcf6d 100644 --- a/src/commands/gcom.c +++ b/src/commands/gcom.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * stop a user from using a certain command diff --git a/src/commands/go.c b/src/commands/go.c index 21d44b9..e5091d7 100644 --- a/src/commands/go.c +++ b/src/commands/go.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Move to another room diff --git a/src/commands/greet.c b/src/commands/greet.c index da7c448..682405e 100644 --- a/src/commands/greet.c +++ b/src/commands/greet.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * print out greeting in large letters diff --git a/src/commands/grepusers.c b/src/commands/grepusers.c index 617d896..37e0bc7 100644 --- a/src/commands/grepusers.c +++ b/src/commands/grepusers.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * This command allows you to do a search for any user names that match diff --git a/src/commands/help.c b/src/commands/help.c index f0ce44f..2050f07 100644 --- a/src/commands/help.c +++ b/src/commands/help.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Show the list of commands, credits, and display the help files for the given command diff --git a/src/commands/history.c b/src/commands/history.c index a585abf..69ba87b 100644 --- a/src/commands/history.c +++ b/src/commands/history.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * shows the history file of a given user diff --git a/src/commands/home.c b/src/commands/home.c index 051a585..dfc80be 100644 --- a/src/commands/home.c +++ b/src/commands/home.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" #ifdef NETLINKS diff --git a/src/commands/ignlist.c b/src/commands/ignlist.c index 67f5c9b..29d1af8 100644 --- a/src/commands/ignlist.c +++ b/src/commands/ignlist.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * displays what the user is currently listening to/ignoring diff --git a/src/commands/ignuser.c b/src/commands/ignuser.c index e6f9e54..1a52990 100644 --- a/src/commands/ignuser.c +++ b/src/commands/ignuser.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * set to ignore/listen to a user diff --git a/src/commands/invite.c b/src/commands/invite.c index 63aabdc..54b4969 100644 --- a/src/commands/invite.c +++ b/src/commands/invite.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Invite a user into a private room diff --git a/src/commands/join.c b/src/commands/join.c index a0727bd..9c94172 100644 --- a/src/commands/join.c +++ b/src/commands/join.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Join a user in another room diff --git a/src/commands/kill_user.c b/src/commands/kill_user.c index e9538f4..1994d2d 100644 --- a/src/commands/kill_user.c +++ b/src/commands/kill_user.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Kill a user - bump them off the talker diff --git a/src/commands/last.c b/src/commands/last.c index 18b8a6a..54b4f39 100644 --- a/src/commands/last.c +++ b/src/commands/last.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Shows when a user was last logged on diff --git a/src/commands/letmein.c b/src/commands/letmein.c index a5880aa..cf8d672 100644 --- a/src/commands/letmein.c +++ b/src/commands/letmein.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Ask to be let into a private room diff --git a/src/commands/listbans.c b/src/commands/listbans.c index 6cd3955..ef6fa54 100644 --- a/src/commands/listbans.c +++ b/src/commands/listbans.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * List banned sites or users diff --git a/src/commands/listen.c b/src/commands/listen.c index 9ac7801..9a9c32b 100644 --- a/src/commands/listen.c +++ b/src/commands/listen.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Allows a user to listen to everything again diff --git a/src/commands/lmail.c b/src/commands/lmail.c index 3e50094..b49c00c 100644 --- a/src/commands/lmail.c +++ b/src/commands/lmail.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Send mail message to everyone diff --git a/src/commands/logging.c b/src/commands/logging.c index 56ec6d2..35b10f3 100644 --- a/src/commands/logging.c +++ b/src/commands/logging.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Turn on and off each individual system log, or globally on and off diff --git a/src/commands/look.c b/src/commands/look.c index 83f41bb..f621370 100644 --- a/src/commands/look.c +++ b/src/commands/look.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Display details of room diff --git a/src/commands/macros.c b/src/commands/macros.c index 02a4922..3b63b49 100644 --- a/src/commands/macros.c +++ b/src/commands/macros.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Display user macros diff --git a/src/commands/mail_from.c b/src/commands/mail_from.c index 1c7ae28..3b56313 100644 --- a/src/commands/mail_from.c +++ b/src/commands/mail_from.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Show list of people your mail is from without seeing the whole lot diff --git a/src/commands/minlogin.c b/src/commands/minlogin.c index 9116bf3..d7091ee 100644 --- a/src/commands/minlogin.c +++ b/src/commands/minlogin.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Set minlogin level diff --git a/src/commands/mkinvis.c b/src/commands/mkinvis.c index 65e497d..360c9d6 100644 --- a/src/commands/mkinvis.c +++ b/src/commands/mkinvis.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Force a user to become invisible diff --git a/src/commands/mkvis.c b/src/commands/mkvis.c index b87bb0d..efc5f19 100644 --- a/src/commands/mkvis.c +++ b/src/commands/mkvis.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Force a user to become visible diff --git a/src/commands/morph.c b/src/commands/morph.c index 0ab51bd..99cee2c 100644 --- a/src/commands/morph.c +++ b/src/commands/morph.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" #ifndef __SDS_H #include "../vendors/sds/sds.h" #endif diff --git a/src/commands/move.c b/src/commands/move.c index 34fccc8..6ef49b4 100644 --- a/src/commands/move.c +++ b/src/commands/move.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Wizard moves a user to another room diff --git a/src/commands/mutter.c b/src/commands/mutter.c index 271cfcd..6b3de5c 100644 --- a/src/commands/mutter.c +++ b/src/commands/mutter.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Tell something to everyone but one person diff --git a/src/commands/muzzle.c b/src/commands/muzzle.c index 55ab543..5d739c5 100644 --- a/src/commands/muzzle.c +++ b/src/commands/muzzle.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Muzzle an annoying user so he cant speak, emote, echo, write, smail diff --git a/src/commands/myclones.c b/src/commands/myclones.c index 5b5261f..eb61892 100644 --- a/src/commands/myclones.c +++ b/src/commands/myclones.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Show users own clones diff --git a/src/commands/myroom.c b/src/commands/myroom.c index 2f3e1b4..7504f4c 100644 --- a/src/commands/myroom.c +++ b/src/commands/myroom.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * lets a user enter their own room. It creates the room if !exists diff --git a/src/commands/myroom_admin.c b/src/commands/myroom_admin.c index a7568fb..f680658 100644 --- a/src/commands/myroom_admin.c +++ b/src/commands/myroom_admin.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" #ifndef __SDS_H #include "../vendors/sds/sds.h" #endif diff --git a/src/commands/myroom_bgone.c b/src/commands/myroom_bgone.c index a49cc22..63e1c75 100644 --- a/src/commands/myroom_bgone.c +++ b/src/commands/myroom_bgone.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * allow a user to bump others from their personal room diff --git a/src/commands/myroom_key.c b/src/commands/myroom_key.c index 00dce7a..94a3bf7 100644 --- a/src/commands/myroom_key.c +++ b/src/commands/myroom_key.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * this function allows users to give access to others even if their personal room diff --git a/src/commands/myroom_lock.c b/src/commands/myroom_lock.c index f81ac3f..a4acd38 100644 --- a/src/commands/myroom_lock.c +++ b/src/commands/myroom_lock.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * allows a user to lock their room out to access from anyone diff --git a/src/commands/myroom_paint.c b/src/commands/myroom_paint.c index 01a9ded..78d82ba 100644 --- a/src/commands/myroom_paint.c +++ b/src/commands/myroom_paint.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Enter a description for a personal room diff --git a/src/commands/myroom_rename.c b/src/commands/myroom_rename.c index 294e9bf..1f6f981 100644 --- a/src/commands/myroom_rename.c +++ b/src/commands/myroom_rename.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * allows a user to rename their room diff --git a/src/commands/netdata.c b/src/commands/netdata.c index 11ada40..e9039b2 100644 --- a/src/commands/netdata.c +++ b/src/commands/netdata.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" #ifdef NETLINKS diff --git a/src/commands/netstat.c b/src/commands/netstat.c index 6c2c67c..bf205b9 100644 --- a/src/commands/netstat.c +++ b/src/commands/netstat.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" #ifdef NETLINKS diff --git a/src/commands/pemote.c b/src/commands/pemote.c index 27ed50f..3d2e705 100644 --- a/src/commands/pemote.c +++ b/src/commands/pemote.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Do a private emote diff --git a/src/commands/picture_all.c b/src/commands/picture_all.c index 5c9556f..5b51bcd 100644 --- a/src/commands/picture_all.c +++ b/src/commands/picture_all.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" #ifndef __SDS_H #include "../vendors/sds/sds.h" #endif diff --git a/src/commands/picture_tell.c b/src/commands/picture_tell.c index 8099f89..e4ee583 100644 --- a/src/commands/picture_tell.c +++ b/src/commands/picture_tell.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" #ifndef __SDS_H #include "../vendors/sds/sds.h" #endif diff --git a/src/commands/plead.c b/src/commands/plead.c index 3b3d8ab..eb4eb9f 100644 --- a/src/commands/plead.c +++ b/src/commands/plead.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * ask all the law, (sos), no muzzle restrictions diff --git a/src/commands/preview.c b/src/commands/preview.c index 7bd8c71..0d82114 100644 --- a/src/commands/preview.c +++ b/src/commands/preview.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" #ifndef __SDS_H #include "../vendors/sds/sds.h" #endif diff --git a/src/commands/promote.c b/src/commands/promote.c index 8a82fe1..aa1fec0 100644 --- a/src/commands/promote.c +++ b/src/commands/promote.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Promote a user diff --git a/src/commands/promote_temporary.c b/src/commands/promote_temporary.c index 8fa13cb..194be1d 100644 --- a/src/commands/promote_temporary.c +++ b/src/commands/promote_temporary.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * do a promotion of a user that lasts only for the current session diff --git a/src/commands/purge.c b/src/commands/purge.c index 789bc5a..4528968 100644 --- a/src/commands/purge.c +++ b/src/commands/purge.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * allows the user to call the purge function diff --git a/src/commands/quick_call.c b/src/commands/quick_call.c index 56dc334..c0c05fb 100644 --- a/src/commands/quick_call.c +++ b/src/commands/quick_call.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * set a name for a quick call diff --git a/src/commands/ranks.c b/src/commands/ranks.c index 545ea2f..d47c6b2 100644 --- a/src/commands/ranks.c +++ b/src/commands/ranks.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * show the ranks and commands per level for the talker diff --git a/src/commands/rcountu.c b/src/commands/rcountu.c index f8f0cb6..1522c3d 100644 --- a/src/commands/rcountu.c +++ b/src/commands/rcountu.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * read all the user files to check if a user exists diff --git a/src/commands/read_board.c b/src/commands/read_board.c index b056c0f..12d02b5 100644 --- a/src/commands/read_board.c +++ b/src/commands/read_board.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Read the message board diff --git a/src/commands/reboot_talker.c b/src/commands/reboot_talker.c index 2bfd00c..035b88e 100644 --- a/src/commands/reboot_talker.c +++ b/src/commands/reboot_talker.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Reboot talker interface func diff --git a/src/commands/recount.c b/src/commands/recount.c index cb3ddab..391264b 100644 --- a/src/commands/recount.c +++ b/src/commands/recount.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Remove any expired messages from boards unless force = 2 in which case diff --git a/src/commands/reload_room.c b/src/commands/reload_room.c index b5e2792..f21ba2d 100644 --- a/src/commands/reload_room.c +++ b/src/commands/reload_room.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Reloads the description for one or all rooms--in case you have edited the diff --git a/src/commands/reminder.c b/src/commands/reminder.c index 50fe080..2a37e97 100644 --- a/src/commands/reminder.c +++ b/src/commands/reminder.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Display the reminders a user has to them diff --git a/src/commands/remote_stat.c b/src/commands/remote_stat.c index ae8899c..c11013a 100644 --- a/src/commands/remote_stat.c +++ b/src/commands/remote_stat.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" #ifdef NETLINKS diff --git a/src/commands/resite.c b/src/commands/resite.c index 6e58939..10593bd 100644 --- a/src/commands/resite.c +++ b/src/commands/resite.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" #ifdef IDENTD diff --git a/src/commands/retire.c b/src/commands/retire.c index 5ddfbc8..5ca7f11 100644 --- a/src/commands/retire.c +++ b/src/commands/retire.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Retire a user--i.e., remove from the wizlist but do not alter level diff --git a/src/commands/revafk.c b/src/commands/revafk.c index f85b844..17ffcdb 100644 --- a/src/commands/revafk.c +++ b/src/commands/revafk.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Show recorded tells and pemotes diff --git a/src/commands/revclr.c b/src/commands/revclr.c index a6d3e3f..eb48ada 100644 --- a/src/commands/revclr.c +++ b/src/commands/revclr.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Clear the review buffer diff --git a/src/commands/revedit.c b/src/commands/revedit.c index e3e0908..b54b488 100644 --- a/src/commands/revedit.c +++ b/src/commands/revedit.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Show recorded tells and pemotes diff --git a/src/commands/review.c b/src/commands/review.c index b433b56..b55f6bb 100644 --- a/src/commands/review.c +++ b/src/commands/review.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * See review of conversation diff --git a/src/commands/revshout.c b/src/commands/revshout.c index eaa0c5f..90ce20b 100644 --- a/src/commands/revshout.c +++ b/src/commands/revshout.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * See review of shouts diff --git a/src/commands/revtell.c b/src/commands/revtell.c index 7742be3..4c373fa 100644 --- a/src/commands/revtell.c +++ b/src/commands/revtell.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Show recorded tells and pemotes diff --git a/src/commands/rmail.c b/src/commands/rmail.c index 313b3a1..fe1c706 100644 --- a/src/commands/rmail.c +++ b/src/commands/rmail.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Read your mail diff --git a/src/commands/room.c b/src/commands/room.c index 2e50606..50a69bf 100644 --- a/src/commands/room.c +++ b/src/commands/room.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" #include "rooms.h" /* diff --git a/src/commands/samesite.c b/src/commands/samesite.c index 87cee3e..56911d7 100644 --- a/src/commands/samesite.c +++ b/src/commands/samesite.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Display all the people logged on from the same site as user diff --git a/src/commands/say.c b/src/commands/say.c index 1fb46f1..3973771 100644 --- a/src/commands/say.c +++ b/src/commands/say.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Say user speech. diff --git a/src/commands/sayto.c b/src/commands/sayto.c index b78b665..f01bcf5 100644 --- a/src/commands/sayto.c +++ b/src/commands/sayto.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Direct a say to someone, even though the whole room can hear it diff --git a/src/commands/search_boards.c b/src/commands/search_boards.c index 26ec731..5e5e0f6 100644 --- a/src/commands/search_boards.c +++ b/src/commands/search_boards.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Search all the boards for the words given in the list. Rooms fixed to diff --git a/src/commands/semote.c b/src/commands/semote.c index 7d1d281..25f7a87 100644 --- a/src/commands/semote.c +++ b/src/commands/semote.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Do a shout emote diff --git a/src/commands/set.c b/src/commands/set.c index 14bb3eb..fdcacdd 100644 --- a/src/commands/set.c +++ b/src/commands/set.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Set the user attributes diff --git a/src/commands/set_desc.c b/src/commands/set_desc.c index 74b7bfb..e354585 100644 --- a/src/commands/set_desc.c +++ b/src/commands/set_desc.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Set user description diff --git a/src/commands/set_ignore.c b/src/commands/set_ignore.c index 6665832..b4d9d9b 100644 --- a/src/commands/set_ignore.c +++ b/src/commands/set_ignore.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * sets up a channel for the user to ignore diff --git a/src/commands/set_iophrase.c b/src/commands/set_iophrase.c index a20135e..6da2f98 100644 --- a/src/commands/set_iophrase.c +++ b/src/commands/set_iophrase.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Set in and out phrases diff --git a/src/commands/set_room_access.c b/src/commands/set_room_access.c index 5177420..f46c1be 100644 --- a/src/commands/set_room_access.c +++ b/src/commands/set_room_access.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Set rooms to public or private diff --git a/src/commands/set_topic.c b/src/commands/set_topic.c index 2cc8a24..9f1e33c 100644 --- a/src/commands/set_topic.c +++ b/src/commands/set_topic.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Set the room topic diff --git a/src/commands/setcmdlev.c b/src/commands/setcmdlev.c index 772dc15..edf8934 100644 --- a/src/commands/setcmdlev.c +++ b/src/commands/setcmdlev.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Allows a user to alter the minimum level which can use the command given diff --git a/src/commands/sfrom.c b/src/commands/sfrom.c index 5c68de4..3e96266 100644 --- a/src/commands/sfrom.c +++ b/src/commands/sfrom.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Show list of people suggestions are from without seeing the whole lot diff --git a/src/commands/shackle.c b/src/commands/shackle.c index 8c87a1b..6d24e0e 100644 --- a/src/commands/shackle.c +++ b/src/commands/shackle.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Stop a user from using the go command and leaving the room they are currently in diff --git a/src/commands/shout.c b/src/commands/shout.c index 755a8f7..4c7505b 100644 --- a/src/commands/shout.c +++ b/src/commands/shout.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Shout something diff --git a/src/commands/show.c b/src/commands/show.c index 54f9481..5b0ca21 100644 --- a/src/commands/show.c +++ b/src/commands/show.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Show command, i.e., "Type --> " diff --git a/src/commands/show_version.c b/src/commands/show_version.c index 37e843f..7aa9fe2 100644 --- a/src/commands/show_version.c +++ b/src/commands/show_version.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Show version number and some small stats of the talker diff --git a/src/commands/shutdown_com.c b/src/commands/shutdown_com.c index 7205310..b7df079 100644 --- a/src/commands/shutdown_com.c +++ b/src/commands/shutdown_com.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Shutdown talker interface func. Countdown time is entered in seconds so diff --git a/src/commands/sing_it.c b/src/commands/sing_it.c index 36f580b..0c27d38 100644 --- a/src/commands/sing_it.c +++ b/src/commands/sing_it.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * put speech in a music notes diff --git a/src/commands/site.c b/src/commands/site.c index 97f0d26..2e480d4 100644 --- a/src/commands/site.c +++ b/src/commands/site.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Site a user diff --git a/src/commands/smail.c b/src/commands/smail.c index 81fe13c..082e50c 100644 --- a/src/commands/smail.c +++ b/src/commands/smail.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Send mail message diff --git a/src/commands/sreboot.c b/src/commands/sreboot.c index 450b6d7..c9c1d64 100644 --- a/src/commands/sreboot.c +++ b/src/commands/sreboot.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Seamless reboot talker interface func diff --git a/src/commands/status.c b/src/commands/status.c index b728f21..bae4002 100644 --- a/src/commands/status.c +++ b/src/commands/status.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Show some user stats diff --git a/src/commands/sto.c b/src/commands/sto.c index e91094d..3395316 100644 --- a/src/commands/sto.c +++ b/src/commands/sto.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Shout something to someone diff --git a/src/commands/suggestions.c b/src/commands/suggestions.c index 83e2854..362a03c 100644 --- a/src/commands/suggestions.c +++ b/src/commands/suggestions.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Write a suggestion to the board, or read if if you can diff --git a/src/commands/suicide.c b/src/commands/suicide.c index b9ed38c..4ce9222 100644 --- a/src/commands/suicide.c +++ b/src/commands/suicide.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Allow a user to delete their own account diff --git a/src/commands/system.c b/src/commands/system.c index 00456e8..9cc4fde 100644 --- a/src/commands/system.c +++ b/src/commands/system.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Show talker system parameters etc diff --git a/src/commands/tell_user.c b/src/commands/tell_user.c index af0048b..c50586e 100644 --- a/src/commands/tell_user.c +++ b/src/commands/tell_user.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Tell another user something diff --git a/src/commands/think_it.c b/src/commands/think_it.c index 7cb3892..36a365d 100644 --- a/src/commands/think_it.c +++ b/src/commands/think_it.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * put speech in a think bubbles diff --git a/src/commands/time.c b/src/commands/time.c index 09c71a5..f5c8e00 100644 --- a/src/commands/time.c +++ b/src/commands/time.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Get current system time diff --git a/src/commands/toggle_ignall.c b/src/commands/toggle_ignall.c index 97b0d5a..45f6961 100644 --- a/src/commands/toggle_ignall.c +++ b/src/commands/toggle_ignall.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Switch ignoring all on and off diff --git a/src/commands/toggle_mode.c b/src/commands/toggle_mode.c index ae43462..eb5cd6c 100644 --- a/src/commands/toggle_mode.c +++ b/src/commands/toggle_mode.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Switch between command and speech mode diff --git a/src/commands/toggle_prompt.c b/src/commands/toggle_prompt.c index 7c1cfa9..f415ea0 100644 --- a/src/commands/toggle_prompt.c +++ b/src/commands/toggle_prompt.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Switch prompt on and off diff --git a/src/commands/toggle_swearban.c b/src/commands/toggle_swearban.c index e1baf91..d1e4cd3 100644 --- a/src/commands/toggle_swearban.c +++ b/src/commands/toggle_swearban.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Switch swearing ban on and off diff --git a/src/commands/unarrest.c b/src/commands/unarrest.c index 9425673..199b08a 100644 --- a/src/commands/unarrest.c +++ b/src/commands/unarrest.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Unarrest a user who is currently under arrest and in jail diff --git a/src/commands/unban.c b/src/commands/unban.c index db1e864..6c2514e 100644 --- a/src/commands/unban.c +++ b/src/commands/unban.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * uban a site (or domain) or user diff --git a/src/commands/uninvite.c b/src/commands/uninvite.c index d0f9eda..6f84405 100644 --- a/src/commands/uninvite.c +++ b/src/commands/uninvite.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * no longer invite a user to the room you are in if you invited them diff --git a/src/commands/unmuzzle.c b/src/commands/unmuzzle.c index f69afc1..a63364e 100644 --- a/src/commands/unmuzzle.c +++ b/src/commands/unmuzzle.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Unmuzzle the bastard now he has apologised and grovelled enough via email diff --git a/src/commands/unretire.c b/src/commands/unretire.c index 0fe37b7..c027caa 100644 --- a/src/commands/unretire.c +++ b/src/commands/unretire.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Unretire a user--i.e., put them back on show on the wizlist diff --git a/src/commands/unshackle.c b/src/commands/unshackle.c index f0f222d..cbc1295 100644 --- a/src/commands/unshackle.c +++ b/src/commands/unshackle.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Allow a user to move between rooms again diff --git a/src/commands/verify.c b/src/commands/verify.c index 5dec86e..77a7cdf 100644 --- a/src/commands/verify.c +++ b/src/commands/verify.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * verify that mail has been sent to the address supplied diff --git a/src/commands/viewlog.c b/src/commands/viewlog.c index 94fb4c9..c59be3c 100644 --- a/src/commands/viewlog.c +++ b/src/commands/viewlog.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * View the system log diff --git a/src/commands/visibility.c b/src/commands/visibility.c index f68813a..ea47b8d 100644 --- a/src/commands/visibility.c +++ b/src/commands/visibility.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Set user visible or invisible diff --git a/src/commands/visit.c b/src/commands/visit.c index fe162ad..196e1b3 100644 --- a/src/commands/visit.c +++ b/src/commands/visit.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" #ifndef __SDS_H #include "../vendors/sds/sds.h" #endif diff --git a/src/commands/wake.c b/src/commands/wake.c index 2873395..95993f9 100644 --- a/src/commands/wake.c +++ b/src/commands/wake.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Wake up some idle sod diff --git a/src/commands/who.c b/src/commands/who.c index d41c0ea..3f1e10c 100644 --- a/src/commands/who.c +++ b/src/commands/who.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Show who is on. type 0=who, 1=fwho, 2=people diff --git a/src/commands/wipe_board.c b/src/commands/wipe_board.c index d470069..a0bc097 100644 --- a/src/commands/wipe_board.c +++ b/src/commands/wipe_board.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Wipe some messages off the board diff --git a/src/commands/wizemote.c b/src/commands/wizemote.c index 6d2e291..2f45aa4 100644 --- a/src/commands/wizemote.c +++ b/src/commands/wizemote.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Emote something to other wizes and gods. If the level isn't given it diff --git a/src/commands/wizlist.c b/src/commands/wizlist.c index 0df3415..380cf28 100644 --- a/src/commands/wizlist.c +++ b/src/commands/wizlist.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Show the wizzes that are currently logged on, and get a list of names from the lists saved diff --git a/src/commands/wizshout.c b/src/commands/wizshout.c index 5e071f4..fba6046 100644 --- a/src/commands/wizshout.c +++ b/src/commands/wizshout.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Shout something to other wizes and gods. If the level isn't given it diff --git a/src/commands/write_board.c b/src/commands/write_board.c index 91debd3..0e0fdd3 100644 --- a/src/commands/write_board.c +++ b/src/commands/write_board.c @@ -1,8 +1,8 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * Write on the message board diff --git a/src/commands/xcom.c b/src/commands/xcom.c index 466b4b9..56551f2 100644 --- a/src/commands/xcom.c +++ b/src/commands/xcom.c @@ -1,7 +1,7 @@ -#include "../includes/defines.h" -#include "../includes/globals.h" -#include "../includes/commands.h" -#include "../includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /* * stop a user from using a certain command diff --git a/src/games.c b/src/games.c index 3cd8ac2..c4315c1 100644 --- a/src/games.c +++ b/src/games.c @@ -11,10 +11,10 @@ #ifdef GAMES -#include "./includes/defines.h" -#include "./includes/globals.h" -#include "./includes/commands.h" -#include "./includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /*****************************************************************************/ diff --git a/src/messages.c b/src/messages.c index f2d74af..9156981 100644 --- a/src/messages.c +++ b/src/messages.c @@ -9,10 +9,10 @@ NUTS version 3.3.3 (Triple Three :) - Copyright (C) Neil Robertson 1996 ***************************************************************************/ -#include "./includes/defines.h" -#include "./includes/globals.h" -#include "./includes/commands.h" -#include "./includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /***************************************************************************/ diff --git a/src/netlinks.c b/src/netlinks.c index 58fdceb..0ef944d 100644 --- a/src/netlinks.c +++ b/src/netlinks.c @@ -10,10 +10,10 @@ ***************************************************************************/ -#include "./includes/defines.h" -#include "./includes/globals.h" -#include "./includes/commands.h" -#include "./includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" #ifndef __SDS_H #include "./vendors/sds/sds.h" #endif diff --git a/src/objects.c b/src/objects.c index 5b3138e..5f9a1d0 100644 --- a/src/objects.c +++ b/src/objects.c @@ -9,10 +9,10 @@ NUTS version 3.3.3 (Triple Three :) - Copyright (C) Neil Robertson 1996 ***************************************************************************/ -#include "./includes/defines.h" -#include "./includes/globals.h" -#include "./includes/commands.h" -#include "./includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /***************************************************************************/ diff --git a/src/pager.c b/src/pager.c index 5924370..70f9a30 100644 --- a/src/pager.c +++ b/src/pager.c @@ -9,10 +9,10 @@ NUTS version 3.3.3 (Triple Three :) - Copyright (C) Neil Robertson 1996 ***************************************************************************/ -#include "./includes/defines.h" -#include "./includes/globals.h" -#include "./includes/commands.h" -#include "./includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /*************************************************************************** diff --git a/src/reboot.c b/src/reboot.c index 16d2851..b73fa15 100644 --- a/src/reboot.c +++ b/src/reboot.c @@ -9,10 +9,10 @@ NUTS version 3.3.3 (Triple Three :) - Copyright (C) Neil Robertson 1996 ***************************************************************************/ -#include "./includes/defines.h" -#include "./includes/globals.h" -#include "./includes/commands.h" -#include "./includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /*************************************************************************** diff --git a/src/rooms.c b/src/rooms.c index 80a6e5c..b910e4e 100644 --- a/src/rooms.c +++ b/src/rooms.c @@ -9,11 +9,11 @@ NUTS version 3.3.3 (Triple Three :) - Copyright (C) Neil Robertson 1996 ***************************************************************************/ -#include "./includes/defines.h" -#include "./includes/globals.h" -#include "./includes/commands.h" -#include "./includes/prototypes.h" -#include "./includes/rooms.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" +#include "rooms.h" /***************************************************************************/ diff --git a/src/speech.c b/src/speech.c index 8194a0b..aa7a9ca 100644 --- a/src/speech.c +++ b/src/speech.c @@ -9,10 +9,10 @@ NUTS version 3.3.3 (Triple Three :) - Copyright (C) Neil Robertson 1996 ***************************************************************************/ -#include "./includes/defines.h" -#include "./includes/globals.h" -#include "./includes/commands.h" -#include "./includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /***************************************************************************/ diff --git a/src/spodlist.c b/src/spodlist.c index f5e5687..b72ae68 100644 --- a/src/spodlist.c +++ b/src/spodlist.c @@ -9,11 +9,11 @@ NUTS version 3.3.3 (Triple Three :) - Copyright (C) Neil Robertson 1996 ***************************************************************************/ -#include "./includes/defines.h" -#include "./includes/globals.h" -#include "./includes/commands.h" -#include "./includes/spodlist.h" -#include "./includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "spodlist.h" +#include "prototypes.h" /*************************************************************************** diff --git a/src/strings.c b/src/strings.c index 031c78c..3ef1a94 100644 --- a/src/strings.c +++ b/src/strings.c @@ -9,10 +9,10 @@ NUTS version 3.3.3 (Triple Three :) - Copyright (C) Neil Robertson 1996 ***************************************************************************/ -#include "./includes/defines.h" -#include "./includes/globals.h" -#include "./includes/commands.h" -#include "./includes/prototypes.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" /***************************************************************************/ diff --git a/src/telnet.c b/src/telnet.c index 9d7758b..253ae3e 100644 --- a/src/telnet.c +++ b/src/telnet.c @@ -10,11 +10,11 @@ ***************************************************************************/ -#include "./includes/defines.h" -#include "./includes/globals.h" -#include "./includes/commands.h" -#include "./includes/prototypes.h" -#include "./includes/telnet.h" +#include "defines.h" +#include "globals.h" +#include "commands.h" +#include "prototypes.h" +#include "telnet.h" /***************************************************************************/ From 942442948d776fa1a17e54bd10042fe74fae7653 Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Sat, 23 Nov 2024 21:57:57 +0000 Subject: [PATCH 15/22] I seemed to have broken the look command --- src/amnuts.c | 6 ++++-- src/includes/prototypes.h | 2 +- src/strings.c | 11 ++++++----- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/amnuts.c b/src/amnuts.c index 379481d..85457cf 100644 --- a/src/amnuts.c +++ b/src/amnuts.c @@ -3609,12 +3609,12 @@ write_user(UR_OBJECT user, const char *str) } } - str = escape_percentages(user, str); + sds escaped_str = escape_percentages(user, str); /* Process string and write to buffer */ cnt = 0; buffpos = 0; - for (s = str; *s; ++s) { + for (s = escaped_str; *s; ++s) { /* Flush buffer if above high watermark; * 6 chars is max a single char can expand into */ if (buffpos > OUT_BUFF_SIZE - 6) { @@ -3685,6 +3685,8 @@ write_user(UR_OBJECT user, const char *str) write_sock(user->socket, colour_codes[0].esc_code); } } + + sdsfree(escaped_str); } void diff --git a/src/includes/prototypes.h b/src/includes/prototypes.h index e29eb3d..d759f17 100644 --- a/src/includes/prototypes.h +++ b/src/includes/prototypes.h @@ -581,7 +581,7 @@ void split_command_string(char *); size_t teslen(const char *, size_t); void get_soundex(const char *, char *); char *word_time(int); -const char *escape_percentages(UR_OBJECT user, const char *str); +sds escape_percentages(UR_OBJECT user, const char *str); /* * functions in telnet.c diff --git a/src/strings.c b/src/strings.c index 3ef1a94..2683479 100644 --- a/src/strings.c +++ b/src/strings.c @@ -948,11 +948,12 @@ word_time(int t) /** * Work around a problem with sending escapes through telnet_printf() */ -const char * +sds escape_percentages(UR_OBJECT user, const char *str) { + sds escaped_str = sdsempty(); + if (user && user->telnet) { - sds escaped_str = sdsnew(""); for (const char *p = str; *p != '\0'; ++p) { if (*p == '%') { escaped_str = sdscat(escaped_str, "%%"); @@ -960,9 +961,9 @@ escape_percentages(UR_OBJECT user, const char *str) escaped_str = sdscatlen(escaped_str, p, 1); } } - str = escaped_str; - sdsfree(escaped_str); + } else { + escaped_str = sdsnew(str); } - return str; + return escaped_str; } From 598eb7f514932467b6b237ecb7d0274cd54c988b Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Sat, 23 Nov 2024 23:37:24 +0000 Subject: [PATCH 16/22] Fixed segfault with netlinks when verification fails --- src/amnuts.c | 2 +- src/includes/prototypes.h | 2 +- src/netlinks.c | 17 ++++++++++------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/amnuts.c b/src/amnuts.c index 85457cf..9d0a307 100644 --- a/src/amnuts.c +++ b/src/amnuts.c @@ -4825,7 +4825,7 @@ connect_user(UR_OBJECT user) destruct_user(user); --amsys->num_of_logins; #ifdef NETLINKS - if (!action_nl(user, "look", NULL)) + if (!action_nl(u, "look", NULL)) #endif { look(u); diff --git a/src/includes/prototypes.h b/src/includes/prototypes.h index d759f17..f871b34 100644 --- a/src/includes/prototypes.h +++ b/src/includes/prototypes.h @@ -337,7 +337,7 @@ void nl_granted(NL_OBJECT nl, char *name); void nl_denied(NL_OBJECT nl, char *name, char *inpstr); void nl_mesg(NL_OBJECT nl, char *name); void nl_prompt(NL_OBJECT nl, char *name); -void nl_verification(NL_OBJECT nl, char *w2, char *w3, int com); +void nl_verification(NL_OBJECT *nl, char *w2, char *w3, int com); void nl_removed(NL_OBJECT nl, char *name); void nl_error(NL_OBJECT nl); void nl_checkexist(NL_OBJECT nl, char *to, char *from); diff --git a/src/netlinks.c b/src/netlinks.c index 0ef944d..55a89ad 100644 --- a/src/netlinks.c +++ b/src/netlinks.c @@ -468,10 +468,10 @@ exec_netcom(NL_OBJECT nl, char *inpstr) nl_prompt(nl, w2); break; case NLC_VERIFICATION: - nl_verification(nl, w2, w3, 0); + nl_verification(&nl, w2, w3, 0); break; case NLC_VERIFY: - nl_verification(nl, w2, w3, 1); + nl_verification(&nl, w2, w3, 1); break; case NLC_REMOVED: nl_removed(nl, w2); @@ -513,7 +513,7 @@ exec_netcom(NL_OBJECT nl, char *inpstr) } NEXT_LINE: /* See if link has closed */ - if (nl->type == UNCONNECTED) { + if (!nl || nl->type == UNCONNECTED) { return; } c[1] = ctemp; @@ -887,14 +887,16 @@ nl_prompt(NL_OBJECT nl, char *name) * Verification received from remote site */ void -nl_verification(NL_OBJECT nl, char *w2, char *w3, int com) +nl_verification(NL_OBJECT *nl_ptr, char *w2, char *w3, int com) { + NL_OBJECT nl = *nl_ptr; NL_OBJECT nl2; if (!com) { /* We are verifiying a remote site */ if (!*w2) { shutdown_netlink(nl); + *nl_ptr = NULL; return; } for (nl2 = nl_first; nl2; nl2 = nl2->next) { @@ -929,6 +931,7 @@ nl_verification(NL_OBJECT nl, char *w2, char *w3, int com) sprintf(text, "%s BAD\n", netcom[NLC_VERIFY]); write_sock(nl->socket, text); shutdown_netlink(nl); + *nl_ptr = NULL; return; } @@ -938,20 +941,20 @@ nl_verification(NL_OBJECT nl, char *w2, char *w3, int com) "NETLINK: Connection to %s has bad verification.\n", nl->service); /* Let wizes know its failed, may be wiz initiated */ - sprintf(text, - "~OLSYSTEM:~RS Connection to %s failed, bad verification.\n", - nl->service); vwrite_level((enum lvl_value) command_table[CONN].level, 1, NORECORD, NULL, "~OLSYSTEM:~RS Connection to %s failed, bad verification.\n", nl->service); shutdown_netlink(nl); + *nl_ptr = NULL; return; } if (strcmp(w2, "OK")) { write_syslog(NETLOG, 1, "NETLINK: Unknown verify return code from %s.\n", nl->service); shutdown_netlink(nl); + *nl_ptr = NULL; + return; } /* Set link permissions */ if (!strcmp(w3, "OUT")) { From d26a292510f2b72e04338ae5158985932b294586 Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Sun, 24 Nov 2024 21:28:00 +0000 Subject: [PATCH 17/22] Minor fixes --- src/amnuts.c | 4 ++-- src/reboot.c | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/amnuts.c b/src/amnuts.c index 9d0a307..c43ea09 100644 --- a/src/amnuts.c +++ b/src/amnuts.c @@ -3543,7 +3543,7 @@ write_sock_with_size_and_flags(int s, const char *str, size_t length, int flag) void write_telnet(telnet_t *t, const char *str) { - telnet_printf(t, str); + telnet_printf(t, "%s", str); } void @@ -3551,7 +3551,7 @@ write_telnet_with_size(telnet_t *t, const char *str, size_t length) { sds buff; buff = sdscatprintf(sdsempty(), "%.*s", (int)length, str); - telnet_printf(t, buff); + write_telnet(t, buff); sdsfree(buff); } diff --git a/src/reboot.c b/src/reboot.c index b73fa15..c12ba1e 100644 --- a/src/reboot.c +++ b/src/reboot.c @@ -335,7 +335,7 @@ build_ident_info(void) void close_fds(void) { - int i, d = 0; + int i; UR_OBJECT u; /* FIXME: use sysconf(_SC_OPEN_MAX) */ @@ -366,9 +366,8 @@ close_fds(void) if (u) { continue; } - if (!close(i)) { - ++d; - } + + close(i); } } From 7033402bd6a90f27073ea792af498d39df5a7b69 Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Sun, 24 Nov 2024 01:20:16 +0000 Subject: [PATCH 18/22] Moved compiling to clang - Updated dockerfile - Tweaked Makefile - Fixed things clang reported when compiling --- Makefile | 4 ++-- docker-setup.sh | 16 +++------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index c5abe5e..d40b6a7 100644 --- a/Makefile +++ b/Makefile @@ -4,8 +4,8 @@ BINDIR = $(CURDIR)/build INCDIR = $(CURDIR)/src/includes PERMS = 755 -CC = gcc -C_FLAGS = -g -Wall -W -MMD +CC = clang +C_FLAGS = -g -Wall -Wextra -MMD CC_FLAGS = -I$(INCDIR) LD_FLAGS = diff --git a/docker-setup.sh b/docker-setup.sh index fbcedee..9de0566 100644 --- a/docker-setup.sh +++ b/docker-setup.sh @@ -1,24 +1,14 @@ #!/usr/bin/env bash -MACHINE=$(uname -m) -if [ "$MACHINE" == "x86_64" ] || [ "$MACHINE" == "i686" ]; then - OS_ARCH="amd64" -elif [ "$MACHINE" == "aarch64" ] || [ "$MACHINE" == "arm64" ]; then - OS_ARCH="arm64v8" -else - OS_ARCH="amd64" - echo "Unknown platform - falling back to amd64" -fi - CONFIG_FILE="$(pwd)/files/datafiles/config" MAIN_PORT=$(grep "\bmainport\b" "$CONFIG_FILE" | awk '{ print $2 }') WIZ_PORT=$(grep "\bwizport\b" "$CONFIG_FILE" | awk '{ print $2 }') LINK_PORT=$(grep "\blinkport\b" "$CONFIG_FILE" | awk '{ print $2 }') cat << EOT > Dockerfile -FROM ${OS_ARCH}/alpine +FROM alpine:latest -RUN apk add build-base supervisor bash busybox-extras gdb +RUN apk add --no-cache build-base bash busybox-extras clang gdb lldb supervisor COPY supervisord.conf /etc/supervisord.conf WORKDIR /amnuts @@ -49,4 +39,4 @@ services: - seccomp:unconfined cap_add: - SYS_PTRACE -EOT \ No newline at end of file +EOT From 17104850f536c699aee226d715c74ac11fe74aa6 Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Sun, 24 Nov 2024 21:58:06 +0000 Subject: [PATCH 19/22] WIP changes list --- docs/amnuts_changes | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/amnuts_changes b/docs/amnuts_changes index ec369e5..a6037fb 100644 --- a/docs/amnuts_changes +++ b/docs/amnuts_changes @@ -3,6 +3,24 @@ Information on the changes between different version of Amnuts +------------------------------------------------------------------------------+ +2.5.0 +----- + +Added libtelnet vendor library to help with telnet negotiation +Added workaround to libtelnet to be able to use the '%' symbol in speech :) + +Updated the cmdcount command code to make it better + +Fixed display bug in the preview command + +2.4.0 +----- + +Almost all of the commands have been moved to their own files, so a fair bit of reworking structure +Added the SDS vendor library to start marking string copying/formatting/sizes a little safer, and made a start on that (long, long) journey +A docker setup has been added for those who want to run or compile Amnuts in a container +Various typos fixed +Some docs updated 2.3.0 ----- From c6955ff94c26f2107261a255aa7ef48b8a92d73c Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Sat, 18 Jan 2025 12:21:03 +0000 Subject: [PATCH 20/22] Moved C version to GNU23 and added pedantic flag --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d40b6a7..e43ec15 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,13 @@ BINDIR = $(CURDIR)/build INCDIR = $(CURDIR)/src/includes PERMS = 755 CC = clang -C_FLAGS = -g -Wall -Wextra -MMD +# -std=gnu23 = Use the C23 standard with GNU extras +# -g = Add debugging information to the executable +# -Wall = Enable all compiler warnings +# -Wextra = Extra warnings not covered by the above +# -MMD = Generate dependency files +# -Wpedantic = Be pedantic about the code +C_FLAGS = -std=gnu23 -g -Wall -Wextra -MMD -Wpedantic CC_FLAGS = -I$(INCDIR) LD_FLAGS = From 3d55f1250669933c106ca5027524214b48b77a77 Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Sat, 18 Jan 2025 12:25:53 +0000 Subject: [PATCH 21/22] Fix issues from pedantic flag --- src/commands/addhistory.c | 2 +- src/commands/arrest.c | 2 +- src/commands/bring.c | 2 +- src/commands/cedit.c | 2 +- src/commands/clearline.c | 2 +- src/commands/cshouts.c | 2 +- src/commands/ctopic.c | 2 +- src/commands/fsmail.c | 2 +- src/commands/join.c | 2 +- src/commands/listbans.c | 2 +- src/commands/logging.c | 2 +- src/commands/macros.c | 2 +- src/commands/minlogin.c | 2 +- src/commands/muzzle.c | 2 +- src/commands/myroom.c | 2 +- src/commands/myroom_lock.c | 2 +- src/commands/myroom_paint.c | 2 +- src/commands/promote.c | 2 +- src/commands/ranks.c | 2 +- src/commands/read_board.c | 2 +- src/commands/reboot_talker.c | 2 +- src/commands/resite.c | 3 +-- src/commands/say.c | 2 +- src/commands/set_ignore.c | 2 +- src/commands/setcmdlev.c | 2 +- src/commands/sreboot.c | 2 +- src/commands/toggle_swearban.c | 2 +- src/commands/unarrest.c | 2 +- src/commands/unmuzzle.c | 2 +- src/commands/unretire.c | 2 +- src/commands/visibility.c | 2 +- src/commands/wipe_board.c | 1 - src/commands/write_board.c | 2 +- src/commands/xcom.c | 2 +- src/vendors/sds/sds.c | 2 +- src/vendors/sds/sds.h | 2 +- src/vendors/sds/sdsalloc.h | 2 +- 37 files changed, 36 insertions(+), 38 deletions(-) diff --git a/src/commands/addhistory.c b/src/commands/addhistory.c index bf74180..52e793b 100644 --- a/src/commands/addhistory.c +++ b/src/commands/addhistory.c @@ -27,4 +27,4 @@ manual_history(UR_OBJECT user, char *inpstr) sprintf(text, "%-*s : %s\n", USER_NAME_LEN, user->name, inpstr); add_history(word[1], 1, "%s", text); vwrite_user(user, "You have added to %s's history list.\n", word[1]); -} \ No newline at end of file +} diff --git a/src/commands/arrest.c b/src/commands/arrest.c index d15319b..acebff2 100644 --- a/src/commands/arrest.c +++ b/src/commands/arrest.c @@ -77,4 +77,4 @@ arrest(UR_OBJECT user) } save_user_details(u, on); done_retrieve(u); -} \ No newline at end of file +} diff --git a/src/commands/bring.c b/src/commands/bring.c index 27d7bc1..21d0e57 100644 --- a/src/commands/bring.c +++ b/src/commands/bring.c @@ -48,4 +48,4 @@ bring(UR_OBJECT user) } move_user(u, rm, 2); prompt(u); -} \ No newline at end of file +} diff --git a/src/commands/cedit.c b/src/commands/cedit.c index 34bb367..eaa0ed2 100644 --- a/src/commands/cedit.c +++ b/src/commands/cedit.c @@ -10,4 +10,4 @@ void clear_edit(UR_OBJECT user) { destruct_review_buffer_type(user, rbfEDIT, 0); -} \ No newline at end of file +} diff --git a/src/commands/clearline.c b/src/commands/clearline.c index 3592a60..fccb832 100644 --- a/src/commands/clearline.c +++ b/src/commands/clearline.c @@ -38,4 +38,4 @@ clearline(UR_OBJECT user) vwrite_user(user, "Line %d cleared.\n", sock); destructed = 0; no_prompt = 0; -} \ No newline at end of file +} diff --git a/src/commands/cshouts.c b/src/commands/cshouts.c index 95fbcbd..9ba7b2a 100644 --- a/src/commands/cshouts.c +++ b/src/commands/cshouts.c @@ -16,4 +16,4 @@ clear_shouts(void) *amsys->shoutbuff[i] = '\0'; } amsys->sbuffline = 0; -} \ No newline at end of file +} diff --git a/src/commands/ctopic.c b/src/commands/ctopic.c index 0f2b7e9..9c554a2 100644 --- a/src/commands/ctopic.c +++ b/src/commands/ctopic.c @@ -38,4 +38,4 @@ clear_topic(UR_OBJECT user) return; } write_user(user, "Usage: ctopic [all]\n"); -} \ No newline at end of file +} diff --git a/src/commands/fsmail.c b/src/commands/fsmail.c index 414681b..040fb94 100644 --- a/src/commands/fsmail.c +++ b/src/commands/fsmail.c @@ -54,4 +54,4 @@ friend_smail(UR_OBJECT user, char *inpstr) write_syslog(SYSLOG, 1, "%s sent mail to all people on their friends list.\n", user->name); -} \ No newline at end of file +} diff --git a/src/commands/join.c b/src/commands/join.c index 9c94172..2e3b14d 100644 --- a/src/commands/join.c +++ b/src/commands/join.c @@ -49,4 +49,4 @@ join(UR_OBJECT user) vwrite_user(user, "~FC~OLYou have joined~RS %s~RS ~FC~OLin the~RS %s~RS~FC~OL.\n", u->recap, u->room->show_name); -} \ No newline at end of file +} diff --git a/src/commands/listbans.c b/src/commands/listbans.c index ef6fa54..73b61ae 100644 --- a/src/commands/listbans.c +++ b/src/commands/listbans.c @@ -72,4 +72,4 @@ listbans(UR_OBJECT user) return; } write_user(user, "Usage: lban sites|users|new|swears\n"); -} \ No newline at end of file +} diff --git a/src/commands/logging.c b/src/commands/logging.c index 35b10f3..8e53af6 100644 --- a/src/commands/logging.c +++ b/src/commands/logging.c @@ -160,4 +160,4 @@ logging(UR_OBJECT user) return; } write_user(user, "Usage: logging -l|-s|-r|-n|-e|-on|-off\n"); -} \ No newline at end of file +} diff --git a/src/commands/macros.c b/src/commands/macros.c index 3b63b49..e45eefe 100644 --- a/src/commands/macros.c +++ b/src/commands/macros.c @@ -23,4 +23,4 @@ macros(UR_OBJECT user) for (i = 0; i < 10; ++i) { vwrite_user(user, " ~OL%d)~RS %s\n", i, user->macros[i]); } -} \ No newline at end of file +} diff --git a/src/commands/minlogin.c b/src/commands/minlogin.c index d7091ee..5a73855 100644 --- a/src/commands/minlogin.c +++ b/src/commands/minlogin.c @@ -88,4 +88,4 @@ minlogin(UR_OBJECT user) vwrite_user(user, "Total of ~OL%d~RS users were disconnected.\n", cnt); } destructed = 0; -} \ No newline at end of file +} diff --git a/src/commands/muzzle.c b/src/commands/muzzle.c index 5d739c5..3b19c97 100644 --- a/src/commands/muzzle.c +++ b/src/commands/muzzle.c @@ -62,4 +62,4 @@ muzzle(UR_OBJECT user) } save_user_details(u, on); done_retrieve(u); -} \ No newline at end of file +} diff --git a/src/commands/myroom.c b/src/commands/myroom.c index 7504f4c..b840e65 100644 --- a/src/commands/myroom.c +++ b/src/commands/myroom.c @@ -91,4 +91,4 @@ personal_room(UR_OBJECT user) return; } move_user(user, rm, 1); -} \ No newline at end of file +} diff --git a/src/commands/myroom_lock.c b/src/commands/myroom_lock.c index a4acd38..1176514 100644 --- a/src/commands/myroom_lock.c +++ b/src/commands/myroom_lock.c @@ -29,4 +29,4 @@ personal_room_lock(UR_OBJECT user) if (!personal_room_store(user->name, 1, user->room)) write_syslog(SYSLOG | ERRLOG, 1, "ERROR: Unable to save personal room status in personal_room_lock()\n"); -} \ No newline at end of file +} diff --git a/src/commands/myroom_paint.c b/src/commands/myroom_paint.c index 78d82ba..2b8b803 100644 --- a/src/commands/myroom_paint.c +++ b/src/commands/myroom_paint.c @@ -40,4 +40,4 @@ personal_room_decorate(UR_OBJECT user, char *inpstr) write_syslog(SYSLOG | ERRLOG, 1, "ERROR: Unable to save personal room status in personal_room_decorate()\n"); } -} \ No newline at end of file +} diff --git a/src/commands/promote.c b/src/commands/promote.c index aa1fec0..dad17b8 100644 --- a/src/commands/promote.c +++ b/src/commands/promote.c @@ -94,4 +94,4 @@ promote(UR_OBJECT user) } save_user_details(u, on); done_retrieve(u); -} \ No newline at end of file +} diff --git a/src/commands/ranks.c b/src/commands/ranks.c index d47c6b2..02af55a 100644 --- a/src/commands/ranks.c +++ b/src/commands/ranks.c @@ -35,4 +35,4 @@ show_ranks(UR_OBJECT user) } write_user(user, "+----------------------------------------------------------------------------+\n\n"); -} \ No newline at end of file +} diff --git a/src/commands/read_board.c b/src/commands/read_board.c index 12d02b5..3d9b3d4 100644 --- a/src/commands/read_board.c +++ b/src/commands/read_board.c @@ -63,4 +63,4 @@ read_board(UR_OBJECT user) vwrite_room_except(user->room, user, "%s~RS reads the message board.\n", name); } -} \ No newline at end of file +} diff --git a/src/commands/reboot_talker.c b/src/commands/reboot_talker.c index 035b88e..4ef1658 100644 --- a/src/commands/reboot_talker.c +++ b/src/commands/reboot_talker.c @@ -56,4 +56,4 @@ reboot_com(UR_OBJECT user) "\n\07~FY~OL~LI*** WARNING - This will reboot the talker! ***\n\nAre you sure about this (y|n)? "); user->misc_op = 7; no_prompt = 1; -} \ No newline at end of file +} diff --git a/src/commands/resite.c b/src/commands/resite.c index 10593bd..49930ef 100644 --- a/src/commands/resite.c +++ b/src/commands/resite.c @@ -57,5 +57,4 @@ resite(UR_OBJECT user) sprintf(text, "Refreshed site lookup for \"%s\".\n", u->name); write_user(user, text); } - -#endif \ No newline at end of file +#endif diff --git a/src/commands/say.c b/src/commands/say.c index 3973771..6270b6e 100644 --- a/src/commands/say.c +++ b/src/commands/say.c @@ -58,4 +58,4 @@ say(UR_OBJECT user, char *inpstr) record(user->room, text); write_room_except(user->room, text, user); vwrite_user(user, "You ~FG%s~RS: %s\n", type, inpstr); -} \ No newline at end of file +} diff --git a/src/commands/set_ignore.c b/src/commands/set_ignore.c index b4d9d9b..be66117 100644 --- a/src/commands/set_ignore.c +++ b/src/commands/set_ignore.c @@ -99,4 +99,4 @@ set_ignore(UR_OBJECT user) default: break; } -} \ No newline at end of file +} diff --git a/src/commands/setcmdlev.c b/src/commands/setcmdlev.c index edf8934..693369e 100644 --- a/src/commands/setcmdlev.c +++ b/src/commands/setcmdlev.c @@ -71,4 +71,4 @@ set_command_level(UR_OBJECT user) vwrite_room(NULL, "~OL~FR--==<~RS The level for command ~OL%s~RS has been set to %s ~OL~FR>==--\n", cmd->name, user_level[cmd->level].name); -} \ No newline at end of file +} diff --git a/src/commands/sreboot.c b/src/commands/sreboot.c index c9c1d64..fbe4eb3 100644 --- a/src/commands/sreboot.c +++ b/src/commands/sreboot.c @@ -56,4 +56,4 @@ sreboot_com(UR_OBJECT user) "\n\07~FY~OL~LI*** WARNING - This will seamlessly reboot the talker! ***\n\nAre you sure about this (y|n)? "); user->misc_op = 7; no_prompt = 1; -} \ No newline at end of file +} diff --git a/src/commands/toggle_swearban.c b/src/commands/toggle_swearban.c index d1e4cd3..baea5da 100644 --- a/src/commands/toggle_swearban.c +++ b/src/commands/toggle_swearban.c @@ -27,4 +27,4 @@ toggle_swearban(UR_OBJECT user) write_syslog(SYSLOG, 1, "%s set swearing ban to OFF.\n", user->name); break; } -} \ No newline at end of file +} diff --git a/src/commands/unarrest.c b/src/commands/unarrest.c index 199b08a..3151442 100644 --- a/src/commands/unarrest.c +++ b/src/commands/unarrest.c @@ -70,4 +70,4 @@ unarrest(UR_OBJECT user) } save_user_details(u, on); done_retrieve(u); -} \ No newline at end of file +} diff --git a/src/commands/unmuzzle.c b/src/commands/unmuzzle.c index a63364e..985f81e 100644 --- a/src/commands/unmuzzle.c +++ b/src/commands/unmuzzle.c @@ -61,4 +61,4 @@ unmuzzle(UR_OBJECT user) } save_user_details(u, on); done_retrieve(u); -} \ No newline at end of file +} diff --git a/src/commands/unretire.c b/src/commands/unretire.c index c027caa..045280b 100644 --- a/src/commands/unretire.c +++ b/src/commands/unretire.c @@ -52,4 +52,4 @@ unretire_user(UR_OBJECT user) } save_user_details(u, on); done_retrieve(u); -} \ No newline at end of file +} diff --git a/src/commands/visibility.c b/src/commands/visibility.c index ea47b8d..5ed9973 100644 --- a/src/commands/visibility.c +++ b/src/commands/visibility.c @@ -32,4 +32,4 @@ visibility(UR_OBJECT user, int vis) "~FB~OL%s recites a melodic incantation and disappears!\n", user->bw_recap); user->vis = 0; -} \ No newline at end of file +} diff --git a/src/commands/wipe_board.c b/src/commands/wipe_board.c index a0bc097..5f54b25 100644 --- a/src/commands/wipe_board.c +++ b/src/commands/wipe_board.c @@ -98,4 +98,3 @@ wipe_board(UR_OBJECT user) write_syslog(SYSLOG, 1, "%s wiped %d message%s from the board in the %s.\n", user->name, cnt, PLTEXT_S(cnt), rm->name); } - diff --git a/src/commands/write_board.c b/src/commands/write_board.c index 0e0fdd3..5fe26a8 100644 --- a/src/commands/write_board.c +++ b/src/commands/write_board.c @@ -106,4 +106,4 @@ write_board(UR_OBJECT user, char *inpstr) vwrite_room_except(user->room, user, "%s writes a message on the board.\n", name); ++user->room->mesg_cnt; -} \ No newline at end of file +} diff --git a/src/commands/xcom.c b/src/commands/xcom.c index 56551f2..5aa5a10 100644 --- a/src/commands/xcom.c +++ b/src/commands/xcom.c @@ -118,4 +118,4 @@ user_xcom(UR_OBJECT user) write_syslog(SYSLOG, 1, "%s XCOM'd the command \"%s\" for %s\n", user->name, word[2], u->name); } -} \ No newline at end of file +} diff --git a/src/vendors/sds/sds.c b/src/vendors/sds/sds.c index 836e757..3a7eae7 100644 --- a/src/vendors/sds/sds.c +++ b/src/vendors/sds/sds.c @@ -1325,4 +1325,4 @@ int sdsTest(void) { int main(void) { return sdsTest(); } -#endif \ No newline at end of file +#endif diff --git a/src/vendors/sds/sds.h b/src/vendors/sds/sds.h index 7f6a08b..adcc12c 100644 --- a/src/vendors/sds/sds.h +++ b/src/vendors/sds/sds.h @@ -271,4 +271,4 @@ void sds_free(void *ptr); int sdsTest(int argc, char *argv[]); #endif -#endif \ No newline at end of file +#endif diff --git a/src/vendors/sds/sdsalloc.h b/src/vendors/sds/sdsalloc.h index e556f70..f43023c 100644 --- a/src/vendors/sds/sdsalloc.h +++ b/src/vendors/sds/sdsalloc.h @@ -39,4 +39,4 @@ #define s_malloc malloc #define s_realloc realloc -#define s_free free \ No newline at end of file +#define s_free free From ce38ccdb8e535338a646b79db16aabbc58413d5b Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Sat, 18 Jan 2025 12:26:44 +0000 Subject: [PATCH 22/22] 'version' property no longer valid for docker --- docker-setup.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/docker-setup.sh b/docker-setup.sh index 9de0566..fda6440 100644 --- a/docker-setup.sh +++ b/docker-setup.sh @@ -20,7 +20,6 @@ CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"] EOT cat << EOT > docker-compose.yml -version: "3" services: amnuts: build: ./