summaryrefslogtreecommitdiffstats
path: root/lib/privs.c
Commit message (Collapse)AuthorAgeFilesLines
* Tidy up some XMALLOC items that were not being XFREE'd.Chris Hall2012-03-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * bgp_peer_index replace unused bgp_peer_index_reset() by bgp_peer_index_finish() and call same at bgp shut-down. discard unused bgp_peer_index_mutex_free() and replace bgp_peer_index_mutex_init() by bgp_peer_index_init_r(). * lib/command.c and command_parse.c add cmd_parser_finish() to discard store of "words" and arrange to call same in cmd_table_terminate(). * reset vector of files in qps_selection_ream(), so that frees the vector body -- which it should have been doing ! * add mem_mt_show_stderr() for debug (for all the use it may be). * fix qpt_mutex_destroy(), qpt_cond_destroy() and qpt_spin_destroy() so that if fail when !qpthreads_active will log the error (and not crash). Sweeps issues under the carpet, but does not hide same.
* Fix zprivs_init for when have capabilities and *not* --dryrun.Chris Hall2012-02-231-2/+4
|
* Fix: "--more--" and "no ip prefix-list fred"Chris Hall2012-02-221-52/+106
| | | | | | | | | | Also, fix compilation of privs.c when HAVE_CAPABILITIES. Wiping of "--more--" was issuing twice as many BS as required. (Oddly, some telnet programs tollerated this !) "no ip prefix-list fred" could hit a SEGV if there are no references to the prefix-list.
* Do not install "end" command in nodes where it has no effect.Chris Hall2012-02-221-19/+48
| | | | | | | | In particular, do not install in VIEW_NODE, where it prevents "en" being a short form of "enable". Also: change privilege handling so that can run bgpd --dryrun without needing to be a privileged user.
* vtysh partly restored. bgpd not crashing on over-size messages.Chris Hall2012-02-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NB: this is a partial interim version -- NOT for production. Reinstate vtysh. In bgpd: cope better with generating oversize messages. The "pipework" branch is no more. There is now "euro_ix" and "euro_ix_b", where 'b' stands for 'bleedin'. The "pipework" is currently in 'bleedin'. Version updated to: 0.99.18ex20b Major changes in this commit: * modified bgpd to avoid crashing if an oversize message is created. At present, any oversize messages are simply discarded. This may be a mistake... since it is possible that some routes that should have been withdrawn are not. TBA. The stream lib facilities have been overhauled to may this easier. * restoring vtysh. At present the vtysh is thought to work, except that it does not currently create integrated configuration files. For the time being, *only* the following compile: lib, bgpd, zebra, vtysh, tests All other daemons will fail to compile, and must be disabled.
* Bring "ex" version up to date with 0.99.18ex15pChris Hall2011-03-291-1/+0
| | | | | | | | | Release: 0.99.18ex15p -- Pipework Branch Also fixes issue with unknown attributes -- does not release them prematurely. Contains the "bgpd: New show commands for improved view and address family support", which is post 0.99.18. (But not RFC 5082 GTSM.)
* Upgrade of "pipework" -- including piping to/from shell commandsex11pChris Hall2011-03-211-31/+41
| | | | | | Version 0.99.15ex11p A major overhaul.
* New functions for error numbers and addresses in messages.Chris Hall2010-04-081-99/+99
| | | | | | | | Implemented less onerous ways of including descriptions of errors and IP addresses in logging and other messages. Implemented mapping of error numbers to error names, which is generally more meaningful.
* Use static mutexespaulo2009-12-171-35/+36
|
* Fix shutdown. Move cpu stats command to cli thread.paulo2009-12-171-2/+3
|
* vty running in main thread. bgp running in its own thread.paulo2009-12-111-2/+1
| | | | Each has its own nexus.
* Added zlog_abort functions. Changed pthread mutes to qpthread mutexespaulo2009-12-031-46/+48
|
* Fix nested LOCK bugpaulo2009-12-011-1/+5
|
* Fix raise_count in zprivs_change_caps HAVE_LCAPS casepaulo2009-12-011-9/+18
|
* Make logging (lib.c) and privileges (privs.c) pthread safepaulo2009-11-301-43/+143
| | | | | | | | | | | lib.c: use a mutex to protect all public methods. Replaced code in command.c etc that modified zlog_default directly with interlocked getters and setters. Requires that vty_log in vty.c handles its own pthread safety TBA. privs.c: use a mutex to protect all public methods. Counts RAISE and LOWER so that privilege stays RAISED until all pthreads have lowered. Improved messages in test-privs.c
* [privs/Solaris] Quagga should work in zones with IP instancesPaul Jakma2007-09-181-0/+5
| | | | | | | | | 2007-09-18 Paul Jakma <paul.jakma@sun.com> * privs.c: definition of ZCAP_NET_ADMIN on Solaris should be PRIV_SYS_IP_CONFIG, when that's available. Thus allowing Quagga to work with in Solaris zones with exclusive IP instances.
* [lib/privs] Changing user IDs should be done before dropping privilegesPaul Jakma2006-03-301-18/+20
| | | | | | | | | 2006-03-14 Paul Jakma <paul.jakma@sun.com> * privs.c: (zprivs_caps_init) Change user IDs before lowering privileges, while this seems to work on Linux, on Solaris it rightfully refuses due to PRIV_PROC_SETID having been dropped.
* [privs/solaris] Fix unused variable and incorrect format string.paul2005-11-241-3/+3
| | | | | | | | 2005-11-24 Paul Jakma <paul.jakma@sun.com> * privs.c: (zcaps2sys/solaris) remove unused variable. (zprivs_state_caps/solaris) Format string missing a specifier.
* 2005-09-29 Paul Jakma <paul.jakma@sun.com>paul2005-09-291-140/+478
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac: Add the test for Solaris least-privileges. Set defines for whether capabilities are supported and whether of the linux or solaris variety. Add missing-prototypes, missing-declarations, char-subscripts and cast-qual warnings to default cflags, cause Hasso enjoys warnings, and we really should clean the remaining ones up. (ie isisd..). * (*/*main.c) Update the zebra_capabilities_t arrays in the various daemons to match the changes made in lib/privs.h. * zebra.h: Solaris capabilities requires priv.h to be included. * privs.{c,h}: Add support for Solaris Least-Privileges. privs.h: Reduce some of the abstract capabilities, which do not have rough equivalents on both systems. Rename the net related caps to _NET, as they should have been in first place. (zprivs_terminate) should take the zebra_privs_t as argument so that it can update change pointer. Add an additional privilege state, ZPRIVS_UNKNOWN. * privs.c: (various capability functions) Add Solaris privileges variants. (zprivs_state) Use privs.c specific generic types to represent various capability/privilege related types, so that each can be typedef'd as appropriate on each platform. (zprivs_null_state) static added, to hold the state the null method should report (should be raised by default, and LOWERED if zprivs_terminate has been called) (zprivs_state_null) Report back the zprivs_null_state. (cap_map) Make it able to map abstract capability to multiple system capabilities. (zcaps2sys) Map to abstract capabilities to multiple system privileges/capabilities. (zprivs_init) move capability related init to seperate function, zprivs_caps_init. (zprivs_terminate) ditto, moved to zprivs_caps_terminate. Set the change_state callback to the NULL state, so the user can continue to run and use the callbacks.
* 2004-11-19 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs2004-11-201-10/+10
| | | | | * global: Replace strerror with safe_strerror. And vtysh/vtysh.c needs to include "log.h" to pick up the declaration.
* 2003-06-11 Paul Jakma <paul@dishone.st>paul2003-06-111-14/+21
| | | | | | * lib/privs.h (zprivs_init): do not use zlog() as it depends on vty having been initialised (zlog calls vty_log). print to stderr directly instead.
* Paul forgot probably to commit privs.[c|h] changes. Had to reorder includeshasso2003-06-041-39/+68
| | | | in zebra.h to make it compile in debian.
* Add additional system capabilitiespaul2003-05-221-1/+5
|
* Fix stray comment and using pwentry for group info.paul2003-05-201-5/+5
|
* Fix several small caps related errors.paul2003-05-201-15/+16
|
* Privilege support files for zebra.paul2003-05-201-0/+351
Linux capabilities enabled (if libcap is enabled).