On Wed, 5 Dec 2018, Serge Belyshev wrote:

>  clean_tmp() {
> +     # Will be created by mount_tmp()
> +     [ -L /tmp ] && [ -d /tmp ] || return 0

This is *WRONG*, it will also return 0 if /tmp is not a symlink.

(Also, use test -h instead of test -L for symlinks, cf. the
GNU autoconf texinfo manual, *Limitations of Builtins::)

What about this instead:

        if test -h /tmp; then
                # symbolic link
                # will be created by mount_tmp if it does not exist
                test -d /tmp || return 0
                # but we’ll clean it if it does
        fi

bye,
//mirabilos
-- 
tarent solutions GmbH
Rochusstraße 2-4, D-53123 Bonn • http://www.tarent.de/
Tel: +49 228 54881-393 • Fax: +49 228 54881-235
HRB 5168 (AG Bonn) • USt-ID (VAT): DE122264941
Geschäftsführer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg

Reply via email to