From patchwork Tue May 21 13:21:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reza Alizadeh Majd X-Patchwork-Id: 14044 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id BBCBA17036; Tue, 21 May 2019 14:22:08 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 2323317034 for ; Tue, 21 May 2019 14:22:08 +0100 (BST) Received: from localhost ([127.0.0.1]:53777 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT4iV-0004HD-Km for patchwork@mira.cbaines.net; Tue, 21 May 2019 09:22:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT4iR-0004EI-Vf for guix-patches@gnu.org; Tue, 21 May 2019 09:22:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hT4iR-0001EX-05 for guix-patches@gnu.org; Tue, 21 May 2019 09:22:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53681) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hT4iQ-0001EF-TR for guix-patches@gnu.org; Tue, 21 May 2019 09:22:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hT4iQ-0003BX-PF for guix-patches@gnu.org; Tue, 21 May 2019 09:22:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#35845] [PATCH 1/2] services: sddm: fix root login failure issue. Resent-From: Reza Alizadeh Majd Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 21 May 2019 13:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35845 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35845@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.155844489112167 (code B ref -1); Tue, 21 May 2019 13:22:02 +0000 Received: (at submit) by debbugs.gnu.org; 21 May 2019 13:21:31 +0000 Received: from localhost ([127.0.0.1]:38985 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hT4hv-0003AB-8p for submit@debbugs.gnu.org; Tue, 21 May 2019 09:21:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41794) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hT4hr-00039g-Ji for submit@debbugs.gnu.org; Tue, 21 May 2019 09:21:27 -0400 Received: from lists.gnu.org ([209.51.188.17]:55005) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hT4hl-00006b-8b for submit@debbugs.gnu.org; Tue, 21 May 2019 09:21:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT4hk-0003iw-6L for guix-patches@gnu.org; Tue, 21 May 2019 09:21:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hT4hi-0008U3-QA for guix-patches@gnu.org; Tue, 21 May 2019 09:21:20 -0400 Received: from [5.230.148.152] (port=60986 helo=Rezas-MacBook-Pro-2.local) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT4hh-0008NV-He for guix-patches@gnu.org; Tue, 21 May 2019 09:21:17 -0400 Received: by Rezas-MacBook-Pro-2.local (Postfix, from userid 501) id D2594101B313B8; Tue, 21 May 2019 17:51:12 +0430 (+0430) From: Reza Alizadeh Majd Date: Tue, 21 May 2019 17:51:09 +0430 Message-Id: <20190521132110.85299-1-r.majd@pantherx.org> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Mac OS X [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Reza Alizadeh Majd Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/services/sddm.scm (sdm-pam-service): set uid from config. (sdm-autologin-pam-service): set uid from config. (sdm-pam-services): pass sddm-configuration to sddm-pam-service and sddm-autologin-pam-service --- gnu/services/sddm.scm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/gnu/services/sddm.scm b/gnu/services/sddm.scm index b433c59e12..b0e6d40260 100644 --- a/gnu/services/sddm.scm +++ b/gnu/services/sddm.scm @@ -175,7 +175,7 @@ Relogin=" (if (sddm-configuration-relogin? config) (define (sddm-etc-service config) (list `("sddm.conf" ,(sddm-configuration-file config)))) -(define (sddm-pam-service) +(define (sddm-pam-service config) "Return a PAM service for @command{sddm}." (pam-service (name "sddm") @@ -190,7 +190,9 @@ Relogin=" (if (sddm-configuration-relogin? config) (pam-entry (control "required") (module "pam_succeed_if.so") - (arguments (list "uid >= 1000" "quiet"))) + (arguments (list (string-append "uid >= " + (number->string (sddm-configuration-minimum-uid config))) + "quiet"))) ;; should be factored out into system-auth (pam-entry (control "required") @@ -249,7 +251,7 @@ Relogin=" (if (sddm-configuration-relogin? config) (control "required") (module "pam_unix.so")))))) -(define (sddm-autologin-pam-service) +(define (sddm-autologin-pam-service config) "Return a PAM service for @command{sddm-autologin}" (pam-service (name "sddm-autologin") @@ -261,7 +263,9 @@ Relogin=" (if (sddm-configuration-relogin? config) (pam-entry (control "required") (module "pam_succeed_if.so") - (arguments (list "uid >= 1000" "quiet"))) + (arguments (list (string-append "uid >= " + (number->string (sddm-configuration-minimum-uid config))) + "quiet"))) (pam-entry (control "required") (module "pam_permit.so")))) @@ -282,9 +286,9 @@ Relogin=" (if (sddm-configuration-relogin? config) (module "sddm")))))) (define (sddm-pam-services config) - (list (sddm-pam-service) + (list (sddm-pam-service config) (sddm-greeter-pam-service) - (sddm-autologin-pam-service))) + (sddm-autologin-pam-service config))) (define %sddm-accounts (list (user-group (name "sddm") (system? #t))