Article Title: The Sock5 agent is successfully installed and configured in Linux. Linux is a technology channel of the IT lab in China. Including desktop applications, Linux system management, kernel research, embedded systems and open-source systems. first from the network to find the socks5-v1.0r11.tar.gz, there is a patch package, the package is not under, so what I do not know.
2.socks5-v1.0r11.tar.gz decompress the inverted folder and use the following command. In fact, the network resources in these steps are abundant, but here I try to be detailed and comprehensive.
Decompress the package and execute tar xvzf socks5-v1.0r11.tar.gz
Decompress and generate a socks5-v.1.0r11 directory under the directory.
3. Enter the Directory and run. /Configure. This step is successfully passed.
4. then run make, and encountered a problem during the compilation process. It took me a long time to compile clients/ftp. in the c file, a problem occurs in the command function, prompting that the arargs method is outdated in gcc4.1.2 and cannot be used. However, I have not found any available solutions on the Internet. Therefore, you only need to solve the problem by yourself. The specific problem is varargs. h and stdarg. h is incompatible. That is to say, the methods are different when processing uncertain number of parameters. Currently, gcc uses the stdarg method and does not use the ararg method. The difference between the two is that the va_start () function has different numbers of parameters and different formats. Below I will also list the modified Code and the original code:
Original code:
#include ....int command(va_alist) va_dcl {va_list ap;char *fmt;int r;Sig_t oldintr;abrtflag = 0;if (debug) {printf("---> ");va_start(ap);fmt = va_arg(ap, char *);if (strncmp("PASS ", fmt, 5) == 0)printf("PASS XXXX");else vfprintf(stdout, fmt, ap);va_end(ap);printf("\n");fflush(stdout);}if (cout == NULL) {perror ("No control connection for command");code = -1;return (0);}oldintr = Signal(SIGINT, cmdabort);va_start(ap);fmt = va_arg(ap, char *);vfprintf(cout, fmt, ap);va_end(ap);fflush(cout);cpend = 1;r = getreply(!strcmp(fmt, "QUIT"));Signal(SIGINT, oldintr);if (abrtflag) {kill(getpid(),SIGINT);}return(r);}
|
Modified code:
//#include #include ..../*VARARGS*/int command(const char *args,...) {va_list ap;char *fmt;int r;Sig_t oldintr;abrtflag = 0;if (cout == NULL) {perror ("No control connection for command");code = -1;return (0);}oldintr = Signal(SIGINT, cmdabort);fmt = args;va_start(ap,args);// fmt = va_arg(ap, char *);vfprintf(cout, fmt, ap);va_end(ap);fflush(cout);cpend = 1;r = getreply(!strcmp(fmt, "QUIT"));Signal(SIGINT, oldintr);if (abrtflag) {kill(getpid(),SIGINT);}return(r);}
|
After this function is modified, the call () function in the clients/telnet/commands. c file also needs to be modified.
Here I will introduce you to the articles about va_start () and va_end. For more information, see the usage of the va function in the Standard C language.
[1] [2] Next page