From patchwork Fri Apr 12 17:14:19 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: 236165 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 4F21F2C00B0 for ; Sat, 13 Apr 2013 03:14:46 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 18A6A31B9A; Fri, 12 Apr 2013 17:14:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rxRYUJGuptDt; Fri, 12 Apr 2013 17:14:38 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 6D03531B5E; Fri, 12 Apr 2013 17:14:35 +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 5DC278F753 for ; Fri, 12 Apr 2013 17:14:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D9A598F7CA for ; Fri, 12 Apr 2013 17:14:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R52nZR3zX1Hk for ; Fri, 12 Apr 2013 17:14:31 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by whitealder.osuosl.org (Postfix) with ESMTPS id C36AA8F7D6 for ; Fri, 12 Apr 2013 17:14:30 +0000 (UTC) Received: by mail-wi0-f169.google.com with SMTP id c10so1902948wiw.4 for ; Fri, 12 Apr 2013 10:14:29 -0700 (PDT) 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 :in-reply-to:references:in-reply-to:references; bh=0DSJVQh7blCCMWwJot6xDXjCWaMKdgzJUuD4I6kfWOs=; b=B5dAY31941fTXXVBlLgyAKeyCfHeEaNe50Zlu2+KoNcPBwA8feutMmOXKrPKlHRQyC cJTvdn+78vvSHOCqDUScbFskuM/rhq4BFyrxauN2yQcMseKqGq4H5S3pKf5IZmWu8iG+ BbHRtl+OAN10rYCIt+8Y3mcoOU3sQmhBXikgqsH4rcV7MJMDYifYtVNdsbG7MLBdUcIl wHJcykSMCT8ToGbP2oQ6bCe/W1bDyp3gTAfJKBprk7nNzhMzQ6VaxFvG9vVXJIW7IaeA JfdCZDnBW7W2K+U2aRUCeoG+7q2yx23meIaRJjvvGH2WhNE/UaK2YB5WxkD43SbCA7u4 BQ/g== X-Received: by 10.194.58.202 with SMTP id t10mr19208252wjq.4.1365786869041; Fri, 12 Apr 2013 10:14:29 -0700 (PDT) Received: from localhost.localdomain (ks3095497.kimsufi.com. [94.23.60.27]) by mx.google.com with ESMTPS id bj9sm4451479wib.4.2013.04.12.10.14.27 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 12 Apr 2013 10:14:28 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@busybox.net Date: Fri, 12 Apr 2013 19:14:19 +0200 Message-Id: <65cd70e699b9f1841c8f65ebea866042de63b684.1365786584.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: In-Reply-To: References: Cc: "Yann E. MORIN" Subject: [Buildroot] [PATCH 2/2] package/tvheadend: use a non-root user to run the daemon 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 Signed-off-by: "Yann E. MORIN" --- package/tvheadend/etc.default.tvheadend | 5 ++--- package/tvheadend/tvheadend.mk | 10 ++++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/package/tvheadend/etc.default.tvheadend b/package/tvheadend/etc.default.tvheadend index c769055..253f832 100644 --- a/package/tvheadend/etc.default.tvheadend +++ b/package/tvheadend/etc.default.tvheadend @@ -1,6 +1,5 @@ -# Once we have a real user, we'll use it -TVH_USER=root -TVH_GROUP=root +TVH_USER=tvheadend +TVH_GROUP=tvheadend #TVH_ADAPTERS= #TVH_HTTP_PORT=9981 #TVH_HTSP_PORT=9982 diff --git a/package/tvheadend/tvheadend.mk b/package/tvheadend/tvheadend.mk index 5a971b8..58965d6 100644 --- a/package/tvheadend/tvheadend.mk +++ b/package/tvheadend/tvheadend.mk @@ -26,9 +26,11 @@ TVHEADEND_DEPENDENCIES += dvb-apps # To run tvheadend, we need: # - a startup script, and its config file # - a default DB with a tvheadend admin +# - a non-root user to run as define TVHEADEND_INSTALL_DB - $(INSTALL) -D package/tvheadend/accesscontrol.1 \ - $(TARGET_DIR)/root/.hts/tvheadend/accesscontrol/1 + $(INSTALL) -D -m 0600 package/tvheadend/accesscontrol.1 \ + $(TARGET_DIR)/home/tvheadend/.hts/tvheadend/accesscontrol/1 + chmod -R go-rwx $(TARGET_DIR)/home/tvheadend endef TVHEADEND_POST_INSTALL_TARGET_HOOKS = TVHEADEND_INSTALL_DB @@ -37,6 +39,10 @@ define TVHEADEND_INSTALL_INIT_SYSV $(INSTALL) -D package/tvheadend/S99tvheadend $(TARGET_DIR)/etc/init.d/S99tvheadend endef +define TVHEADEND_USERS +tvheadend -1 tvheadend -1 * /home/tvheadend - video TVHeadend daemon +endef + #---------------------------------------------------------------------------- # tvheadend is not an autotools-based package, but it is possible to # call its ./configure script as if it were an autotools one.