From patchwork Sun Feb 17 22:59:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 221103 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id EB0D82C007A for ; Mon, 18 Feb 2013 09:59:58 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 3D766A00AF; Sun, 17 Feb 2013 22:59:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Urbx-LxXWwbo; Sun, 17 Feb 2013 22:59:54 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id D83DBA0060; Sun, 17 Feb 2013 22:59:53 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 125A28F753 for ; Sun, 17 Feb 2013 22:59:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D7A93828D0 for ; Sun, 17 Feb 2013 22:59:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 65aQ38fyak2w for ; Sun, 17 Feb 2013 22:59:49 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com [74.125.82.51]) by whitealder.osuosl.org (Postfix) with ESMTPS id 480218BDC6 for ; Sun, 17 Feb 2013 22:59:49 +0000 (UTC) Received: by mail-wg0-f51.google.com with SMTP id 8so4061770wgl.18 for ; Sun, 17 Feb 2013 14:59:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer; bh=c0h4rr5HE6+5DLzJr+1MGNxIITbpmwfs/3MB5IjxDII=; b=fbFbdtMlCi5KF4U2y0VlbmNDw6XuidDQJNslSR86ok7Pdf4wmGIH9h5IVpdCqpJ42h 8+/4Ok+cG/pzsidQPduFSn/4wIGrDbAlmvs6zMRVHHKYqK377ZiLVm2tl/o0/gOOcKc5 btZkxfU+HGKegeVAfq8PpTm1z2Y6+e8Cm8AQbv4eWFMq8reAGgdSiB7EyJnMxjG+ahv5 MJXA39hI+iNNwlA0isK9UujJuoe2ojlsg1ECYNmmjtKeURf+5bK7a5Ypwz68CBShv/+b UnadO4ZQL9ILxPN/aR4G5uLzd3uSAMTAn7OsQDa9bOvZgEn9+joxOS+km9FyWtdsGUdg D+hQ== X-Received: by 10.194.119.68 with SMTP id ks4mr15355213wjb.3.1361141987258; Sun, 17 Feb 2013 14:59:47 -0800 (PST) Received: from localhost.localdomain (ARennes-256-1-67-109.w90-32.abo.wanadoo.fr. [90.32.146.109]) by mx.google.com with ESMTPS id du2sm17012679wib.0.2013.02.17.14.59.45 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 17 Feb 2013 14:59:46 -0800 (PST) From: "Yann E. MORIN" To: buildroot@busybox.net Date: Sun, 17 Feb 2013 23:59:36 +0100 Message-Id: X-Mailer: git-send-email 1.7.2.5 Cc: "Yann E. MORIN" Subject: [Buildroot] [pull request v7 'next'] Pull request for branch yem-package-create-user X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Hello All! Here is a series that allows packages to create users. Packages that install daemons may well want to run those daemons as non-root users to avoid security issues. Currently, there are two users of choice to run 'generic' daemons: root or daemon (although there are a few dedicated users to run a few services: mail, sshd, ftp...). This series builds upon both the package infrastrucutre to define the user(s) a package may want to create, and the filesystem infrastructure to actually generate these users, and chown their ${HOME}s. Documentation is updated accordingly. As a proof of concept, the package tvheadend has been updated to use a dedicated user to run its daemon as (call me stubborn! ;-] ). Changes v6 -> v7: - rebased onto the 'next' branch for Peter Changes v5 -> v6: (All after suggestions by Arnout) - clean up awk invocations - ensure users with an explicit uid are created before users with a computed uid - ditto for groups/gid - cleanup group-addign function - fix password encoding method - cleanup /etc/shadow fields - fix typos Changes v4 -> v5: - rebased ontop master after Developer's Day comments and upstreaming Changes v3 -> v4: - use the configured password encryption scheme - some tweaks and typo-fixes to the documentation Changes v2 -> v3: - clarify password prefixes (Samuel) - move makeuser syntax doc to its own file (Samuel) - use awk instead of sed to parse /etc/passwd et al. (Cam, Thomas) - sanitise use of grep (Cam) - enhancements and fixes to makuser syntax doc (Cam) Changes v1 -> v2: - drop the gshadow patch (Thomas, Peter) - tvheadend user is now part of the video secondary group The following changes since commit 4bf3c452a507d4997f869875e4fd412a3af1a5cd: Kickoff 2013.05 cycle (2013-02-10 13:49:23 +0100) are available in the git repository at: git://gitorious.org/buildroot/buildroot.git yem-package-create-user Yann E. MORIN (2): packages: add ability for packages to create users package/tvheadend: use a non-root user to run the daemon docs/manual/adding-packages-generic.txt | 16 +- docs/manual/appendix.txt | 1 + docs/manual/makeusers-syntax.txt | 87 +++++++ fs/common.mk | 3 + package/pkg-generic.mk | 1 + package/tvheadend/etc.default.tvheadend | 5 +- package/tvheadend/tvheadend.mk | 10 +- support/scripts/mkusers | 409 +++++++++++++++++++++++++++++++ 8 files changed, 525 insertions(+), 7 deletions(-) create mode 100644 docs/manual/makeusers-syntax.txt create mode 100755 support/scripts/mkusers Regards, Yann E. MORIN