Changeset 109
- Timestamp:
- Jun 18, 2007, 9:29:51 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Makefile.in
r108 r109 1688 1688 sh_async.o: $(srcsrc)/sh_async.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_calls.h $(srcinc)/sh_error.h 1689 1689 sh_processcheck.o: $(srcsrc)/sh_processcheck.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_modules.h $(srcinc)/sh_processcheck.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_extern.h $(srcinc)/sh_calls.h $(srcinc)/CuTest.h 1690 sh_portcheck.o: $(srcsrc)/sh_portcheck.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_mem.h $(srcinc)/sh_ utils.h $(srcinc)/sh_modules.h $(srcinc)/CuTest.h1690 sh_portcheck.o: $(srcsrc)/sh_portcheck.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_mem.h $(srcinc)/sh_calls.h $(srcinc)/sh_utils.h $(srcinc)/sh_modules.h $(srcinc)/CuTest.h -
trunk/depend.dep
r108 r109 62 62 sh_async.o: $(srcsrc)/sh_async.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_calls.h $(srcinc)/sh_error.h 63 63 sh_processcheck.o: $(srcsrc)/sh_processcheck.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_modules.h $(srcinc)/sh_processcheck.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_extern.h $(srcinc)/sh_calls.h $(srcinc)/CuTest.h 64 sh_portcheck.o: $(srcsrc)/sh_portcheck.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_mem.h $(srcinc)/sh_ utils.h $(srcinc)/sh_modules.h $(srcinc)/CuTest.h64 sh_portcheck.o: $(srcsrc)/sh_portcheck.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_mem.h $(srcinc)/sh_calls.h $(srcinc)/sh_utils.h $(srcinc)/sh_modules.h $(srcinc)/CuTest.h -
trunk/depend.sum
r108 r109 1 3139738957 1 4114523250 -
trunk/src/sh_portcheck.c
r80 r109 39 39 #include <errno.h> 40 40 #include <unistd.h> 41 #include <fcntl.h> 41 42 42 43 #define PORTCHK_VERSION "1.0" … … 110 111 #include "sh_error.h" 111 112 #include "sh_mem.h" 113 #include "sh_calls.h" 112 114 #include "sh_utils.h" 113 115 #include "sh_modules.h" … … 676 678 /* struct in_addr haddr; */ 677 679 int retval; 680 int flags; 678 681 char * p; 679 682 #ifndef TEST_ONLY … … 728 731 fprintf(stderr, _("check port: %5d on %15s open %s\n"), 729 732 port, inet_ntoa(haddr), p); 733 734 #if !defined(O_NONBLOCK) 735 #if defined(O_NDELAY) 736 #define O_NONBLOCK O_NDELAY 737 #else 738 #define O_NONBLOCK 0 739 #endif 740 #endif 741 742 /* prepare to close connection gracefully 743 */ 744 if (port == 22) /* ssh */ 745 { 746 flags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0); 747 retry_fcntl(FIL__, __LINE__, fd, F_SETFL, flags | O_NONBLOCK); 748 write (fd, _("SSH-2.0-Foobar"), 14); 749 write (fd, "\r\n", 2); 750 } 751 else if (port == 25) /* smtp */ 752 { 753 flags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0); 754 retry_fcntl(FIL__, __LINE__, fd, F_SETFL, flags | O_NONBLOCK); 755 write (fd, _("QUIT"), 4); 756 write (fd, "\r\n", 2); 757 } 758 else if (port == 79) /* finger */ 759 { 760 flags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0); 761 retry_fcntl(FIL__, __LINE__, fd, F_SETFL, flags | O_NONBLOCK); 762 write (fd, "\r\n", 2); 763 } 764 else if (port == 110) /* pop3 */ 765 { 766 flags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0); 767 retry_fcntl(FIL__, __LINE__, fd, F_SETFL, flags | O_NONBLOCK); 768 write (fd, _("QUIT"), 4); 769 write (fd, "\r\n", 2); 770 } 771 else if (port == 143) /* imap */ 772 { 773 flags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0); 774 retry_fcntl(FIL__, __LINE__, fd, F_SETFL, flags | O_NONBLOCK); 775 write (fd, _("A01 LOGOUT"), 10); 776 write (fd, "\r\n", 2); 777 } 730 778 } 731 779 close (fd);
Note:
See TracChangeset
for help on using the changeset viewer.