From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 6D0F3138010 for ; Mon, 22 Oct 2012 05:15:52 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E9DB421C005; Mon, 22 Oct 2012 05:15:42 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 7382A21C00F for ; Mon, 22 Oct 2012 05:15:42 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BC63133D7D7 for ; Mon, 22 Oct 2012 05:15:41 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 961FCE5440 for ; Mon, 22 Oct 2012 05:15:39 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1350882747.aa34435cc8c17618facb6e68c8380f0026d79b8e.WilliamH@OpenRC> Subject: [gentoo-commits] proj/openrc:openrc-0.11.x commit in: sh/ X-VCS-Repository: proj/openrc X-VCS-Files: sh/tmpfiles.sh.in X-VCS-Directories: sh/ X-VCS-Committer: WilliamH X-VCS-Committer-Name: William Hubbs X-VCS-Revision: aa34435cc8c17618facb6e68c8380f0026d79b8e X-VCS-Branch: openrc-0.11.x Date: Mon, 22 Oct 2012 05:15:39 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 39f77d86-bc4e-4639-9f3d-91803704d52c X-Archives-Hash: f1bfe9fc18ed6b96865b674bd8551f39 commit: aa34435cc8c17618facb6e68c8380f0026d79b8e Author: Andrew Gregory gmail com> AuthorDate: Thu Oct 11 18:34:20 2012 +0000 Commit: William Hubbs gentoo org> CommitDate: Mon Oct 22 05:12:27 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=aa34435c tmpfilesd: parse arguments with spaces systemd allows the final arg in tmpfiles to contain spaces. Using the read() call to set the variables includes all trailing components in $arg so it doesn't get cut off. Signed-off-by: Andrew Gregory gmail.com> --- sh/tmpfiles.sh.in | 32 ++++++++++---------------------- 1 files changed, 10 insertions(+), 22 deletions(-) diff --git a/sh/tmpfiles.sh.in b/sh/tmpfiles.sh.in index 57cedbe..ae7b7ca 100755 --- a/sh/tmpfiles.sh.in +++ b/sh/tmpfiles.sh.in @@ -253,46 +253,34 @@ for FILE in $tmpfiles_d ; do # XXX: Upstream says whitespace is NOT permitted in the Path argument. # But IS allowed when globs are expanded for the x/r/R/z/Z types. - while read line; do + while read cmd path mode uid gid age arg; do LINENUM=$(( LINENUM+1 )) - # This will skip over comments and empty lines - set -- $line - # Unless we have both command and path, skip this line. - if [ -z "$1" -o -z "$2" ]; then + if [ -z "$cmd" -o -z "$path" ]; then continue fi # whine about invalid entries - case $1 in + case $cmd in f|F|w|d|D|p|L|c|b|x|r|R|z|Z) ;; \#) continue ;; *) warninvalid ; continue ;; esac - cmd=$1 - path=$2 - # fall back on defaults when parameters are passed as '-' - if [ "$3" = '-' -o "$3" = '' ]; then - case ${1} in + if [ "$mode" = '-' -o "$mode" = '' ]; then + case "$cmd" in p|f|F) mode=0644 ;; d|D) mode=0755 ;; z|Z|x|r|R|L) ;; esac - else - mode=$3 fi - uid=$4 - gid=$5 - age=$6 - arg=$7 - - [ "${4}" = '-' -o "${4}" = '' ] && uid=0 - [ "${5}" = '-' -o "${5}" = '' ] && gid=0 - [ "${6}" = '-' -o "${6}" = '' ] && age=0 - [ "${7}" = '-' -o "${7}" = '' ] && arg='' + + [ "$uid" = '-' -o "$uid" = '' ] && uid=0 + [ "$gid" = '-' -o "$gid" = '' ] && gid=0 + [ "$age" = '-' -o "$age" = '' ] && age=0 + [ "$arg" = '-' -o "$arg" = '' ] && arg='' set -- "$path" "$mode" "$uid" "$gid" "$age" "$arg" [ "$VERBOSE" -eq "1" ] && echo _$cmd "$@"