[nginx-test] tempdir permission

洪志道 hongzhidao at gmail.com
Fri Oct 21 03:44:01 UTC 2016


Hi!

I run the following test.

> cat test.t
#!/usr/bin/perl

use warnings;
use strict;

use File::Temp qw/ tempdir /;

tempdir(
        'nginx-test-XXXXXXXXXX',
        TMPDIR => 1
    )
        or die "Can't create temp directory: $!\n";


> prove test.t


> ll -d /tmp/nginx-test*
drwx------ 2 root root 4096 Oct 20 06:09 /tmp/nginx-test-8ZmZ2FksyP


The same problem is exist in nginx-test. And I can't pass the test like
request_id.t.

sub new {
    my $self = {};
    bless $self;

    $self->{_pid} = $$;
    $self->{_alerts} = 1;

    $self->{_testdir} = tempdir(
        'nginx-test-XXXXXXXXXX',
        TMPDIR => 1
    )
        or die "Can't create temp directory: $!\n";

+  chmod 0755, $self->{_testdir}; # Should I change permission here???

    $self->{_testdir} =~ s!\\!/!g if $^O eq 'MSWin32';
    mkdir "$self->{_testdir}/logs"
        or die "Can't create logs directory: $!\n";

    Test::More::BAIL_OUT("no $NGINX binary found")
        unless -x $NGINX;

    return $self;
}

B.R~
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20161021/bfe2bdae/attachment.html>


More information about the nginx-devel mailing list