Add non-exclusive override to interface definition, add regression test

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@26 36d66b0a-2a48-0410-832c-cd162a569da5
This commit is contained in:
Clemens Fruhwirth
2008-06-30 12:21:06 +00:00
parent 7fbbc21a07
commit 643aed1891
2 changed files with 17 additions and 0 deletions

View File

@@ -1,5 +1,8 @@
#ifndef _LIBCRYPTSETUP_H
#define _LIBCRYPTSETUP_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
@@ -17,6 +20,7 @@ struct interface_callbacks {
#define CRYPT_FLAG_READONLY (1 << 1)
#define CRYPT_FLAG_VERIFY_IF_POSSIBLE (1 << 2)
#define CRYPT_FLAG_VERIFY_ON_DELKEY (1 << 3)
#define CRYPT_FLAG_NON_EXCLUSIVE_ACCESS (1 << 4)
struct crypt_options {
const char *name;
@@ -65,4 +69,7 @@ void crypt_get_error(char *buf, size_t size);
void crypt_put_options(struct crypt_options *options);
const char *crypt_get_dir(void);
#ifdef __cplusplus
}
#endif
#endif /* _LIBCRYPTSETUP_H */

View File

@@ -125,6 +125,16 @@ test:
@../src/cryptsetup -v remove dummy
@echo "success"
# Non-Exclusive Open test
@echo Case: Non-Exclusive Open
echo "key0" | ../src/cryptsetup -v --readonly luksOpen $(LOOPDEV) dummy1 2>/dev/null
# must fail
echo "key0" | ../src/cryptsetup -v --readonly luksOpen $(LOOPDEV) dummy2 2>/dev/null || true
echo "key0" | ../src/cryptsetup -v --non-exclusive --readonly luksOpen $(LOOPDEV) dummy2 2>/dev/null
@../src/cryptsetup -v remove dummy1
@../src/cryptsetup -v remove dummy2
# Key Slot 1 and key material section 1 must change, the rest must not
@echo Case: add key test for key files
@cp $(IMG) $(ORIG_IMG)