Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smbserver: remove a temporary file before exit #10990

Closed
wants to merge 1 commit into from

Conversation

dfandrich
Copy link
Contributor

Each execution of test 1451 would leave a file in /tmp before.

Closes #10990

It's not completely clear to me the purpose of this file, but the test succeeds fine with the path gone.

@dfandrich
Copy link
Contributor Author

It seems that this causes the tests to hang on Windows. Maybe that has to do with Windows' inability to delete an open file. I'll try another approach.

dfandrich added a commit that referenced this pull request Apr 25, 2023
Each execution of test 1451 would leave a file in /tmp before. Since
Windows can't delete a file while it's open, all the temporary file
names are stored and deleted on exit.

Closes #10990
@dfandrich
Copy link
Contributor Author

The solution necessary to cleanly shut down the SMB server was pretty involved, but it should do the trick. It might be able to be made cleaner if there were a relevant impacket method to override, but I'm pretty sure something like this would be needed anyway to cleanly shut down the server.

# wait for thread to finish
self.join()

def _sighandler(self, signum, frame):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

11% of developers fix this issue

vulture-100: unused variable 'frame'


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

# wait for thread to finish
self.join()

def _sighandler(self, signum, frame):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

11% of developers fix this issue

vulture-100: unused variable 'signum'


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Each execution of test 1451 would leave a file in /tmp before. Since
Windows can't delete a file while it's open, all the temporary file
names are stored and deleted on exit.

Closes #10990
@dfandrich dfandrich closed this in a4aebd7 Apr 25, 2023
@dfandrich dfandrich deleted the dfandrich/smbtmp branch April 25, 2023 23:15
bch pushed a commit to bch/curl that referenced this pull request Jul 19, 2023
Each execution of test 1451 would leave a file in /tmp before. Since
Windows can't delete a file while it's open, all the temporary file
names are stored and deleted on exit.

Closes curl#10990
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

1 participant