Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8843EC2BB55 for ; Thu, 9 Apr 2020 13:49:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5BA9620B1F for ; Thu, 9 Apr 2020 13:49:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ieee.org header.i=@ieee.org header.b="WvQNmqJN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726950AbgDINtS (ORCPT ); Thu, 9 Apr 2020 09:49:18 -0400 Received: from mail-qk1-f177.google.com ([209.85.222.177]:42716 "EHLO mail-qk1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726641AbgDINtS (ORCPT ); Thu, 9 Apr 2020 09:49:18 -0400 Received: by mail-qk1-f177.google.com with SMTP id x66so3923208qkd.9 for ; Thu, 09 Apr 2020 06:49:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=xpzro6WIbts+/TGlysnKNwJjKBBsc3PjhyxC2MFC8j8=; b=WvQNmqJN7X0rdSNyKQfe0ych49Q/go0laM9OEJkJ1dXg3oB89wJ4wZJGcrHWa8EHox Sxm1M7YJN10PtLCHXz5w1+9HarHkQvnEkSIkWXDt8s1LHjG6Xxp32PfMkZWyE0ShY1ae T10+YQiKs2GKpwNf/FciWIEympFvvJ/qtQatc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=xpzro6WIbts+/TGlysnKNwJjKBBsc3PjhyxC2MFC8j8=; b=iMGYFuZ7zT50u85iXBS8tCztUbvU+hxJtvfT8iTCKiBZuJh6zuJf7ZfErHZeBItZ3X 0z8aK3/emfbXTQ/ZKwkNgLoDWbn9h1AJOIPVuL7sOMMbcl2CXQYwECGnOdbBYDVYuF3Z w2DIIF+X5bGhJgvvJ4OMKgBTTa360s8YVuNYc8J5PV1vtSDv5km1uCakemWeIUFt/SPM aoTrDUrYGVc3WI0I8u0+B5DMoTF/wkeRsNQcNSzKRTKdWPnLaS1rDyrNr9xjnaP4NkoC fyBFeR/m5UISwBWXbIbPc/qLNO9t0BTRJmWA4SJANaJCFaCNEXFEqfNfbsQs5FXNLCgF +V+w== X-Gm-Message-State: AGi0PuaP8MPeQVjUn8Q+OfTPr6c52mavXdGBG2nYy6WjisfsgzblivzB W4KmbOlybMk1E6y37r18JCGFJBLQ0hg= X-Google-Smtp-Source: APiQypL4MSNy22Bt3VidWESDCOeyp3+OAlEXZ2SjTWeSTM7ctea8V3XlMMiuVuiJUeecasdws5EUEQ== X-Received: by 2002:a37:b002:: with SMTP id z2mr12607877qke.289.1586440157202; Thu, 09 Apr 2020 06:49:17 -0700 (PDT) Received: from fedora.pebenito.net (pool-108-15-23-247.bltmmd.fios.verizon.net. [108.15.23.247]) by smtp.gmail.com with ESMTPSA id t15sm7469889qtc.64.2020.04.09.06.49.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Apr 2020 06:49:16 -0700 (PDT) Subject: Re: systemd_user_runtime_dir_t To: Russell Coker , Topi Miettinen Cc: selinux-refpolicy@vger.kernel.org References: <2379388.043O1XupSG@liv> <3285433.FrU4F1G8SV@liv> From: Chris PeBenito Message-ID: <01acc6a9-8c66-2c64-bfe2-3b44274c366e@ieee.org> Date: Thu, 9 Apr 2020 09:47:54 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <3285433.FrU4F1G8SV@liv> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org On 4/8/20 2:48 AM, Russell Coker wrote: > On Wednesday, 8 April 2020 4:43:32 PM AEST Topi Miettinen wrote: >> On 8.4.2020 5.19, Russell Coker wrote: >>> What kind of name is that? It's a poor choice of name by systemd upstream >>> and I don't think we are obliged to copy that bad idea. >> >> The name is related to environment variable XDG_USER_RUNTIME_DIR, which >> is not systemd specific construct: > > That's a fine name for an environment variable, clearly indicating that it > points to a directory. > > It's a poor name for a domain, making a casual observer think it's a type for > a directory not a domain for a process. > >> https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html >> >> So if the name should change, xdg_user_runtime_dir_t might be more >> accurate. > > It would be more accurate to have a name that reflects the function of managing > the directory in question. > >> On the other hand, the current name reflects that it's >> specifically the service supplied by systemd called >> "runtime-user-dir@.service" which provides the directory. If the >> provider would be something other (/etc/init.d/elogind-mkuserdir), it >> could be equally accurate to label the directory with something else. > > If the provider changed to a different process (theoretically we are supposed > to be able to swap out parts of systemd for equivalents) then it should have > the same domain name. > >> Though if the result (temporary directory owned by the user) is no >> different in either case from the point of view of SELinux policy, why >> change? > > SE Linux is difficult enough to understand without making things needlessly > confusing. You're right. I wasn't pleased when I came across it. However, the way I see it, the direction you suggest is confusing in a different way, since it doesn't obviously align with the systemd command name. I see it as being between a rock and a hard place, so I'm inclined to keep it as-is. This isn't a domain that is going to show up all over the place, it is a microscopic niche of the byzantine set of processes under the systemd umbrella. -- Chris PeBenito