Portable mktemp calls in the tests

Timur I. Bakeyev timur at freebsd.org
Fri Dec 22 04:43:31 UTC 2017


Hi, Martin!

Thanks for the positive feedback!

On Fri, Dec 22, 2017 at 5:05 AM, Martin Schwenke <martin at meltin.net> wrote:

> Given that I don't know how to write texinfo documentation, I've opened
> a bug (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29807) against the
> GNU coreutils package to try to get this documented.  I would encourage
> you to do the same for FreeBSD's mktemp.
>

Can you suggest what would be an adequate explanation/example for this use
case?

All that said, even though the documentation of mktemp is poor, I think
> this is an improvement and would be happy to give it a positive
> review.
>
> However, can you please remove the following change (and those related
> to it) from the mktemp commit?
>
> -cat >$tmpeditor <<-'EOF'
> +cat >${tmpeditor}.sh <<-'EOF'
>
> If you really meant to do that then can you please make that change
> in a separate commit?  :-)
>

That's the direct followup of the:

-tmpeditor=$(mktemp --suffix .sh -p $STpath/bin samba-tool-editor-XXXXXXXX)
+tmpeditor=$(TMPDIR=$STpath/bin mktemp samba-tool-editor-XXXXXXXX)

As '--suffix .sh' is also non-portable extension I've implemented similar
functionality
by adding .sh extension to the resulting file. I see, it may have security
implications
as we don't verify that resulting file doesn't exist.

I can remove whole block, as seems, self-test doesn't really use this code
route.

Or, do you have better suggestion for this code part?

With regards,
Timur Bakeyev.


More information about the samba-technical mailing list