From 969056d0e1de27ab99946632849b6f965e51f753 Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Tue, 13 Mar 2018 19:14:05 +0100 Subject: Prep v236 : Add missing SPDX-License-Identifier (5/9) src/login --- src/login/logind-action.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/login/logind-action.h') diff --git a/src/login/logind-action.h b/src/login/logind-action.h index fb40ae48d..8c31ec42b 100644 --- a/src/login/logind-action.h +++ b/src/login/logind-action.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ #pragma once /*** -- cgit v1.2.3 From f536abd4560d2f871698bb4d27566c66cfe110ef Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Wed, 28 Mar 2018 11:00:06 -0500 Subject: Rename suspend-to-hibernate to suspend-then-hibernate Per some discussion with Gnome folks, they would prefer this name as it's more descriptive of what's happening. --- src/login/logind-action.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/login/logind-action.h') diff --git a/src/login/logind-action.h b/src/login/logind-action.h index 8c31ec42b..9f5dee684 100644 --- a/src/login/logind-action.h +++ b/src/login/logind-action.h @@ -29,6 +29,7 @@ typedef enum HandleAction { HANDLE_SUSPEND, HANDLE_HIBERNATE, HANDLE_HYBRID_SLEEP, + HANDLE_SUSPEND_THEN_HIBERNATE, HANDLE_LOCK, _HANDLE_ACTION_MAX, _HANDLE_ACTION_INVALID = -1 -- cgit v1.2.3 From 9d1ff89d622fd4d8b3be210996cfa73943d81e03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 6 Apr 2018 18:58:55 +0200 Subject: tree-wide: drop license boilerplate Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that. --- src/login/logind-action.h | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'src/login/logind-action.h') diff --git a/src/login/logind-action.h b/src/login/logind-action.h index 9f5dee684..8c7de83e8 100644 --- a/src/login/logind-action.h +++ b/src/login/logind-action.h @@ -5,19 +5,6 @@ This file is part of systemd. Copyright 2012 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . ***/ typedef enum HandleAction { -- cgit v1.2.3 From 797ec1bf0caeea2b72de01f8082bba2d785a20e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 10 Apr 2018 13:15:00 +0200 Subject: logind: refuse operations if the target unit is masked or unavailable If hibernate.target is masked, and systemctl hibernate is invoked, havoc ensues. logind starts the hibernation operation, but then doesn't go through with it; gnome-shell segfaults. Let's be nice to the user and refuse doing anything in that case. $ sudo systemctl mask hibernate.target $ busctl call org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager CanHibernate s "no" $ sudo systemctl hibernate Failed to hibernate system via logind: Access denied Failed to start hibernate.target: Unit hibernate.target is masked. https://bugzilla.redhat.com/show_bug.cgi?id=1468003#c4 --- src/login/logind-action.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/login/logind-action.h') diff --git a/src/login/logind-action.h b/src/login/logind-action.h index 8c7de83e8..4fdbc60e4 100644 --- a/src/login/logind-action.h +++ b/src/login/logind-action.h @@ -5,6 +5,19 @@ This file is part of systemd. Copyright 2012 Lennart Poettering + + elogind is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + elogind is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with elogind; If not, see . ***/ typedef enum HandleAction { @@ -35,4 +48,5 @@ int manager_handle_action( const char* handle_action_to_string(HandleAction h) _const_; HandleAction handle_action_from_string(const char *s) _pure_; +const char* manager_target_for_action(HandleAction handle); int config_parse_handle_action(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); -- cgit v1.2.3 From d2b999bacad0cd2f1dd3bb40532f788b27a11bef Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 22 May 2018 13:10:17 +0200 Subject: tree-wide: port over all code to the new CONFIG_PARSER_PROTOTYPE() macro This makes most header files easier to look at. Also Emacs gets really slow when browsing through large sections of overly long prototypes, which is much improved by this macro. We should probably not do something similar with too many other cases, as macros like this might help readability for some, but make it worse for others. But I think given the complexity of this specific prototype and how often we use it, it's worth doing. --- src/login/logind-action.h | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'src/login/logind-action.h') diff --git a/src/login/logind-action.h b/src/login/logind-action.h index 4fdbc60e4..74b1dc88f 100644 --- a/src/login/logind-action.h +++ b/src/login/logind-action.h @@ -5,21 +5,10 @@ This file is part of systemd. Copyright 2012 Lennart Poettering - - elogind is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - elogind is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with elogind; If not, see . ***/ +//#include "conf-parser.h" + typedef enum HandleAction { HANDLE_IGNORE, HANDLE_POWEROFF, @@ -49,4 +38,5 @@ const char* handle_action_to_string(HandleAction h) _const_; HandleAction handle_action_from_string(const char *s) _pure_; const char* manager_target_for_action(HandleAction handle); -int config_parse_handle_action(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); + +CONFIG_PARSER_PROTOTYPE(config_parse_handle_action); -- cgit v1.2.3 From dd656b3679e4b5a7ec3534bf8786b022327e080d Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 12 Jun 2018 17:04:27 +0200 Subject: tree-wide: drop 'This file is part of systemd' blurb This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit. --- src/login/logind-action.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/login/logind-action.h') diff --git a/src/login/logind-action.h b/src/login/logind-action.h index 74b1dc88f..2d149fc2c 100644 --- a/src/login/logind-action.h +++ b/src/login/logind-action.h @@ -2,8 +2,6 @@ #pragma once /*** - This file is part of systemd. - Copyright 2012 Lennart Poettering ***/ -- cgit v1.2.3 From 3af26cec424c7108d1065754f5583827b9f9c3c5 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 12 Jun 2018 18:23:39 +0200 Subject: tree-wide: remove Lennart's copyright lines These lines are generally out-of-date, incomplete and unnecessary. With SPDX and git repository much more accurate and fine grained information about licensing and authorship is available, hence let's drop the per-file copyright notice. Of course, removing copyright lines of others is problematic, hence this commit only removes my own lines and leaves all others untouched. It might be nicer if sooner or later those could go away too, making git the only and accurate source of authorship information. --- src/login/logind-action.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/login/logind-action.h') diff --git a/src/login/logind-action.h b/src/login/logind-action.h index 2d149fc2c..c1421193b 100644 --- a/src/login/logind-action.h +++ b/src/login/logind-action.h @@ -1,10 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ #pragma once -/*** - Copyright 2012 Lennart Poettering -***/ - //#include "conf-parser.h" typedef enum HandleAction { -- cgit v1.2.3 From 95ddf8036d90ed95e4087b2a3aef3f9dc9561e1b Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Wed, 15 Aug 2018 09:01:47 +0200 Subject: Prep v239: Uncomment header inclusions that are new or needed now. --- src/login/logind-action.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/login/logind-action.h') diff --git a/src/login/logind-action.h b/src/login/logind-action.h index c1421193b..a45aab785 100644 --- a/src/login/logind-action.h +++ b/src/login/logind-action.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ #pragma once -//#include "conf-parser.h" +#include "conf-parser.h" typedef enum HandleAction { HANDLE_IGNORE, -- cgit v1.2.3 From 70140c4f0c80a9e51ed1ea51915ac2a6407d1a2b Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Thu, 23 Aug 2018 08:35:42 +0200 Subject: Prep v239: Fix ustreams move of the unneeded target_table into its own also unneeded function. --- src/login/logind-action.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/login/logind-action.h') diff --git a/src/login/logind-action.h b/src/login/logind-action.h index a45aab785..bc2d36050 100644 --- a/src/login/logind-action.h +++ b/src/login/logind-action.h @@ -31,6 +31,8 @@ int manager_handle_action( const char* handle_action_to_string(HandleAction h) _const_; HandleAction handle_action_from_string(const char *s) _pure_; +#if 0 /// elogind does this itself. No target table required const char* manager_target_for_action(HandleAction handle); +#endif // 0 CONFIG_PARSER_PROTOTYPE(config_parse_handle_action); -- cgit v1.2.3