📄 ckuins.txt
字号:
The wtmp File When C-Kermit is started as an IKSD (under inetd), it makes syslog and wtmp entries, and also keeps its own ftpd-like log. The code assumes the wtmp log is /var/log/wtmp on Linux and /usr/adm/wtmp elsewhere. No doubt this assumption will need adjustment. Use -DWTMPFILE=path to override at compile time (there is also a runtime override). See iksd.txt for details.UTMP, utsname(), etc. C-Kermit 7.0 gets as much info as it can about its job -- mainly for IKSD logging -- from utmp. But of course utmp formats and fields differ, and for that matter, there can be two different header files, <utmp.h> and <utmpx.h>. Look for HAVEUTMPX and HAVEUTHOST in ckufio.c, let me know of any needed adjustments.Password lookup IKSD also needs to authenticate incoming users against the password list. In some cases, this requires the addition of -lcrypt (e.g. in Unixware 2.x). In most others, the crypt functions are in the regular C library. If you get "crypt" as an unresolved symbol at link time, add -lcrypt to LIBS. If your site has local replacement libraries for authentication, you might need a special LIBS clause such as "LIBS= -L/usr/local/lib -lpwent".getusershell() This is called by the IKSD at login time to see if a user has been "turned off". But many UNIX platforms lack this function. In that case, you will get unresolved symbol reports at link time for _getusershell, _endusershell; to work around, add -DNOGETUSERSHELL.initgroups() This is called by IKSD after successful authentication. But some platforms do not have this function, so obviously it can't be called there, in which case add -DNOINITGROUPS.setreuid(), setregid() not found or "deprecated" Find out what your UNIX variety wants you to use instead, and make appropriate substitutions in routine zvpass(), module ckufio.c.printf() IKSD installs a printf() substitute to allow redirection of printf-like output to the connection. However, this can conflict with some curses libraries. In this case, separate binaries must be built for IKSD and non-IKSD use.If you encounter difficulties with any of the above, and you are notinterested in running C-Kermit as an IKSD, then simply add NOIKSD to CFLAGSand rebuild. Example: make sco286 (get lots of errors) make clean make sco286 "KFLAGS=-DNOIKSD"Some non-IKSD things to watch out for:Return type of main() The main() routine is in ckcmai.c. If you get complaints about "main: return type is not blah", define MAINTYPE on the CC command line, e.g. 'make xxx "KFLAGS=-DMAINTYPE=blah"' (where "blah" is int, long, or whatever). If the complaint is "Attempt to return a value from a function of type void" then add -DMAINISVOID: 'make xxx "KFLAGS=-DMAINISVOID"'DNS Service Records This feature allows a remote host to redirect C-Kermit to the appropriate socket for the requested service; e.g. if C-Kermit requests service "telnet" and the host offers Telnet service on port 999 rather than the customary port 23. If you get compile-time complaints about not being able to find <resolv.h>, <netdb.h>, or <arpa/nameser.h>, add -DNO_DNS_SRV to CFLAGS. If you get link-time complaints about unresolved symbols res_search or dn_expand, try adding -lresolve to LIBS.\v(ipaddress) If "echo \v(ipaddress)" shows an empty string rather than your local IP address, add -DCKGHNLHOST to CFLAGS and rebuild.<sys/wait.h> If this file can't be found at compile time, add -DNOREDIRECT to CFLAGS. This disables the REDIRECT and PIPE commands and anything else that needs the wait() system service.syslog() C-Kermit can now write syslog records. Some older platforms might not have the syslog facility. In that case, add -DNOSYSLOG. Others might have it, but require addition of -lsocket to LIBS (SCO OSR5 is an example). See Section 15.putenv() If "_putenv" comes up as an undefined symbol, add -DNOPUTENV to CFLAGS and rebuild."Passing arg1 of 'time' from incompatible pointer" This is a mess. See the mass of #ifdefs in the appropriate module, ckutio.c or ckufio.c.gettimeofday() Wrong number of arguments. On most platforms, gettimeofday() takes two arguments, but on a handful of others (e.g. Motorola System V/88 V4, SNI Reliant UNIX 5.43, etc) it takes one. If your version of gettimeofday() is being called with two args but wants one, add -DGTODONEARG."Assignment makes pointer from integer without a cast" This warning might appear in ckufio.c or ckutio (or elsewhere), and usually can be traced to the use of a system or library function that returns a pointer but that is not declared in the system header files even though it should be. Several functions are commonly associated with this error: . getcwd(): Add -DDCLGETCWD to CFLAGS and rebuild. . popen(): Add -DDCLPOPEN to CFLAGS and rebuild. . fdopen(): Add -DDCLFDOPEN to CFLAGS and rebuild."Operands of = have incompatible types" (or "Incompatible types in assignment") If this comes from ckcnet.c and comes from a statement involving inet_addr(), try adding -DINADDRX to CFLAGS. If that doesn't help, then try adding -DNOMHHOST.Complaints about args to get/setsockopt(), getpeername(), getsockname() These are all in ckcnet.c. Different platforms & OS's and versions of the same OS change this all the time: int, size_t, unsigned long, etc. All the affected variables are declared according to #ifdefs within ckcnet.c, so find the declarations and adjust the #ifdefs accordingly.size_t In case of complaints about "unknown type size_t", add -DSIZE_T=int (or other appropriate type) to CFLAGS.'tz' undefinedUse of undefined enum/struct/union 'timezone'Left of 'tv_sec' specifies undefined struct/union 'timeval' And similar complaints in ckutio.c: Add -DNOGFTIMER and/or -DNOTIMEVAL.Symlinks The new built-in DIRECTORY command should show symlinks like "ls -l" does. If it does not, check to see if your platform has the lstat() and readlink() functions. If so, add -DUSE_LSTAT and -DCKSYMLINK to CFLAGS and rebuild. On the other hand, if lstat() is unresolved at link time, add -DNOLSTAT to CFLAGS. If readlink() is also unresolved, add -DNOSYMLINK.realpath() Link-time complains about realpath() -- find the library in which it resides and add it to LIBS (example for Unixware 7.1: "-lcudk70") or add -DNOREALPATH to CFLAGS and rebuild.Failure to locate header file <term.h> Usually happens on Linux systems that have the C compiler installed, but not the ncurses package (see comments about selective installs above). Go back and install ncurses, or use "make linuxnc" (Linux No Curses)."Can't find shared library libc.so.2.1""Can't find shared library libncurses.so.3.0", etc... You are trying to run a binary that was built on a computer that has different library versions than your computer, and your computer's loader is picky about library version numbers. Rebuild from source on your computer.Time (struct tm) related difficulties: Errors like the following: "ckutio.c", line 11994: incomplete struct/union/enum tm: _tm "ckutio.c", line 11995: error: cannot dereference non-pointer type "ckutio.c", line 11995: error: assignment type mismatch "ckutio.c", line 11997: warning: using out of scope declaration: localtime "ckutio.c", line 11997: error: unknown operand size: op "=" "ckutio.c", line 11997: error: assignment type mismatch "ckutio.c", line 11998: error: undefined struct/union member: tm_year "ckutio.c", line 12000: error: undefined struct/union member: tm_mon "ckutio.c", line 12001: error: undefined struct/union member: tm_mday "ckutio.c", line 12002: error: undefined struct/union member: tm_hour "ckutio.c", line 12003: error: undefined struct/union member: tm_min "ckutio.c", line 12004: error: undefined struct/union member: tm_sec are due to failure to include the appropriate time.h header files. UNIX platforms generally have one or more of the following: <time.h>, <sys/time.h>, and <sys/timeb.h>. Any combination of these might be required. Defaults are set up for each makefile target. The defaults can be corrected on the CC command line by adding the appropriate definition from the following list to CFLAGS: -DTIMEH Include <time.h> -DNOTIMEH Don't include <time.h> -DSYSTIMEH Include <sys/time.h> -DNOSYSTIMEH Don't include <sys/time.h> -DSYSTIMEBH Include <sys/timeb.h> -DNOSYSTIMEBH Don't include <sys/timeb.h> Note that <sys/timeb.h> is relatively scarce in the System V and POSIX environments; the only platform of recent vintage where it is still used is OSF/1 and its derivatives (Digital UNIX and Tru64 UNIX).Struct timeval and/or timezone not declared: In some cases, merely including the appropriate time.h header files is still not enough. POSIX.1 does not define the timeval struct, and so the items we need from the header are protected against us by #ifndef _POSIX_SOURCE or somesuch. In this case, we have to declare the timeval (and timezone) structs ourselves. To force this, include -DDCLTIMEVAL in CFLAGS.Warnings about dn_expand() Argument #4 WARNING: argument is incompatible with prototyp. It's the old char versus unsigned char stupidity again. Try to find a compiler switch like GCC's "-funsigned-char". Failing that, add -DCKQUERYTYPE=xxx to CFLAGS, where xxx is whatever 'man dn_expand' tells you the type of the 4th argument should be (presumably either char or unsigned char; in the latter case use CHAR to avoid confusion caused by multiple words.Switch Table Overflow (in ckouni.c) Add -DNOUNICODE to CFLAGS.Compile-time warnings about ck_out() or tgetstr() or tputs(): Easy solution: Add -DNOTERMCAP to CFLAGS. But then you lose the SCREEN function. Real solution: Try all different combinations of the following CFLAGS: -DTPUTSARGTYPE=char -DTPUTSFNTYPE=int -DTPUTSARGTYPE=int -DTPUTSFNTYPE=void Until the warnings go away, except maybe "ck_outc: return with a value in a function returning void", and in that case also add -DTPUTSISVOID."Passing arg 1 of to tputs() makes pointer from integer without a cast": Add -DTPUTSARG1CONST to CFLAGS."Undefined symbol: dup2" Add -DNOZEXEC to CFLAGS."header file 'termcap.h' not found" Add -DNOHTERMCAP to CFLAGS.Other difficulties are generally of the "where is curses.h and what is itcalled this week?" variety (most easily solved by making symlinks in theinclude and lib directories), or overzealous complaints regarding typemismatches in function calls because of the totally needless and sillysigned versus unsigned char conflict (*), etc. In any case, please send anycompilation or linking warnings or errors to the author, preferably alongwith fixes.(*) C-Kermit does not use the signed property of chars at all anywhere, ever. So if all chars and char *'s can be made unsigned at compile time, as they can in gcc with "-funsigned-char", they should be.IMPORTANT: If you find any of these hints necessary for a particular maketarget (or you hit upon others not listed here), PLEASE SEND A REPORT TO: kermit-support@columbia.edu.4.1. The UNIX MakefileIf your distribution does not contain a file with this name, thenrename the file called ckuker.mak to makefile: mv ckuker.mak makefileand then you type "make xxx", where xxx is the system you want to buildC-Kermit for. These are listed in the comments at the top of the makefile.For example, to build C-Kermit for Linux, type: make linuxThe makefile is quite long, and at least two versions of UNIX, SCO Xenix/286and 2.x BSD, cannot cope with its length. An attempt to "make sco286" givesthe message "Make: Cannot alloc mem for env.. Stop". Solution: edit awaysome or all of the nonrelevant material from the makefile. (A separateversion of the makefile is provided for BSD 2.x: ckubs2.mak but C-Kermit 7.0can't be build for BSD 2.x -- it has simply grown too large.)Some make programs reportedly cannot handle continued lines (lines endingin backslash (\)). If you have a problem with the makefile, try editing themakefile to join the continued lines (remove the backslashes and the followinglinefeed).Other makefile troubles may occur because tabs in the makefile have somehowbeen converted to spaces. Spaces and tabs are distinct in UNIX makefiles.Similarly, carriage returns might have been added to the end of each line,which also proves confusing to most UNIX versions of make.Check to see if there are comments about your particular version in itsmakefile entry itself. In a text editor such as EMACS or VI, search for themake entry name followed by a colon, e.g. "linux:" (if you really are buildingC-Kermit for Linux, do this now).Check to see if there are comments about your particular version in theckubwr.txt file.If you have trouble with building ckwart.c, or running the resulting wartpreprocessor program on ckcpro.w: 1. Just "touch" the ckcpro.c file that comes in the distribution and then give the "make" command again, or:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -