Changeset 328
- Timestamp:
- Apr 6, 2011, 8:37:39 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/Changelog
r326 r328 4 4 * Add support for X-Forwarded-For in apache logfile parser, add 5 5 option 'RE{regex}' to insert arbitrary regex 6 * New options PortcheckMinPort, PortcheckMaxPort for the open ports 7 check 6 8 7 9 2.8.3a: … … 14 16 * sh_entropy.c: move pthread usage out of child 15 17 * sh_hash.c, sh_pthread.c, sh_pthread.h: sh_hash_hashdelete() 16 needs deadlock detection, may be called from within sh_hash_init() 18 needs deadlock detection, may be called from within sh_hash_init() 17 19 via atexit handler on error condition 18 20 * sh_suidchk.c, sh_calls.c, sh_calls.h: need a nosub version of lstat() … … 24 26 * fix spurious warnings about unsupported address family (reported 25 27 by N Silverman) 26 * option to run lstat/stat in subprocess to avoid hanging on NFS mounts 28 * option to run lstat/stat in subprocess to avoid hanging on NFS mounts 27 29 (off by default) 28 30 * fix Windows/Cygwin compile error (reported by A. Schmidt) -
trunk/src/sh_portcheck.c
r300 r328 129 129 static int sh_portchk_interval = SH_PORTCHK_INTERVAL; 130 130 131 static int sh_portchk_minport = -1; 132 static int sh_portchk_maxport = -1; 133 131 134 struct sh_port { 132 135 int port; … … 195 198 } 196 199 200 static int sh_portchk_set_port_minmax (const char * c, int * setthis) 201 { 202 int retval = 0; 203 long val; 204 205 SL_ENTER(_("sh_portchk_set_port_minmax")); 206 val = strtol (c, (char **)NULL, 10); 207 if (val < 0 || val > 65535) 208 { 209 SH_MUTEX_LOCK(mutex_thread_nolog); 210 sh_error_handle ((-1), FIL__, __LINE__, EINVAL, MSG_EINVALS, 211 _("port check port minmax"), c); 212 SH_MUTEX_UNLOCK(mutex_thread_nolog); 213 retval = -1; 214 } 215 216 *setthis = (int) val; 217 SL_RETURN(0, _("sh_portchk_set_port_minmax")); 218 } 219 220 221 static int sh_portchk_set_minport (const char * str) 222 { 223 return sh_portchk_set_port_minmax (str, &sh_portchk_minport); 224 } 225 226 static int sh_portchk_set_maxport (const char * str) 227 { 228 return sh_portchk_set_port_minmax (str, &sh_portchk_maxport); 229 } 197 230 198 231 static int sh_portchk_set_active (const char * str) … … 246 279 N_("portcheckinterval"), 247 280 sh_portchk_set_interval, 281 }, 282 { 283 N_("portcheckminport"), 284 sh_portchk_set_minport, 285 }, 286 { 287 N_("portcheckmaxport"), 288 sh_portchk_set_maxport, 248 289 }, 249 290 { … … 1166 1207 sh_portchk_interval = SH_PORTCHK_INTERVAL; 1167 1208 1209 sh_portchk_minport = -1; 1210 sh_portchk_maxport = -1; 1211 1168 1212 portlist_udp = sh_portchk_kill_list (portlist_udp); 1169 1213 portlist_tcp = sh_portchk_kill_list (portlist_tcp); … … 1724 1768 SH_MUTEX_LOCK(mutex_port_check); 1725 1769 1726 min_port = 0;1770 min_port = (sh_portchk_minport == -1) ? 0 : sh_portchk_minport; 1727 1771 1728 1772 if (sh_portchk_active != S_FALSE) … … 1733 1777 1734 1778 sh_portchk_reset_lists(); 1735 if ( 0 != geteuid())1779 if ((0 != geteuid()) && (min_port < 1024)) 1736 1780 { 1737 1781 min_port = 1024; … … 1749 1793 sh_port2proc_prepare(); 1750 1794 1795 min_port = (sh_portchk_minport == -1) ? min_port : sh_portchk_minport; 1796 1751 1797 if (sh_portchk_check_udp == 1) 1752 sh_portchk_scan_ports_udp(min_port, -1);1753 sh_portchk_scan_ports_tcp(min_port, -1);1798 sh_portchk_scan_ports_udp(min_port, sh_portchk_maxport); 1799 sh_portchk_scan_ports_tcp(min_port, sh_portchk_maxport); 1754 1800 1755 1801
Note:
See TracChangeset
for help on using the changeset viewer.