Commit Graph
101 Commits
Author SHA1 Message Date
zimochandmdavidsaver ec85ffc3d0 reset ostream flags when done 2021-11-19 12:13:34 -08:00
Michael Davidsaver fc4e3c5d44 discoverInterfaces() correctly ignore non-IPv4 addresses
Must check sa_family early, before attempting to copy
in case sockaddr needs more storage than sockaddr_in.
2020-11-21 10:32:18 -08:00
Michael Davidsaver 325b138467 Revert "Add support for socket addresses other then IPv4"
This reverts commit 7db4f94b8b.
2020-11-21 10:31:22 -08:00
Michael Davidsaver 862f08a9d3 Revert "Add check for the definition "darwin" to support Mac"
This reverts commit 53cd4fa3ef.
2020-11-21 10:31:22 -08:00
Heinz Junkes 53cd4fa3ef Add check for the definition "darwin" to support Mac 2020-08-20 12:00:06 +02:00
Heinz Junkes af550178e8 Merge branch 'fixUtils' 2020-08-19 16:38:05 +02:00
Heinz Junkes 7db4f94b8b Add support for socket addresses other then IPv4 2020-08-19 16:07:11 +02:00
Michael Davidsaver 598fa1e596 make Destroyable::destroy() optional 2020-06-03 15:55:09 -07:00
zimochandmdavidsaver 3ba6679e67 removed spaces at end of line 2020-04-15 08:17:03 -07:00
zimochandmdavidsaver 40300a12cb replaced tabs with spaces 2020-04-15 08:17:03 -07:00
Michael Davidsaver b24afb9d33 osdGetRoles() avoid fault when gid==0
Attempt to detect misbehaving getgrouplist()
fails when user is actually a member of
group 0 (aka. root).

Instead, fill with (gid_t)-1 which seems less likely
to cause problems if erroneously grant.
2019-09-12 09:32:57 -07:00
Michael Davidsaver fd95f90acc hexDump, now with ascii!
... again
2019-06-26 16:48:31 -07:00
Michael Davidsaver f44dcbfc77 WIN32 fix 2019-06-26 16:48:31 -07:00
mdavidsaverandGitHub 9eb5843def Merge pull request #144 from mdavidsaver/idletimeout
TCP Idle Timeout
2019-06-26 15:57:37 -07:00
Michael Davidsaver a2c106378a avoid deadlock involving fair_queue<T>::clear()
Avoid destroying items while the queue lock is held.
2019-05-29 11:09:24 -07:00
Michael Davidsaver ecee708d3a redo hexDump
ludicrously inefficient (cf. toHex() ), and inflexible.
2019-05-21 08:51:00 -07:00
Michael Davidsaver d593462613 yet more osdGetRoles 2019-05-20 17:48:10 -07:00
Michael Davidsaver b54cc1f62b remove deprecated namedLockPattern.h 2019-05-16 10:21:52 -07:00
Michael Davidsaver e978a29e5e remove deprecated createFileLogger 2019-05-16 10:21:52 -07:00
Michael Davidsaver baf8d47e1a try to fix windows build failure 2019-05-12 18:18:25 -07:00
Michael Davidsaver 736e0c169a Merge branch 'auth'
* auth:
  fix osdGetRoles
  oops
  Add showauth executable
  getgrouplist() on OSX has different sig.
  auth fix mingw static
  fix search PeerInfo
  PeerInfo in pva/server.h and pva/sharedstate.h
  make PeerInfo available during search phase
  auth status void accidental success.
  minor doc
  always need to link with netapi32 now
  authorize with local group lookup
  Add osdGetRoles()
  authorization framework
  pvasr show PeerInfo
  redo security (aka. access control)
  remove asCheck

# Conflicts:
#	src/server/pv/responseHandlers.h
#	src/server/responseHandlers.cpp
2019-05-12 14:40:29 -07:00
Michael Davidsaver 523cb46e21 fix osdGetRoles
Ignore NGROUPS_MAX.  On Darwin NGROUPS_MAX==16.
The actual limit is higher.

getgrouplist() is weird...
2019-04-29 11:20:06 -07:00
Michael Davidsaver 8415a125d9 minor 2019-04-17 09:38:37 -07:00
Bruce Hillandmdavidsaver b3b1e0b2c5 Have env tryGetPropertyAsString() ck for ENV_PARAM default. 2019-04-17 09:34:54 -07:00
Michael Davidsaver 4ea6831800 getgrouplist() on OSX has different sig. 2019-04-10 11:27:46 -07:00
Michael Davidsaver b168c51aac Add osdGetRoles() 2019-01-12 15:14:19 -08:00
Michael Davidsaver 31d98fc965 attempt to please MSVC
Seems not to elide some calls to
Configure::operator=()
2019-01-12 14:31:19 -08:00
Michael Davidsaver 3b4a52a360 remove usage of NoDefaultMethods 2019-01-12 12:02:25 -08:00
Michael Davidsaver 0d1ba091a2 remove unused, and un-useful, IP address utils 2019-01-12 12:02:25 -08:00
Michael Davidsaver 1b273d3787 deprecate createFileLogger() 2018-10-18 17:52:56 -07:00
Michael Davidsaver e6902ee41f avoid UB in decodeAsIPv6Address()
Order of evaluation within an expression is
undefined behavior.
2018-10-02 12:52:24 -07:00
Michael Davidsaver 93dc0f4f1a drop unused 2018-07-06 11:20:34 -07:00
Michael Davidsaver 59a65ce317 discoverInterfaces() fixup bcast address on win32
Apparently SIO_GET_INTERFACE_LIST sometimes gives
the global broadcast (255.255.255.255) for one of
the interfaces.  In this case silently compute
the iface bcast address.
2018-07-02 18:54:05 -07:00
Michael Davidsaver 7912718664 discoverInterfaces() compat RTEMS 2018-07-02 15:32:10 -07:00
Michael Davidsaver fc037f0a39 drop getBroadcastAddresses()
in favor of discoverInterfaces().

if we have to do NIC discovery ourselves, then at least
avoid mixing our results with the similar, but not identical
results of osiSockDiscoverBroadcastAddresses() from Base.
2018-07-02 14:39:37 -07:00
Michael Davidsaver c5419f9487 revise discoverInterfaces()
change interface to distingush between bcast and point2point.
add netmask to truly distinguish unicast from bcast.
fix some minor (I think) errors in the bsd socks impl (use of clobbered buffer).
cleanup win32 impl. bcast and p2p handling.
2018-07-02 14:39:36 -07:00
Michael Davidsaver 53a63f9a1f inetAddressUtil: save ifr_addr before query of IFFLAGS
Save before later calls clobber the buffer (was corrupting
sin_family).
2018-07-02 14:39:36 -07:00
Michael Davidsaver 3abd77a42c fix IntrospectionRegistry error handling
Calling code can't deal with "cache" miss,
which indicates either a protocol error (use of invalid ID),
or a logic error on our part (didn't save ID).
In either case, better to throw an exception than to crash.
2018-06-22 13:28:49 -07:00
Michael Davidsaver 685490fc1a no NDEBUG
Apparently the Base makefiles never have defined NDEBUG.
So no point for this conditional.
2018-02-14 08:55:01 -08:00
Michael Davidsaver c6b1d3b738 fairQueue: logic error allows perpetual clear()
oops, the argument isn't cleared in all
cases, and can be swapped in.
As in the case of clear().
2018-02-13 17:58:56 -08:00
Michael Davidsaver f1defe4e9f mark NamedLockPattern as deprecated
just too hard to use (exception) safely
2018-02-01 19:00:38 -08:00
Michael Davidsaver 58f996fd98 update transportRegistry
avoid leaks of SOCKET and leaving mutex locked
when exceptions are thrown.
2018-02-01 18:54:25 -08:00
Michael Davidsaver cce7e10ac4 minor 2018-01-31 11:51:13 -08:00
Michael Davidsaver 903d117485 pvAccessLog() add EPICS_PRINTF_STYLE()
and fixup incorrect specifiers
2017-12-28 10:49:54 -06:00
Michael Davidsaver 0161799c93 must zero osiSockAddr prior to use!
RTEMS depends on this or eg. bind()
will fail because comparison with
list of interface addresses is done
with memcmp()!
2017-11-28 17:54:25 -06:00
Michael Davidsaver 5137b90f56 minor client message handling
avoid unnecessary dynamic_cast
2017-09-06 13:49:24 -05:00
Michael Davidsaver 90e8276758 fixup point to point interface handling.
with bcast interfaces, send searches to bcast address
and !WIN32 binds bcast address to receive searches.

with point to point, send searches to dest address.
can't bind dest address (not local).

quiets spurious error message:

> Error binding socket: Cannot assign requested address.

Encountered with a P2P link setup by openvpn.
2017-09-06 10:38:20 -05:00
Michael Davidsaver e8adc57897 getBroadcastAddresses oops 2017-09-02 10:22:08 -05:00
Michael Davidsaver 27ec187bd4 inetAddressUtil no more new vector
no more allocating vector.
2017-09-02 09:55:15 -05:00
Michael Davidsaver 0f8865e1ea pv/inetAddressUtil.h no longer public 2017-09-02 09:55:15 -05:00