Hello community,
here is the log from the commit of package cryptconfig
checked in at Thu Feb 15 18:10:09 CET 2007.
--------
--- cryptconfig/cryptconfig.changes 2007-02-12 22:51:13.000000000 +0100
+++ /mounts/work_src_done/STABLE/cryptconfig/cryptconfig.changes 2007-02-15 00:07:42.336623000 +0100
@@ -1,0 +2,6 @@
+Thu Feb 15 00:06:59 CET 2007 - crivera@suse.de
+
+- Use 64-bit version of lseek() when creating and enlarging
+ images. This fixes 245632.
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ cryptconfig.spec ++++++
--- /var/tmp/diff_new_pack.O11564/_old 2007-02-15 18:09:49.000000000 +0100
+++ /var/tmp/diff_new_pack.O11564/_new 2007-02-15 18:09:49.000000000 +0100
@@ -12,7 +12,7 @@
Name: cryptconfig
Version: 0.1.0
-Release: 12
+Release: 14
Group: System/Base
License: GNU Library General Public License v. 2.0 and 2.1 (LGPL)
Summary: A Utility to Configure Encrypted Home Directories and LUKS Partitions
@@ -62,6 +62,9 @@
%doc %{_mandir}/man8/cryptconfig.8.gz
%changelog -n cryptconfig
+* Thu Feb 15 2007 - crivera@suse.de
+- Use 64-bit version of lseek() when creating and enlarging
+ images. This fixes 245632.
* Mon Feb 12 2007 - crivera@suse.de
- Search for the full path when looking for the
loop device an image is using.
++++++ cryptconfig-0.1.0.tar.gz ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/cryptconfig-0.1.0/ChangeLog new/cryptconfig-0.1.0/ChangeLog
--- old/cryptconfig-0.1.0/ChangeLog 2007-02-12 22:06:04.000000000 +0100
+++ new/cryptconfig-0.1.0/ChangeLog 2007-02-14 23:56:50.000000000 +0100
@@ -1,3 +1,8 @@
+2007-02-14 Chris Rivera
+
+ * src/cryptconfig-lib.c: Use 64-bit versions of lseek ()
+ when enlarging and creating an image.
+
2007-02-05 Chris Rivera
* run-cc-tests.py: New file for unit tests.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/cryptconfig-0.1.0/src/cryptconfig-lib.c new/cryptconfig-0.1.0/src/cryptconfig-lib.c
--- old/cryptconfig-0.1.0/src/cryptconfig-lib.c 2007-02-12 22:12:04.000000000 +0100
+++ new/cryptconfig-0.1.0/src/cryptconfig-lib.c 2007-02-14 23:53:07.000000000 +0100
@@ -18,6 +18,9 @@
*
*/
+#define _GNU_SOURCE
+#define _LARGEFILE64_SOURCE
+
#include
#include
#include
@@ -896,15 +899,18 @@
*/
gboolean create_image_zero (const char *image, int size_in_mb)
{
- int fd = open (image, O_WRONLY | O_CREAT | O_TRUNC, 0600);
- if (fd == -1)
+ long long bytes = (long long) size_in_mb * 1048576;
+ int fd = open (image, O_WRONLY | O_CREAT | O_TRUNC | O_LARGEFILE, 0600);
+ if (fd == -1) {
+ g_printerr ("open: %s\n", strerror (errno));
return FALSE;
+ }
- if (lseek (fd, size_in_mb * 1048576, SEEK_END) == -1) {
+ if (lseek64 (fd, bytes, SEEK_END) == -1) {
close (fd);
return FALSE;
}
-
+
if (write (fd, "\0", 1) == -1) {
g_printerr ("write: %s\n", strerror (errno));
close (fd);
@@ -920,12 +926,12 @@
*/
gboolean create_image_random (const char *image, int size_in_mb)
{
+ long long total = 0, target = (long long) size_in_mb * 1048576;
int fd, randfd;
gboolean ret;
- size_t total = 0, target = size_in_mb * 1048576;
char buff[BUFSIZ];
- fd = open (image, O_WRONLY | O_CREAT | O_TRUNC, 0600);
+ fd = open (image, O_WRONLY | O_CREAT | O_TRUNC | O_LARGEFILE, 0600);
if (fd == -1) {
g_printerr ("open: %s\n", strerror (errno));
return FALSE;
@@ -1286,17 +1292,14 @@
*/
gboolean enlarge_image (const char *image, int size_to_add_in_mb)
{
- int fd;
-
- g_assert (size_to_add_in_mb > 0);
-
- fd = open (image, O_WRONLY);
+ off64_t total = (off64_t) size_to_add_in_mb * 1048576;
+ int fd = open (image, O_WRONLY | O_LARGEFILE);
if (fd == -1) {
g_printerr ("open: %s\n", strerror (errno));
return FALSE;
}
- if (lseek (fd, size_to_add_in_mb * 1048576, SEEK_END) == -1) {
+ if (lseek64 (fd, total, SEEK_END) == -1) {
close (fd);
return FALSE;
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org