110 Commits

Author SHA1 Message Date
Ondrej Kozina
7fc006b63b Add interrupt safe read_lseek_blockwise function. 2015-12-01 10:52:42 +01:00
Ondrej Kozina
64f3df44ee Use read/write buffer functions where appropriate. 2015-12-01 10:51:56 +01:00
Ondrej Kozina
42ccddeff3 Add read_buffer and write_buffer functions.
Introduce functions for proper I/O handling. These functions
are able to deal with interrupts and partial I/O.
2015-12-01 10:44:02 +01:00
Ondrej Kozina
0435fbf2e5 Avoid write with zero size.
This can happen if write buffer size is smaller than underlying
block size and initial buffer is misaligned.

Also use size_t for buffer length variables.
2015-12-01 10:42:08 +01:00
Milan Broz
bb8dbfdf5b Update author name. 2014-06-23 21:40:12 +02:00
Milan Broz
29f21208a0 Change License from GPLv2 only to GPLv2+ ("or any later").
Agreed by all copyright authors.
2012-12-29 11:33:54 +01:00
Milan Broz
83f02e6682 Add copyright line for files I have written or modified. 2012-12-21 16:40:33 +01:00
Milan Broz
9ae7b7d1be Fix regression in header backup (1.5.1).
Access to backup file must handle write to regular files too.
2012-12-19 13:19:05 +01:00
Milan Broz
50d5cfa8bc Get page size should never fail (in the works case it fails later with wrong alignment). 2012-12-10 17:47:06 +01:00
Milan Broz
98db3bc0bf Fix blockwise read/write for end writes near end of device.
Ignore setpriority failure (will be remoced later anyway).
2012-11-25 22:57:32 +01:00
Milan Broz
1d5788f779 Set context for DM log for all DM backend entries.
Try to handle error if run as non-root user better.
2012-08-14 19:17:13 +02:00
Milan Broz
65f975655c New device access backend.
Allocate loop device late (only when real block device needed).
Rework underlying device/file access functions.
Move all device (and ioctl) access to utils_device.c.

Allows using file where appropriate without allocation loop device.
2012-08-12 22:00:17 +02:00
Milan Broz
4b8f91d0d9 Remove some compilation warnings. 2012-06-10 18:56:04 +02:00
Milan Broz
cd8826618d Warn if block exceeds page size. 2012-06-07 15:09:58 +02:00
Milan Broz
f720affe8c Relax --shared test, allow mapping even for overlapping segments.
Support shared flag for LUKS devices (dangerous).
2012-05-02 00:58:54 +02:00
Milan Broz
ee8425b836 Version 1.4.2.
Add header and copyright for header files.
2012-04-02 22:03:05 +02:00
Milan Broz
7835b365a7 Fix FSF address in license text according to
http://www.gnu.org/licenses/old-licenses/gpl-2.0.html

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@671 36d66b0a-2a48-0410-832c-cd162a569da5
2011-11-02 22:35:21 +00:00
Milan Broz
d7960b9307 Simplify global error call.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@622 36d66b0a-2a48-0410-832c-cd162a569da5
2011-10-09 13:45:38 +00:00
Milan Broz
d2fbc963ca If device is not rotational, do not use Gutmann wipe method.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@615 36d66b0a-2a48-0410-832c-cd162a569da5
2011-10-08 16:17:08 +00:00
Milan Broz
7665f8e805 Improve check for invalid offset and size values. (thx to okozina)
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@588 36d66b0a-2a48-0410-832c-cd162a569da5
2011-08-01 12:27:34 +00:00
Milan Broz
f80b506b65 * Allow different data offset setting for detached header.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@576 36d66b0a-2a48-0410-832c-cd162a569da5
2011-07-20 17:39:38 +00:00
Milan Broz
913ef7c07e Rewrite dm query/create function backend.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@570 36d66b0a-2a48-0410-832c-cd162a569da5
2011-07-17 22:35:17 +00:00
Milan Broz
790ef04304 Fix error message.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@560 36d66b0a-2a48-0410-832c-cd162a569da5
2011-07-01 16:41:59 +00:00
Milan Broz
d44d07c9eb * Add --shared option for creating non-overlapping crypt segments.
* Add shared flag to libcryptsetup api.
* Fix plain crypt format parameters to include size option (API change).

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@559 36d66b0a-2a48-0410-832c-cd162a569da5
2011-07-01 16:38:58 +00:00
Milan Broz
2755f37266 Move devpath scan to separate file.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@529 36d66b0a-2a48-0410-832c-cd162a569da5
2011-05-24 11:19:00 +00:00
Milan Broz
1b58fab430 Remove old ifdef, all recent systems have this defined.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@513 36d66b0a-2a48-0410-832c-cd162a569da5
2011-04-18 10:52:28 +00:00
Milan Broz
231a2e932d Fix possible leaks in blockwise read/write code.
Fix lseek_write blockwise function (not used in that mode anyway).

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@511 36d66b0a-2a48-0410-832c-cd162a569da5
2011-04-18 10:52:15 +00:00
Milan Broz
5d2205a2f8 Fix verbose mode compiler warnings.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@510 36d66b0a-2a48-0410-832c-cd162a569da5
2011-04-18 10:52:02 +00:00
Milan Broz
ddcdd76cc2 Specify copyright holders in source files.
Add README notes.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@461 36d66b0a-2a48-0410-832c-cd162a569da5
2011-03-14 14:17:38 +00:00
Milan Broz
d9ba34693f Add support for automatic loop device use (image infile etc).
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@443 36d66b0a-2a48-0410-832c-cd162a569da5
2011-03-11 19:04:37 +00:00
Milan Broz
0a905364fa Fix mapping removal if device disappeared but node still exists.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@420 36d66b0a-2a48-0410-832c-cd162a569da5
2011-01-29 15:55:27 +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
a70b27762d Fix some warnings if compiled with clang.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@371 36d66b0a-2a48-0410-832c-cd162a569da5
2010-11-15 16:19:19 +00:00
Milan Broz
b7caa72acd * Disallow mapping of device which is already in use (mapped or mounted).
* Disallow luksFormat on device in use.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@361 36d66b0a-2a48-0410-832c-cd162a569da5
2010-11-05 17:53:33 +00:00
Milan Broz
dfe77be748 * Implement --use-random and --use-urandom for luksFormat to allow setting of RNG for volume key generator.
* Add crypt_set_rng_type() and crypt_get_rng_type() to API.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@354 36d66b0a-2a48-0410-832c-cd162a569da5
2010-10-27 15:35:23 +00:00
Milan Broz
3ae161df5d Move get_key to common code, simplify verify flags.
(This code need rewrite anyway).

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@352 36d66b0a-2a48-0410-832c-cd162a569da5
2010-10-26 22:08:02 +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
ef44e6e3d3 Use default data alignment to 1MiB.
If there is topology info, use default if topology is multiple of default,
otherwise use topology values.

See https://bugzilla.redhat.com/show_bug.cgi?id=621684 and issue 55.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@325 36d66b0a-2a48-0410-832c-cd162a569da5
2010-08-09 16:34:42 +00:00
Milan Broz
0a68f45bb2 Fix device alignment ioctl calls parameters.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@251 36d66b0a-2a48-0410-832c-cd162a569da5
2010-06-01 14:39:10 +00:00
Milan Broz
205d62af89 Try to make get_key() paramater more obvious...
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@236 36d66b0a-2a48-0410-832c-cd162a569da5
2010-05-27 18:43:47 +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
17c87c1148 Fix minor errors
- undefined variable
- properly closinf file descriptorif totpology not detected
- fix IV mode to test run on RHEL5

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@201 36d66b0a-2a48-0410-832c-cd162a569da5
2010-04-16 14:51:09 +00:00
Milan Broz
743fbbc451 Support topology information for data alignment (LUKS).
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@195 36d66b0a-2a48-0410-832c-cd162a569da5
2010-04-09 15:35:19 +00:00
Milan Broz
1c91890aac Always close file dscriptor on error.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@157 36d66b0a-2a48-0410-832c-cd162a569da5
2009-12-30 16:39:03 +00:00
Milan Broz
42f8e5bdce Fix some strings to use gettext.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@155 36d66b0a-2a48-0410-832c-cd162a569da5
2009-12-11 11:56:32 +00:00
Milan Broz
dc4d945e88 Fix error handling during reading passhrase.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@154 36d66b0a-2a48-0410-832c-cd162a569da5
2009-12-11 11:56:25 +00:00
Milan Broz
2bda053677 Rename internal locking helpers (avoids conflict when statically linking.)
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@132 36d66b0a-2a48-0410-832c-cd162a569da5
2009-10-23 10:42:56 +00:00
Milan Broz
93796f4036 ... and previous reintroduce it as debug message.
(The problem is when repeated passphrase input is tried on pipe,
it should not show "error reading passphrase", because it fails
for the second reading attepmt anyway but should retain
error message saying "no key with this passpharase...")

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@117 36d66b0a-2a48-0410-832c-cd162a569da5
2009-09-28 18:50:05 +00:00
Milan Broz
c096166e48 Remove error message in previous commit.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@116 36d66b0a-2a48-0410-832c-cd162a569da5
2009-09-28 18:42:26 +00:00
Milan Broz
fddd7125ca Fail if piped input is broken.
(Thanks to Ludwig Nussel)

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@115 36d66b0a-2a48-0410-832c-cd162a569da5
2009-09-28 18:29:58 +00:00