-
Notifications
You must be signed in to change notification settings - Fork 185
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
ENT-12033: Made multiple changes to increase robustness of remote file copying #5620
base: master
Are you sure you want to change the base?
Commits on Oct 29, 2024
-
Added doc string to CopyRegularFileNet
Some of the parameters were not that obvious. Hence, I added a doc string so that future hackers can save some time trying to understand this madness. Ticket: None Changelog: None Signed-off-by: Lars Erik Wik <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 23441a5 - Browse repository at this point
Copy the full SHA 23441a5View commit details -
Added assert to check return code of snprintf
Added assert to check return code of snprintf in `[Encrypt]CopyRegularFileNet`. Ticket: None Changelog: None Signed-off-by: Lars Erik Wik <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6a383db - Browse repository at this point
Copy the full SHA 6a383dbView commit details -
Fixed typo in comment for CopyRegularFileNet
Ticket: None Changelog: None Signed-off-by: Lars Erik Wik <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7a905fd - Browse repository at this point
Copy the full SHA 7a905fdView commit details -
Removed check for filename too long
There was a check to see if the destination filename was larger than `CF_BUFSIZE - 20` when copying files over the network. This makes no sense to me. At first glans, one might think that it has to do with the network protocol. I.e., `GET $SIZE $FILENAME` has to fit in `CF_BUFSIZE`. However, this is the source filename, and it is never sent over the protocol, as far as I can see. Tried to use git blame to see why it was introduced, but that was not of much help. It appears to date back to the very first implmentation of the files promise in 2008. I'll try removing it. Ticket: None Changelog: None Signed-off-by: Lars Erik Wik <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4726972 - Browse repository at this point
Copy the full SHA 4726972View commit details -
Removed unnecessary assignment of NULL-byte to buffer
Removed unnecessary assignment of terminating NULL-byte to buffer. `snprintf` will terminate the buffer. Ticket: None Changelog: None Signed-off-by: Lars Erik Wik <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 226f64d - Browse repository at this point
Copy the full SHA 226f64dView commit details -
We should not rely on `sscanf` not mutating the pointer arguments on a matching failure as this is not specified in the man page. Instead we should check the expected amount of items are successfully matched. Ticket: None Changelog: None Signed-off-by: Lars Erik Wik <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d00d281 - Browse repository at this point
Copy the full SHA d00d281View commit details -
Added sanity check in CopyRegularFileNet
Added a sanity check to make sure we don't write more than the original filesize aquired by SYNCH ... STAT source. This might happen if the file was changed while copying. Ticket: None Changelog: None Signed-off-by: Lars Erik Wik <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8daa59b - Browse repository at this point
Copy the full SHA 8daa59bView commit details -
Allocate receive buffer on stack instead of heap
Changed to code in `[Encrypt]CopyRegularFileNet` to allocate the receive buffer on the stack instead of the heap. There is no reason to have it dynamically allocated since the size is constant. Furthermore, the buffer is allocated and destroyed in the same scope. Ticket: None Changelog: None Signed-off-by: Lars Erik Wik <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for dadf891 - Browse repository at this point
Copy the full SHA dadf891View commit details -
cf-serverd now stats file every read on network transmission
Previously the file was `stat`'ed every N read to detect file changes during transmission. The reason for limiting the calls to stat is probably to make the code more efficient. However, there are reasons to believe that the bug experienced in ENT-12033 is attributed to filechanges during transmission. Hence, I'm changing the code to do this for every read, as it better to be safe and happy rather than fast but sorry. Yes, `stat()` is a system call. However, it has pretty good cashing mechanisms on modern systems. So it should not be too expensive. Ticket: None Changelog: None Signed-off-by: Lars Erik Wik <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a026630 - Browse repository at this point
Copy the full SHA a026630View commit details -
Added filestream flushing on error in EncryptCopyRegularFileNet
By flushing the filestream, we make sure that there is no junk data after error. Ticket: None Changelog: None Signed-off-by: Lars Erik Wik <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 68ffb07 - Browse repository at this point
Copy the full SHA 68ffb07View commit details