Commit a7183693 authored by Milan Broz's avatar Milan Broz

Fix loop mapping on readonly file.

parent 4b6ec2a8
2012-05-02 Milan Broz <gmazyland@gmail.com>
* Fix loop mapping on readonly file.
2012-04-09 Milan Broz <gmazyland@gmail.com>
* Fix header check to support old (cryptsetup 1.0.0) header alignment. (1.4.0)
* Version 1.4.2.
......
......@@ -99,7 +99,7 @@ int crypt_loop_attach(const char *loop, const char *file, int offset,
int loop_fd = -1, file_fd = -1, r = 1;
file_fd = open(file, (*readonly ? O_RDONLY : O_RDWR) | O_EXCL);
if (file_fd < 0 && errno == EROFS && !*readonly) {
if (file_fd < 0 && (errno == EROFS || errno == EACCES) && !*readonly) {
*readonly = 1;
file_fd = open(file, O_RDONLY | O_EXCL);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment