Re: [PATCH 4/4] docs: setterm.1 clean up manual page groff style

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday 29 May 2014, Sami Kerola wrote:
> On 27 May 2014 15:46, Karel Zak <kzak@xxxxxxxxxx> wrote:
> > On Mon, May 26, 2014 at 04:46:12PM +0100, Sami Kerola wrote:
> >> git://github.com/kerolasa/lelux-utiliteetit.git rename
> >
> >  Not merged, it seems that the tests still uses the current directory
> >  rather than $TS_OUTDIR, right?
> 
> Oh, that's a beginner mistake. Fix is available in same git remote
> location. All I did was a cd before file operations in each script,
> something like this:
> 
> +++ b/tests/ts/rename/basic
> @@ -22,6 +22,7 @@ TS_DESC="basic check"
>  ts_init "$*"
> 
>  ts_check_test_command "$TS_CMD_RENAME"
> +cd $TS_OUTDIR
> 

I know we are doing similar already in other tests too. IMO cd in scripts can be very dangerous, specially if there is no error handling.

For example if ts_init is broken (while you are working on it) and TS_OUTDIR would be unset then "cd $TS_OUTDIR" would jump into your $HOME ... which could be really bad.

At least I would quote it
  cd "$TS_OUTDIR"
or even better
  cd "$TS_OUTDIR" || exit 1

cu,
Rudi
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux