Commit Graph

32 Commits

Author SHA1 Message Date
Milan Broz
0b5418c02f Use secure data bit for dm-ioctl if supported.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@434 36d66b0a-2a48-0410-832c-cd162a569da5
2011-03-05 20:47:21 +00:00
Milan Broz
66bea4b3be Add dm flags for query for features.
Move adjust device helper to utils.
Fix locking memory message.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@416 36d66b0a-2a48-0410-832c-cd162a569da5
2011-01-25 18:48:41 +00:00
Milan Broz
3a5a1ea0e7 Move safe alloc routines into common lib file.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@351 36d66b0a-2a48-0410-832c-cd162a569da5
2010-10-26 22:07:43 +00:00
Milan Broz
b117dcc209 Do not query non-existent device twice:
# cryptsetup status /dev/nonexistent
  Device /dev/nonexistent not found
  Device /dev/nonexistent not found

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@330 36d66b0a-2a48-0410-832c-cd162a569da5
2010-08-13 14:05:34 +00:00
Milan Broz
a707ec6200 Fix previous commit to properly check udev flag definition.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@297 36d66b0a-2a48-0410-832c-cd162a569da5
2010-07-03 13:18:05 +00:00
Milan Broz
64072e0e20 Fix udev support for old libdevmapper with not compatible definition.
Some released devmapper libraries have defined dm_task_set_cookie()
with not compatible parameters (ABI break), let's check for udev support
by using flags definition (udev is for cryptsetup not usable without this anyway).

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@296 36d66b0a-2a48-0410-832c-cd162a569da5
2010-07-03 13:11:32 +00:00
Milan Broz
49463051bc Remove device even if underlying device disappeared.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@240 36d66b0a-2a48-0410-832c-cd162a569da5
2010-05-30 12:20:56 +00:00
Milan Broz
cddf4d859d Fix luksClose if underlying device is another DM device
and commands fails with "Device 253:0 doesn't exist or access denied." error.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@225 36d66b0a-2a48-0410-832c-cd162a569da5
2010-05-23 13:09:33 +00:00
Milan Broz
b237358079 Fix automatic dm-crypt module loading.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@222 36d66b0a-2a48-0410-832c-cd162a569da5
2010-05-03 15:02:47 +00:00
Milan Broz
1dcd5a3de5 Detect old dm-crypt module and disable LUKS suspend/resume.
Fix apitest to work on older systems.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@205 36d66b0a-2a48-0410-832c-cd162a569da5
2010-04-30 12:03:41 +00:00
Milan Broz
346e1d1264 Fix includes for libdevmapper internals.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@204 36d66b0a-2a48-0410-832c-cd162a569da5
2010-04-29 22:26:14 +00:00
Milan Broz
0516a1a676 Do not use kernel dm-ioctl header directly and remove warnings.
Add alignment test to distributed files.
Fix write() return compiler warning.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@202 36d66b0a-2a48-0410-832c-cd162a569da5
2010-04-16 15:48:09 +00:00
Milan Broz
4f14b43a3d Fix udev support. Set flag to disable udev rules for temporary devices.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@199 36d66b0a-2a48-0410-832c-cd162a569da5
2010-04-16 11:11:37 +00:00
Milan Broz
4a42f27d78 Detect and use devmapper udev support if available (disable by --disable-udev).
If we have device-mapper, get ingo using dm_udev_get_sync_support(),
otherwise ignore udev completely.

You can disable udev support by adding --disable-udev to configure, default is enabled.
(There can be races if udev rules run some actions and cryptsetup doesn't wait it.)

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@198 36d66b0a-2a48-0410-832c-cd162a569da5
2010-04-15 15:32:42 +00:00
Milan Broz
7d207b7725 Prefer some device paths in status display. (Issue 48)
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@194 36d66b0a-2a48-0410-832c-cd162a569da5
2010-04-06 15:06:36 +00:00
Milan Broz
37d693cfc2 Fix missing includes on recent systems.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@178 36d66b0a-2a48-0410-832c-cd162a569da5
2010-01-15 11:11:37 +00:00
Milan Broz
c3064c9442 Add temporary debug code to allow better debugging of races
with various udev-event tools which wrongly scan and open
internal temporary cryptsetup devices.

If cryptsetup run in debug mode (--debug) and remove of device
fails, code scan /proc directory and tries to find process name
which locked that device.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@141 36d66b0a-2a48-0410-832c-cd162a569da5
2009-11-15 19:26:36 +00:00
Milan Broz
e618f38929 Fix status device call to fail if running as non-root.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@139 36d66b0a-2a48-0410-832c-cd162a569da5
2009-11-14 21:33:57 +00:00
Milan Broz
de95a38381 Move dm backend initialisation to library calls.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@125 36d66b0a-2a48-0410-832c-cd162a569da5
2009-10-01 10:14:32 +00:00
Milan Broz
f51c7b62db Replace locked device with error target after 1 sec of waiting.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@113 36d66b0a-2a48-0410-832c-cd162a569da5
2009-09-20 18:02:41 +00:00
Milan Broz
a47856ac49 Use dm-uuid for all crypt devices, contains device type and name now.
DM_UUID now contains prefix (CRYPT-), device type (LUKS1, PLAIN, TEMP),
UUID (if provided - LUKS) and device name.

Because e.g. snapshot of full LUKS device during activation must have different
name, DM-UUID is different too and we do not need --disable-uuid option.

DM-UUID is persistent during activation time.

* Revert (and solve different way): Replace not safe option --non-exclusive with --disable-uuid.

Signed-off-by: Milan Broz <mbroz@redhat.com>

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@105 36d66b0a-2a48-0410-832c-cd162a569da5
2009-09-08 06:41:44 +00:00
Milan Broz
3cea5dcc7b * Add luksSuspend (freeze device and wipe key) and luksResume (with provided passphrase).
Signed-off-by: Milan Broz <mbroz@redhat.com>

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@104 36d66b0a-2a48-0410-832c-cd162a569da5
2009-09-02 12:47:21 +00:00
Milan Broz
bf7819ccef * Add log macros and make logging modre consitent.
* Move command successful messages to verbose level.
* Introduce --debug parameter.

Signed-off-by: Milan Broz <mbroz@redhat.com>

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@92 36d66b0a-2a48-0410-832c-cd162a569da5
2009-08-30 18:07:17 +00:00
Milan Broz
ab953b3ff6 Require device device-mapper to build and do not use backend wrapper for dm calls.
Signed-off-by: Milan Broz <mbroz@redhat.com>

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@90 36d66b0a-2a48-0410-832c-cd162a569da5
2009-08-30 17:56:33 +00:00
Milan Broz
ea0ee83025 Remove unneeded timeout when remove of temporary device succeeded.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@72 36d66b0a-2a48-0410-832c-cd162a569da5
2009-07-22 20:21:49 +00:00
Milan Broz
9ed9ba3d85 Define device-mapper crypt UUID maximal length and check for its size.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@57 36d66b0a-2a48-0410-832c-cd162a569da5
2009-06-21 10:02:10 +00:00
Milan Broz
dca5a38513 Set UUID in device-mapper for LUKS devices.
Device mapper device should use UUID string if possible.
UDEV can then easily distinguish the device type etc.

cryptsetup now uses CRYPT prefix for uuid.



git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@55 36d66b0a-2a48-0410-832c-cd162a569da5
2009-06-20 20:24:56 +00:00
Milan Broz
9160fb0894 Retain readahead of underlying device.
(If libdevmapper version supports it).



git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@54 36d66b0a-2a48-0410-832c-cd162a569da5
2009-06-20 20:22:27 +00:00
Milan Broz
db96ccef46 Check device size when loading LUKS header.
(And remove misleading error message later.)

Because kernel and libdevmapper does not provide
better error message then "invalid parameters"
add some error hint if dm-crypt mapping failed.
(Key size and kernel version check for XTS and LRW mode
for now.)



git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@52 36d66b0a-2a48-0410-832c-cd162a569da5
2009-06-20 09:24:33 +00:00
Milan Broz
c0aeac6a34 Use remapping to error target instead of calling udevsettle for temporary crypt device.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@32 36d66b0a-2a48-0410-832c-cd162a569da5
2008-09-16 15:35:50 +00:00
Clemens Fruhwirth
0ac25b6c83 Check device mapper communication and warn user in case the communication fails. Thanks to Milan Broz.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@31 36d66b0a-2a48-0410-832c-cd162a569da5
2008-09-11 09:10:55 +00:00
Clemens Fruhwirth
7dc7b90a9b Initial checking of what was revision 56 on http://luks.endorphin.org/svn/cryptsetup
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@3 36d66b0a-2a48-0410-832c-cd162a569da5
2008-03-22 08:23:35 +00:00