summaryrefslogtreecommitdiff
path: root/src/nm-audit-manager.c
Commit message (Collapse)AuthorAgeFilesLines
* settings: add audit-logging for connection load and reloadThomas Haller2019-07-161-6/+19
|
* all: drop emacs file variables from source filesThomas Haller2019-06-111-1/+0
| | | | | | | | | | | | | | | | | | | | | | We no longer add these. If you use Emacs, configure it yourself. Also, due to our "smart-tab" usage the editor anyway does a subpar job handling our tabs. However, on the upside every user can choose whatever tab-width he/she prefers. If "smart-tabs" are used properly (like we do), every tab-width will work. No manual changes, just ran commands: F=($(git grep -l -e '-\*-')) sed '1 { /\/\* *-\*- *[mM]ode.*\*\/$/d }' -i "${F[@]}" sed '1,4 { /^\(#\|--\|dnl\) *-\*- [mM]ode/d }' -i "${F[@]}" Check remaining lines with: git grep -e '-\*-' The ultimate purpose of this is to cleanup our files and eventually use SPDX license identifiers. For that, first get rid of the boilerplate lines.
* all: replace strerror() calls with nm_strerror_native()Thomas Haller2019-02-121-1/+1
|
* all: cache errno in local variable before using itThomas Haller2019-02-121-3/+5
|
* all: drop unnecessary includes of <errno.h> and <string.h>Thomas Haller2019-02-121-2/+0
| | | | | "nm-macros-interal.h" already includes <errno.h> and <string.h>. No need to include it everywhere else too.
* config: use macros for config keysBeniamino Galvani2018-12-011-1/+1
| | | | Every configuration option should be listed in the header file.
* all: remove consecutive empty linesBeniamino Galvani2018-04-301-1/+0
| | | | | | | Normalize coding style by removing consecutive empty lines from C sources and headers. https://github.com/NetworkManager/NetworkManager/pull/108
* all: don't use NM_FLAGS_HAS() with non-constant argumentThomas Haller2017-12-151-1/+1
| | | | | | | | | | | NM_FLAGS_HAS() uses a static-assert that the second argument is a single flag (power of two). With a single flag, NM_FLAGS_HAS(), NM_FLAGS_ANY() and NM_FLAGS_ALL() are all identical. The second argument must be a compile time constant, and if that is not the case, one must not use NM_FLAGS_HAS(). Use NM_FLAGS_ANY() in these cases.
* logging: log device and connection along with the messageLubomir Rintel2017-03-241-1/+1
|
* audit: add @args to device logging functionsBeniamino Galvani2017-03-061-2/+7
|
* build: don't add subdirectories to include search path but require qualified ↵Thomas Haller2016-11-211-1/+1
| | | | | | | | | | | | | | | include Keep the include paths clean and separate. We use directories to group source files together. That makes sense (I guess), but then we should use this grouping also when including files. Thus require to #include files with their path relative to "src/". Also, we build various artifacts from the "src/" tree. Instead of having individual CFLAGS for each artifact in Makefile.am, the CFLAGS should be unified. Previously, the CFLAGS for each artifact differ and are inconsistent in which paths they add to the search path. Fix the inconsistency by just don't add the paths at all.
* config: print default value for logging.auditThomas Haller2016-10-111-1/+1
|
* core: refactor private data in "src"Thomas Haller2016-10-041-26/+41
| | | | | | | | | | | | | | | | - use _NM_GET_PRIVATE() and _NM_GET_PRIVATE_PTR() everywhere. - reorder statements, to have GObject related functions (init, dispose, constructed) at the bottom of each file and in a consistent order w.r.t. each other. - unify whitespaces in signal and properties declarations. - use NM_GOBJECT_PROPERTIES_DEFINE() and _notify() - drop unused signal slots in class structures - drop unused header files for device factories
* checkpoint: add audit supportBeniamino Galvani2016-08-171-1/+1
|
* audit: log changed properties when updating a connectionBeniamino Galvani2016-04-201-2/+7
| | | | | | | | | | | | | | The main purpose of audit logging is to understand who did what to the system configuration, so it is useful to log also the list of changed properties when a connection is updated: op="connection-update" uuid="2f3e48fc-5f47-41d9-9278-d2871378df43" name="pppoe1" args="pppoe.username,pppoe.password" <======== pid=9523 uid=1001 result="success"
* audit: use logging helpersBeniamino Galvani2016-03-041-7/+15
|
* all: cleanup includes and let "nm-default.h" include "config.h"Thomas Haller2016-02-191-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - All internal source files (except "examples", which are not internal) should include "config.h" first. As also all internal source files should include "nm-default.h", let "config.h" be included by "nm-default.h" and include "nm-default.h" as first in every source file. We already wanted to include "nm-default.h" before other headers because it might contains some fixes (like "nm-glib.h" compatibility) that is required first. - After including "nm-default.h", we optinally allow for including the corresponding header file for the source file at hand. The idea is to ensure that each header file is self contained. - Don't include "config.h" or "nm-default.h" in any header file (except "nm-sd-adapt.h"). Public headers anyway must not include these headers, and internal headers are never included after "nm-default.h", as of the first previous point. - Include all internal headers with quotes instead of angle brackets. In practice it doesn't matter, because in our public headers we must include other headers with angle brackets. As we use our public headers also to compile our interal source files, effectively the result must be the same. Still do it for consistency. - Except for <config.h> itself. Include it with angle brackets as suggested by https://www.gnu.org/software/autoconf/manual/autoconf.html#Configuration-Headers
* build: cleanup default includesThomas Haller2016-02-121-5/+3
| | | | | | | | | | | | | | | | | | | - "gsystem-local-alloc.h" and <gio/gio.h> are already included via "nm-default.h". No need to include them separately. - include "nm-macros-internal.h" via "nm-default.h" and drop all explict includes. - in the modified files, ensure that we always include "config.h" and "nm-default.h" first. As second, include the header file for the current source file (if applicable). Then follow external includes and finally internal nm includes. - include nm headers inside source code files with quotes - internal header files don't need to include default headers. They can savely assume that "nm-default.h" is already included and with it glib, nm-glib.h, nm-macros-internal.h, etc.
* audit: allow passing GDBusMethodInvocation context to audit methodsThomas Haller2016-01-101-7/+19
|
* core: separate active and applied connectionLubomir Rintel2015-09-181-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clone the connection upon activation. This makes it safe for the user to modify the original connection while it is activated. This involves several changes: - NMActiveConnection gets @settings_connection and @applied_connection. To support add-and-activate, we constructing a NMActiveConnection with no connection set. Previously, we would set the "connection" field to a temporary NMConnection. Now NMManager piggybacks this temporary connection as object-data (TAG_ACTIVE_CONNETION_ADD_AND_ACTIVATE). - get rid of the functions nm_active_connection_get_connection_type() and nm_active_connection_get_connection_uuid(). From their names it is unclear whether this returns the settings or applied connection. The (few) callers should figure that out themselves. - rename nm_active_connection_get_id() to nm_active_connection_get_settings_connection_id(). This function is only used internally for logging. - dispatcher calls now get two connections as well. The applied-connection is used for the connection data, while the settings-connection is used for the connection path. - needs special handling for properties that apply immediately when changed (nm_device_reapply_settings_immediately()). Co-Authored-By: Thomas Haller <thaller@redhat.com> https://bugzilla.gnome.org/show_bug.cgi?id=724041
* audit-manager: don't log connection whose addition failsLubomir Rintel2015-09-181-1/+0
| | | | | In AddAndActivate the uuid and id make no sense until authorization succeeds and the connection is saved.
* core: fix runtime warning when building without libauditDan Winship2015-08-071-3/+8
| | | | | | | | If !HAVE_LIBAUDIT then sizeof(NMAuditManagerPrivate) was 0, which upset g_type_class_add_private(). (It's also not valid C.) Fix things up so that NMAuditManagerPrivate as a whole only exists if HAVE_LIBAUDIT.
* audit-manager: enable logging.audit by default when libaudit support is ↵Thomas Haller2015-08-041-1/+2
| | | | | | | | | | | | | | | | | available Previously, when compiling NetworkManager with libaudit support, it was disabled by default and only used after setting logging.audit=true. Turn that around. If we compile NetworkManager with audit support, we also enable it by default. The user can then explicitly disable it by configuring logging.audit in NetworkManager.conf. But also, add a configure option 'yes-disabled-by-default' to compile with audit support, but have it disabled by default. This would be the previous behavior, but it must be enabled explicitly. Fixes: be49a59fb649d7383b456403deb323a2eb9dab4b
* core: add audit supportBeniamino Galvani2015-08-041-0/+371
Introduce some primitives to deliver messages about relevant configuration changes to the Linux audit subsystem through libaudit (if enabled at build time) and to the logging system.