CVS log for epic5/source/compat.c |
![]() |
Request diff between arbitrary revisions
* Roll forward portability changes from epic4-2.10 (larne) * This also includes term.h -> termx.h -- Make sure you rerun configure!
* Create aliases for [url|b64][en|de]code, sedcrypt, and sha256 into builtins. * Comment out builtin [url|b64][en|de]code, sedcrypt, sha256 builtin functions. * Change /xquote -u to use xform() instead of urldecode(). * Change dcc_url[en|de]code to use xform() instead of urldecode(). * Change /on ssl_server_cert to use xform() isntead of urldecode(). * This allows me to comment out old urldcode/base64decode stuff. yay!
* Apparantly solaris 9 doesn't have <stdint.h>, intmax_t, or strtoimax. ick. * Begin "fixing" protected implied hooks. Must test above examples. * The sequence we delete stuff on shutdown actually does matter. (Fix crash)
Remove u_* bsd-isms so we can compile with -ansi on linux.
* Fix happykey(). Sometimes, I just don't pay enough attention. * Don't trim 1 too many chars on incoming encrypted messages. Important! * Fix buffer sizes being too small to hold buffer for enc/dec short strings. * Add $xform() handlers for blowfish and cast5 * Whip the $xform() callback functions into usable shape. * Fix base64 encoding both via $xform() and $b64encode(). * Rewrite $xform(), see UPDATES. Strong crypto now supported! YAY!
* Add arg to panic() controlling whether panic is sent via QUIT (rb black)
Fix build on freebsd/i386
* Check for <ndbm.h> in configure, don't do DBM if it is absent. * $dbmctl() always no-ops, returns empty string if dbm not available. * Add 'd' to $info(o) if DBM support is included * Add a check for solaris cc, moxy up the CFLAGS for larne. * Fix compile breakage if both tparm() and base64() are missing. doh. * Fail when maximum number of levels have been added. * Note a few places the window refnum is changed.
* Add a bsd licensed base64 encode/decode in compat.c * Add $b64encode() and $b64decode().
Add configure glop for intmax_t for c90 systems. Will start using later.
Add humanize_number() and fix compiler warnings. more to follow!
* Check for arc4random() in configure, don't use compat.c version if possible. * GC "fill_it_out" code which has been deactive for a while. * Fix translation casting error for zlonix * Allow current_package() to return NULL, handle that as special case. * Refactor the startup loading stuff * Move a couple of loads out of basical and into global.
* Change "ERROR --" to "INFO --" to not alarm people as much. * Change a few other warnings to not be so alarming. * Change new_realloc() to not move ptr if it is big enough to hold new size. * Fix all the status_* sub-formats to not have any hardcoded size limits.
*********** DONT RUN THIS -- IT'S WORK IN PROGRESS -- DONT RUN THIS *********** * Import epic4 commits 674 through 692, inclusive. * Import epic4 commits 693 through 710, inclusive (epic4-2.0 final) * Change _X and _Y macros to LEVEL and LEVELMASK for linux (sigh) * Add a searchbuf() 8 bit clean byte-finder for future use. * Convert flood checking, ignore checking, lastlog, logfiles to int masks. * Convert message_from to int masks. *********** DONT RUN THIS -- IT'S WORK IN PROGRESS -- DONT RUN THIS ***********
More complicated atoll() replacements.
Wrapper for atoll() for freebsd-stable and stuff.
* Rename 'dcc()' to 'dcc_cmd()' so we can use dcc as variable
* Garbage collect unused 'irc_path' global variable.
* Add --with-warns to configure to do FreeBSD "WARNS" like compiler checks
* Many hundreds of changes to improve the "quality of code" in epic, including:
* - Treat all literal strings as (const char *) and fix const correctness.
* - Mopping up all remaining const-correctness issues
* - Do not "launder" a (const char *) to a (char *) in string searches, (ala
strchr) but rather return a ssize_t offset value.
* - Particular, MatchingBracket() returns (ssize_t) and not (char *).
* - Eliminate all "shadow" variable names by changing them to something else.
* - Eliminate most function decls that do not include a prototype list.
* - Add prototypes for all extern functions that are missing them.
* - Ensure most function pointers include a prototype list.
* - In term.c, most of those (char *)'s are really (const char *)'s.
* - Explicitly specify 'static' functions as 'static'
* - Ensure every function is either 'static' or has a prototype.
* - Eliminate (unsigned) < (signed) type comparisons.
* Hopefully you should not notice any changes!
Commit 509: * Move /DCC from commands.c to dcc.c * Nix the "dcc deadlist" crap. Handle deleted dcc's more sensibly now. * Add a "dequote" internal function that removes "s in extended words. * Add "QWORDS" as new arglist type, for quoted-words with "s left in. * Add "arglist" regression test. * Fix strlcpy() in compat.c so it doesn't walk off end of string. * Implement more sensible "locking" mechanism for dcc's * Nix the nominally unimplemented "encrypt" feature for dcc * Create "dcc_create" to create dcc entry * Remove "creation" functionality from "dcc_searchlist" * Nix global variables 'filesize' and 'global_family' now unneeded. * Change order around of arguments to "dcc_searchlist". * Rename "dcc_opened" to "dcc_connected" since that is what it does. * Add "dcc_garbage_collect" which looks for dcc's that need removal. * Add "get_dcc_by_filedesc" and "get_dcc_by_refnum" to look up dcc's * Add "lock_dcc" and "unlock_dcc" to prevent dcc's from being GC'd. * Double check that all output that occurs in dcc.c goes to LOG_DCC * Use dcc_open in dcc_raw_listen() instead of doing the network stuff directly. * Allow "booster ctcp" to be sent for dcc chat re-offerings. * Reorganize register_dcc_offer() so it doesn't create dcc until all is well. * Reorganize process_outgoing_file() into sub-functions. * Don't call "dcc_dead" or "dcc_check" in main io() looper. * Fix new_next_arg_count() to use real_move_to_abs_word() to emulate $1 usage
Nominally remove all uses of "unsafe" functions: (Commit 506)
* Convert all uses of strcpy() to strlcpy()
* Convert all uses of strcat() to strlcat()
* Convert all uses of strmcpy() to strlcpy()
* Convert all uses of strmcat() to strlcat()
* Convert all uses of sprintf() to snprintf()
* As much as possible, use 'sizeof var' in snprintf/strlcpy/strlcat.
* Qualify the size of some global vars so we can sizeof() them.
* Nuke strmcpy(), strmcat(), strmcat_ue(), strmccat(),
* Change strmopencat() to strlopencat().
* Change strmpcat() to strlpcat().
* Fix switch_hostname so it doesn't return a (const) string.
* Fix TimerTimeout so it doesn't return a (const) Timeval.
* Change things like (ret) to do ret while (0); for when "ret" is "{}".
* Fix initialization for load_level
* Stop passing in static strings into io(), so we can modify them.
* Make messages passed to io() more informative to the user.
* Fix CTCP FINGER handler not to assume (struct pw) strings can be overwritten.
* Use (socklen_t) and not an (int) for socket sizes.
* Don't return a value in a void function...
* Don't use return value of process_dcc_chat_ctcps() for assignment.
* Don't put semicolons after function bodies
* Fix $getopt() to save 'input_size' so we can use it with strl*().
* Convert all uses of stpcpy() to strlcat() and strlopencat().
* Nix checks for stpcpy() in configure -- regen configure.
Another merge.
Yikes. Merged to become consistent with HEAD. Sorry for all the commits, I'll be quiet again soon. :) -wd
Commit #427 * Add -l<tcl> to the front of $LIBS so -lm can come after it * Look for SSL stuff in default location before hunting for it in /usr/local. * Reset $withval after check for perl so --without-perl doesn't --without-tcl * Make first arg of cvtchar() a (const char *) to silence warning. * Move 'this_sucks' label to a place where it is legal. * Make check_val() cope with NaNs and INFs more graciously... * Fix null deref with /lastlog -c * Update the input line in set_update(), not the caller * Do update the input line when redrawing status * Change make_status() to return a success/failure value. * Don't clear the "status line wants redraw" flag if redrawing status fails. * Nuke the now unecessary "in_window_command" global variable. * Fix bug where <scrollback> + <scrollforward> left you in scrollback mode. * Force init of Window->lines_held = 0 even though that shouldnt be needed.
* Use server_list_size() and not number_of_servers outside of server.c * Use NOSERV and not -1 for "no server" * Use (Timeval) and not (struct timeval) * Fix (get|set)_server_sent_*() et al to take server refnum. * Use parse_server_index() and not my_atol() to parse server refnums * re-indent quotecmd * Rename is_server_connected() to is_server_registered * Make /quote work as long as server is open (not registered) * Use send_to_aserver() when it can avoid setting from_server unecessarily * Change sent_to_server and clear_sent_to_server to (set|get)server_sent(). * Change doing_* to get_server_doing_*. * Use (unsigned short) and not (u_short) * Use (unsigned long) and not (u_long) * Make output_reject_ctcp() take a refnum * Lock a dcc while we are connecting it, just in case. ;-) * Fix /dcc send -p <port> * Store protocol enforcements as (get|set)_server_protocol_state(). * Use (Stat) and not (struct stat) * Rewrite $timerctl() so it works like $logctl() * Rename is_server_connected() to is_server_registered() * Fix an off-by-one error with /FOR ... IN ... * Keep track of both readable and writable fd's with newio stuff. * Convert server_list to an array of pointers * When user /server -delete's, leave a gap, don't change refnums around. * Nix code that handles deleting server refnums. * New function, new_open_for_writing(), for when we do nonblocking connects. * Change new_open() to deregister fd as "writable" * Renovate the notify stuff to take refnums and not just use from_server. * Renovate /WHO, /ISON, /USERHOST to take refnums and not just use from_server. * Make everything that uses server_list[] use get_server() instead. * Make everything capable of dealing with "gaps" in server_list[]. * Use a bunch of macros, to handle with getting and setting server attrs. * Make as much as possible use refnums as params and not from_server. * And a lot of other stuff...
* Add checks/workaround for linux's broken realpath(). Bleh. * Add arc4random stuff to compat.c -- will be used later! * Fix $realpath() to use normalize_filename() so it gets realpath() fix. * Add $serverctl(SET <refnum> PRIMARY) to set primary server. User beware!
Remove a dependancy on the rest of epic from compat.c. In theory, we try to keep compat.c clean from any sort of entanglements with the rest of epic. Sometimes we even succeed.
I'm going to start sweeping the entire source, adding the official copyright notice to each file (like ircII does already), and making sure that the /* $EPIC$ */ thingee is at the top of the file. This is my first swath of files.
Lots more work on the ipv6 front. Remove the last of the vestiges of the old historical address handlers (inet_ntop/inet_pton/inet_aton/inet_ntoa). Now everything, and I mean EVERYTHING goes through inet_strton and inet_ntostr which are just fancy front ends to getaddrinfo() and getnameinfo(). Quite a bit of EPIC is already family-independent, but there is still some left to be clubbed into submission. The project to add support for IPv6 is now about 75% complete! Perversely enough, the only thing stopping DCC from being essentially 100% IPv6 capable is the inability to send an IPv6 hostname through a handshake without breaking the standard...
Remove some debugging code from compat.c Fix /set status_ssl to not return NULL. I should fix this.
Ok. So it was a mistake to put that ISC inet_ntop() and inet_pton() stuff in compat.c, because systems that don't have inet_ntop() and inet_pton() don't have IPv6 support in libc, and so those functions won't compile anyways. On systems without them, we'll only have inet_ntoa and inet_aton(), if we're lucky. These functions should be trivial wrappers to their IPv4-only counterparts, because again, it's very unlikely we'd ever need to support IPv6 addresses on a system without IPv6 support.
This is a huge monster commit -- I put the particulars of the commit in KNOWNBUGS. I will only say here that this fixes a lot of issues with DCC and introduces a lot of protocol independance into the networking API that epic works with. Good things will continue to come in the future!
The last round of changes for tonight. More of the same... I promise! I'll document the user visible parts of this soon! Really! =) I mean it!
Fix brokenness with regard to "setenv" compat stuff for solaris. Reported by da5id.
Add compat functions for setenv() and unsetenv(). Unfortunately, if your system lacks these functions, setting environment variables causes a memory leak, and you just plain flat out can't unset environment variables. These are defects in the API (or in the OS, whichever one you prefer to blame) and do not represent bugs in EPIC.
Get rid of the awful hideous bsd_*env() hacks we had in compat.c and start using getenv() and setenv() like normal programs do. Unfortunately on many systems, setenv() may result in memory leaks, but this is really not anything I have control over. It's better that we use environment variables in the way the system intends it than to try to go off and do it on our own. This means you can /setenv TZ EST5EDT for example, to set the timezone of your clock, and it also means you can do /setenv ONE two and expect $ONE to expand to "two". It also means that /setenv values are actually propogated to child processes. This is all just a better choice than avoiding a theoretical memory leak.
Commit #29: * Add /on error, to handle ERROR protocol messages. * Fix /window * toggle, to actually toggle. * Add /defer command, per email on epic list. * New hybrid6 script from is-. * Fix a bug with strlcat() from openbsd via freebsd. * Axe long broken "1 second cursor in window" delay thing. * Repeal the "deferred free" stuff in 0.9.15-10 that wasn't too good. That's it!
Initial import into CVS
Initial revision
| CVS Admin |
Powered by ViewCVS 0.9.2 |