-
Notifications
You must be signed in to change notification settings - Fork 15
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
Stage to master: readonly in dav_open #356
Conversation
Readonly to dav open
Fix copy paste shenanigans
Dev to yolo: readonly mode in dav_open
Yolo to stage: readonly in dav_open
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I'd like to better understand the change to readdirectory
when we chat Friday.
@@ -68,7 +68,7 @@ static int readdirectory(char *dirname, int *dirsread, int *filesread, int *erro | |||
else { | |||
int bytes_read; | |||
char rbuf [1025]; | |||
fd = open(fn, O_RDWR); | |||
fd = open(fn, O_RDONLY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know this code well enough to understand what the change here is for, or why we need it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a test file. I was considering adding O_RDWR to the list of 'write' flags to open to cause it to fail if in readonly mode, then realized that without thinking I used O_RDWR to open a file which was merely for reading. So I changed to test to be O_RDONLY so it could be used to test read success while testing readonly mode. Then I decided not to add O_RDWR to the 'write' flags. Still, the most correct way to open a file which will merely be read from is to use O_RDONLY.
This test just recurses through the filesystem, enters all directories, and reads all files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation! 😄
LGTM 👍 |
No description provided.