From patchwork Fri May 22 15:36:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Knight X-Patchwork-Id: 475676 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id B20BB140E46 for ; Sat, 23 May 2015 01:36:32 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id BD6D68C063; Fri, 22 May 2015 15:36:31 +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 Dv4L6hZo7KiG; Fri, 22 May 2015 15:36:31 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id C570C8C04E; Fri, 22 May 2015 15:36:30 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 1BD0D1C1F1F for ; Fri, 22 May 2015 15:36:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 1ADF431415 for ; Fri, 22 May 2015 15:36:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HIBAw2WfU61u for ; Fri, 22 May 2015 15:36:27 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from da1vs02.rockwellcollins.com (da1vs02.rockwellcollins.com [205.175.227.29]) by silver.osuosl.org (Postfix) with ESMTPS id 9849B3174B for ; Fri, 22 May 2015 15:36:27 +0000 (UTC) Received: from ofwda1n02.rockwellcollins.com (HELO crulimr01.rockwellcollins.com) ([205.175.227.14]) by da1vs02.rockwellcollins.com with ESMTP; 22 May 2015 10:36:26 -0500 X-Received: from JDKNIGHT-PC.rccalab.inside (unknown [192.168.162.69]) by crulimr01.rockwellcollins.com (Postfix) with ESMTP id 374AB605B6; Fri, 22 May 2015 10:36:26 -0500 (CDT) From: James Knight To: buildroot@buildroot.org Date: Fri, 22 May 2015 11:36:17 -0400 Message-Id: <1432308977-1284-1-git-send-email-james.knight@rockwellcollins.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Cc: James Knight Subject: [Buildroot] [PATCH 1/1] scripts/mkusers: allow users with no password value set X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 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" The following allows a user definition to specify that a created user entry should not have a password value set. Original implementation allowed a user definition to provide a password value of "-" (no quotes) to generate a crypt-encoded empty string value. In some cases, it may be desired to have no value specified for a user's password. By using a value "-" for a password, no value will be set in the shadow value. Signed-off-by: James Knight Acked-by: "Yann E. MORIN" --- docs/manual/makeusers-syntax.txt | 3 ++- support/scripts/mkusers | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/manual/makeusers-syntax.txt b/docs/manual/makeusers-syntax.txt index ffdb961..467e596 100644 --- a/docs/manual/makeusers-syntax.txt +++ b/docs/manual/makeusers-syntax.txt @@ -31,7 +31,8 @@ Where: then login is disabled. If prefixed with +=+, then it is interpreted as clear-text, and will be crypt-encoded (using MD5). If prefixed with +!=+, then the password will be crypt-encoded (using MD5) and login - will be disabled. If set to +*+, then login is not allowed. + will be disabled. If set to +*+, then login is not allowed. If set to + +-+, then no password value will be set. - +home+ is the desired home directory for the user. If set to '-', no home directory will be created, and the user's home will be +/+. Explicitly setting +home+ to +/+ is not allowed. diff --git a/support/scripts/mkusers b/support/scripts/mkusers index 026519e..9c5c4dc 100755 --- a/support/scripts/mkusers +++ b/support/scripts/mkusers @@ -318,6 +318,9 @@ add_one_user() { *) fail "home must be an absolute path\n";; esac case "${passwd}" in + -) + _passwd="" + ;; !=*) _passwd='!'"$( encode_password "${passwd#!=}" )" ;;