public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] testcases: fix file path to control access to cron
Date: Wed, 21 Mar 2018 17:31:31 +0100	[thread overview]
Message-ID: <20180321163130.GA17287@ai> (raw)
In-Reply-To: <20180321023515.11356-1-dan.rue@linaro.org>

Hi!
>  TEST_USER1="ca_user1"
>  TEST_USER1_HOME="/home/$TEST_USER1"
> diff --git a/testcases/commands/cron/cron_common.sh b/testcases/commands/cron/cron_common.sh
> new file mode 100755
> index 0000000000..5ed90c4039
> --- /dev/null
> +++ b/testcases/commands/cron/cron_common.sh
> @@ -0,0 +1,15 @@
> +#!/bin/sh
> +
> +iam=`whoami`
> +
> +tvar=${MACHTYPE%-*}
> +tvar=${tvar#*-}
> +
> +setup_path() {
> +	# Support paths used by older distributions of RHEL or SLES.
> +	export CRON_DENY="$(man crontab 2>/dev/null | grep -m 1 -o '/[\/a-z.]*deny$' || echo "/etc/cron.deny")"
> +	export CRON_ALLOW="$(man crontab 2>/dev/null | grep -m 1 -o '/[\/a-z.]*allow$' || echo "/etc/cron.allow")"
> +}

FYI I do have three crontab manual pages installed on my system, two by
the cron package and one by man-pages-posix package. The 'man 1 crontab'
seems to be the one we want to parse though, it will be picked by
default since the predefined order starts with the section 1, but we may
as well specify it explicitly.

Also I will check my collection of virtual machines, with a bit of luck
all of the SLES versions that used /var/spool/cron/ are out of support
now.

-- 
chrubis@suse.cz

  parent reply	other threads:[~2018-03-21 16:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-21  2:35 [LTP] [PATCH] testcases: fix file path to control access to cron Dan Rue
2018-03-21 15:13 ` Petr Vorel
2018-03-21 16:31 ` Cyril Hrubis [this message]
2018-03-27 13:33 ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180321163130.GA17287@ai \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox