summaryrefslogtreecommitdiff
path: root/src/nm-act-request.c
Commit message (Collapse)AuthorAgeFilesLines
* all: SPDX header conversionLubomir Rintel2019-09-101-14/+1
| | | | | $ find * -type f |xargs perl contrib/scripts/spdx.pl $ git rm contrib/scripts/spdx.pl
* 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: drop unnecessary includes of <errno.h> and <string.h>Thomas Haller2019-02-121-1/+0
| | | | | "nm-macros-interal.h" already includes <errno.h> and <string.h>. No need to include it everywhere else too.
* core: pass hints as strv to nm_act_request_get_secrets()Thomas Haller2019-02-051-2/+1
| | | | | Extend nm_act_request_get_secrets() API to allow for the underlying flexibility (of the API that it calls) to accept a strv list of hints.
* core: improve and fix keeping connection active based on ↵Thomas Haller2018-12-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "connection.permissions" By setting "connection.permissions", a profile is restricted to a particular user. That means for example, that another user cannot see, modify, delete, activate or deactivate the profile. It also means, that the profile will only autoconnect when the user is logged in (has a session). Note that root is always able to activate the profile. Likewise, the user is also allowed to manually activate the own profile, even if no session currently exists (which can easily happen with `sudo`). When the user logs out (the session goes away), we want do disconnect the profile, however there are conflicting goals here: 1) if the profile was activate by root user, then logging out the user should not disconnect the profile. The patch fixes that by not binding the activation to the connection, if the activation is done by the root user. 2) if the profile was activated by the owner when it had no session, then it should stay alive until the user logs in (once) and logs out again. This is already handled by the previous commit. Yes, this point is odd. If you first do $ sudo -u $OTHER_USER nmcli connection up $PROFILE the profile activates despite not having a session. If you then $ ssh guest@localhost nmcli device you'll still see the profile active. However, the moment the SSH session ends, a session closes and the profile disconnects. It's unclear, how to solve that any better. I think, a user who cares about this, should not activate the profile without having a session in the first place. There are quite some special cases, in particular with internal activations. In those cases we need to decide whether to bind the activation to the profile's visibility. Also, expose the "bind" setting in the D-Bus API. Note, that in the future this flag may be modified via D-Bus API. Like we may also add related API that allows to tweak the lifetime of the activation. Also, I think we broke handling of connection visiblity with 37e8c53eeed "core: Introduce helper class to track connection keep alive". This should be fixed now too, with improved behavior. Fixes: 37e8c53eeed579fe34a68819cd12f3295d581394 https://bugzilla.redhat.com/show_bug.cgi?id=1530977
* all: say Wi-Fi instead of "wifi" or "WiFi"Lubomir Rintel2018-11-291-1/+1
| | | | | | | | Correct the spelling across the *entire* tree, including translations, comments, etc. It's easier that way. Even the places where it's not exposed to the user, such as tests, so that we learn how is it spelled correctly.
* shared: drop duplicate c-list.h headerBeniamino Galvani2018-04-181-1/+1
| | | | Use the one from the project just imported.
* core: don't explicitly set D-Bus path properties to "/"Thomas Haller2018-04-181-1/+1
| | | | | | | | NMDBusObject already gets this right, by calling nm_dbus_utils_get_property(), which calls g_dbus_gvalue_to_gvariant(), which correctly converts NULL object paths to "/". We already rely on that elsewhere. No need for this workaround.
* core: specify an activation reason for active connectionsBeniamino Galvani2018-04-081-1/+4
| | | | | | Specify a reason when creating active connections. The reason will be used in the next commit to tell whether slaves must be reconnected or not if a master has autoconnect-slaves=yes.
* all: get rid of a handful of unused-but-set variablesLubomir Rintel2017-12-181-4/+0
|
* c-list: re-import latest version of c-list.h from upstreamThomas Haller2017-11-281-2/+2
| | | | | | | | | | | | Most notably, it renames c_list_unlink_init() -> c_list_unlink() c_list_unlink() -> c_list_unlink_stale() $ sed -e 's/\<c_list_unlink\>/c_list_unlink_old/g' \ -e 's/\<c_list_unlink_init\>/c_list_unlink/g' \ -e 's/\<c_list_unlink_old\>/c_list_unlink_stale/g' \ $(git grep -l c_list_unlink -- ':(exclude)shared/nm-utils/c-list.h') \ -i
* core: merge IPv4 and IPv6 versions of nm_active_connection_get_default()Thomas Haller2017-11-271-4/+2
|
* core: refactor NMSettingsConnectionCallId typedef not to be a pointer to structThomas Haller2017-11-271-3/+3
| | | | | Typedefs to structs are fine, but a typedef for a pointer seems confusing to me. Let's avoid it.
* core: use CList to track NMActRequestGetSecretsCallId in NMActRequestth/call-id-cleanupThomas Haller2017-11-241-25/+24
| | | | | Gives O(1) insert and remove. Also saves the overhead of the GSlice allocation for the GSList node.
* core/trivial: unify names of internal NMActRequestGetSecretsCallId as "call_id"Thomas Haller2017-11-241-35/+35
|
* core: drop internal typedef GetSecretsInfo for NMSecretAgentCallIdThomas Haller2017-11-241-10/+8
| | | | Using an internal alias for the type is just confusing. Drop it.
* core: refactor NMActRequestGetSecretsCallId typedef not to be a pointer to ↵Thomas Haller2017-11-241-2/+2
| | | | | | | struct Typedefs to structs are fine, but a typedef for a pointer seems confusing to me. Let's avoid it.
* active-connection: emit a StateChanged signal on state changesLubomir Rintel2017-03-171-2/+6
| | | | | | | | It includes a reason code that makes it possible for the clients to be more reasonable about error messages. The reason code is essentially copied from the VPN, plus three more reasons that were useful for non-VPN connections.
* core: add activation-type property to active-connectionThomas Haller2017-03-161-0/+3
| | | | | It is still unused, but will be useful to mark a connection whether it is a full activation or assumed.
* act-request: return empty properties when not activatedBeniamino Galvani2017-01-191-11/+19
| | | | | | | | | | We start to track changes to the device's properties only after the active connection gets activated. It's wrong to return properties while we don't track their changes as this causes stale objects references on D-Bus. Let's return DHCP and IP configurations from the device only when the connection is activated. (cherry picked from commit 4215c2640a6a24360fc0bfc59f45c6af3132ebb4)
* act-request: allow omitting the @self argument in ↵Thomas Haller2016-12-201-4/+29
| | | | | | | | | | | | | | | | | | | nm_act_request_cancel_secrets() Previously, we would require a @self argument and the @call_id in nm_act_request_cancel_secrets(), although the @call_id already has a pointer to @self. In principle that is not necessary, but it makes the API a bit more robust as you need to care about the lifetime of the @req as well. However it is a bit inconvenient, because it requires that caller to track both the activation request and the call-id. Now, allow nm_act_request_get_secrets() to instruct the call-id to take an additional reference to @self. Later on, we would allow to omit the argument during cancelling. We only allow this, if the call-id takes a reference to @self.
* act-request: use NULL return value instead of "0"Thomas Haller2016-12-201-1/+1
|
* build: don't add subdirectories to include search path but require qualified ↵Thomas Haller2016-11-211-2/+2
| | | | | | | | | | | | | | | 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.
* core: rename "nm-activation-request.[hc]" for NMActRequestThomas Haller2016-10-031-0/+581
"nm-activation-request.[hc]" contains NMActRequest. It should thus be called "nm-act-request.[hc]".