Skip to content

Conversation

@rrgodhorus
Copy link
Contributor

No description provided.

Copy link
Contributor

@JustinCappos JustinCappos left a comment

Choose a reason for hiding this comment

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

Minor edits to clarify things.

Comment on lines +155 to +156
# globals
mycontext['debug'] = False
Copy link
Contributor

Choose a reason for hiding this comment

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

You should have a small amount of code here to explain how their code may work. Maybe just copy default if it exists?

Copy link
Contributor Author

@rrgodhorus rrgodhorus Sep 17, 2024

Choose a reason for hiding this comment

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

How about this instead ? Or would it be too much ? Also this code would make the attack case work too.

def __init__(self, filename, create):
        # globals
        mycontext['debug'] = False
        if create == False and 'default' in listfiles():
            default_file = openfile('default', False)
            content = default_file.readat(None, 0) # Read from the file using the sandbox's readat
            self.LPfile = openfile(filename, True)
            self.LPfile.writeat(content, 0)
            default_file.close()
        else:
            self.LPfile = openfile(filename, create)

Copy link
Contributor

Choose a reason for hiding this comment

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

sure, this makes sense

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've modified the doc to add this. Also, removed any references to the attack case throwing FileNotFoundError.

rrgodhorus and others added 2 commits September 17, 2024 20:18
Co-authored-by: Justin Cappos <justincappos@gmail.com>
@JustinCappos JustinCappos merged commit e5fa4a8 into SeattleTestbed:master Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants