Closed YarBor closed 3 months ago
Thanks for the PR. I just read the man page from mkdtemp()
a couple of times and I am not sure this change helps:
DESCRIPTION
The mkdtemp() function generates a uniquely named temporary directory from template.
The last six characters of template must be XXXXXX and these are replaced with a string that
makes the directory name unique. The directory is then created with permissions 0700.
Since it will be modified, template must not be a string constant, but should be declared as
a character array.
RETURN VALUE
The mkdtemp() function returns a pointer to the modified template string on success,
and NULL on failure, in which case errno is set to indicate the error.
That sounds, to me, like your change does not make a difference. Because after your change tempdirname
and policydir
are pointing to the changed value of the template policydir
.
Independent of your change this code only works once. The second time it runs policydir
no longer contains XXXXXX
and mkdtemp()
should return EINVAL.
Thanks for the PR. I just read the man page from
mkdtemp()
a couple of times and I am not sure this change helps:感谢您的公关。我刚刚阅读了几次mkdtemp()
的手册页,我不确定此更改是否有帮助:DESCRIPTION The mkdtemp() function generates a uniquely named temporary directory from template. The last six characters of template must be XXXXXX and these are replaced with a string that makes the directory name unique. The directory is then created with permissions 0700. Since it will be modified, template must not be a string constant, but should be declared as a character array. RETURN VALUE The mkdtemp() function returns a pointer to the modified template string on success, and NULL on failure, in which case errno is set to indicate the error.
That sounds, to me, like your change does not make a difference. Because after your change
tempdirname
andpolicydir
are pointing to the changed value of the templatepolicydir
.在我看来,这听起来就像你的改变没有什么区别。因为更改后tempdirname
和policydir
指向模板policydir
的更改值。Independent of your change this code only works once. The second time it runs
policydir
no longer containsXXXXXX
andmkdtemp()
should return EINVAL.与您的更改无关,此代码仅有效一次。第二次运行时policydir
不再包含XXXXXX
并且mkdtemp()
应返回 EINVAL。
Sorry, you're right. I oversimplified it. Let me take another look.
@YarBor small nit: You can see in git log
that we never put Fixes: #XXXX
to the subject line of the commit, normally we put it on the separate line just before signoff.
A friendly reminder that this PR had no activity for 30 days.
As #2351 say When many duḿps failed in #2348, it created a bunch of empty directories
delete the directories after aborting
Signed-off-by: YarBor yarbor.ww@gmail.com
Fixes: #2351