Fix race while allocating free loop device.

Fixes Issue #314.

Thanks to Martin Jeřábek for the report.
This commit is contained in:
Milan Broz
2017-01-20 15:27:40 +01:00
parent a77c609c62
commit ef7ecb5567
4 changed files with 48 additions and 59 deletions

View File

@@ -24,10 +24,9 @@
/* loopback device helpers */
char *crypt_loop_get_device(void);
char *crypt_loop_backing_file(const char *loop);
int crypt_loop_device(const char *loop);
int crypt_loop_attach(const char *loop, const char *file, int offset,
int crypt_loop_attach(char **loop, const char *file, int offset,
int autoclear, int *readonly);
int crypt_loop_detach(const char *loop);
int crypt_loop_resize(const char *loop);