[ecryptfs-utils] - fix unsigned < 0 test (#664474)

Michal Hlavinka mhlavink at fedoraproject.org
Tue Jan 4 13:33:31 UTC 2011


commit 9f5906aaff2bdac09bc677f3996d633fe9274006
Author: Michal Hlavinka <mhlavink at redhat.com>
Date:   Tue Jan 4 14:33:19 2011 +0100

    - fix unsigned < 0 test (#664474)

 ecryptfs-utils-75-werror.patch     |   33 +++++++++++++++++++++------------
 ecryptfs-utils-84-fixsigness.patch |   21 +++++++++++++++++++++
 ecryptfs-utils.spec                |   11 +++++++++--
 3 files changed, 51 insertions(+), 14 deletions(-)
---
diff --git a/ecryptfs-utils-75-werror.patch b/ecryptfs-utils-75-werror.patch
index 1d51c0f..ee65fc4 100644
--- a/ecryptfs-utils-75-werror.patch
+++ b/ecryptfs-utils-75-werror.patch
@@ -1,6 +1,6 @@
-diff -up ecryptfs-utils-83/src/key_mod/ecryptfs_key_mod_pkcs11_helper.c.werror ecryptfs-utils-83/src/key_mod/ecryptfs_key_mod_pkcs11_helper.c
---- ecryptfs-utils-83/src/key_mod/ecryptfs_key_mod_pkcs11_helper.c.werror	2009-10-20 20:49:55.000000000 +0200
-+++ ecryptfs-utils-83/src/key_mod/ecryptfs_key_mod_pkcs11_helper.c	2010-07-26 16:00:32.940815978 +0200
+diff -up ecryptfs-utils-84/src/key_mod/ecryptfs_key_mod_pkcs11_helper.c.werror ecryptfs-utils-84/src/key_mod/ecryptfs_key_mod_pkcs11_helper.c
+--- ecryptfs-utils-84/src/key_mod/ecryptfs_key_mod_pkcs11_helper.c.werror	2010-12-17 18:34:04.000000000 +0100
++++ ecryptfs-utils-84/src/key_mod/ecryptfs_key_mod_pkcs11_helper.c	2011-01-04 14:15:47.117777798 +0100
 @@ -86,7 +86,7 @@ static int ecryptfs_pkcs11h_deserialize(
  		pkcs11h_data->serialized_id = NULL;
  	}
@@ -141,9 +141,18 @@ diff -up ecryptfs-utils-83/src/key_mod/ecryptfs_key_mod_pkcs11_helper.c.werror e
  	return rc;
  }
  
-diff -up ecryptfs-utils-83/src/libecryptfs/ecryptfs-stat.c.werror ecryptfs-utils-83/src/libecryptfs/ecryptfs-stat.c
---- ecryptfs-utils-83/src/libecryptfs/ecryptfs-stat.c.werror	2009-10-20 20:49:55.000000000 +0200
-+++ ecryptfs-utils-83/src/libecryptfs/ecryptfs-stat.c	2010-07-26 16:00:32.940815978 +0200
+@@ -1120,7 +1119,7 @@ static int tf_pkcs11h_key_x509file(struc
+ 	X509 *x509 = NULL;
+ 	unsigned char *p = NULL;
+ 	FILE *fp = NULL;
+-	int rc;
++	int rc = 0;
+ 
+ 	subgraph_key_ctx = (struct pkcs11h_subgraph_key_ctx *)(*foo);
+ 
+diff -up ecryptfs-utils-84/src/libecryptfs/ecryptfs-stat.c.werror ecryptfs-utils-84/src/libecryptfs/ecryptfs-stat.c
+--- ecryptfs-utils-84/src/libecryptfs/ecryptfs-stat.c.werror	2010-12-17 18:34:04.000000000 +0100
++++ ecryptfs-utils-84/src/libecryptfs/ecryptfs-stat.c	2011-01-04 14:13:41.746022440 +0100
 @@ -146,7 +146,7 @@ int ecryptfs_parse_stat(struct ecryptfs_
  	if (buf_size < (ECRYPTFS_FILE_SIZE_BYTES
  			+ MAGIC_ECRYPTFS_MARKER_SIZE_BYTES
@@ -153,9 +162,9 @@ diff -up ecryptfs-utils-83/src/libecryptfs/ecryptfs-stat.c.werror ecryptfs-utils
  		       "bytes; there are only [%zu] bytes\n", __FUNCTION__,
  		       (ECRYPTFS_FILE_SIZE_BYTES
  			+ MAGIC_ECRYPTFS_MARKER_SIZE_BYTES
-diff -up ecryptfs-utils-83/src/pam_ecryptfs/pam_ecryptfs.c.werror ecryptfs-utils-83/src/pam_ecryptfs/pam_ecryptfs.c
---- ecryptfs-utils-83/src/pam_ecryptfs/pam_ecryptfs.c.werror	2010-02-16 18:01:43.000000000 +0100
-+++ ecryptfs-utils-83/src/pam_ecryptfs/pam_ecryptfs.c	2010-07-26 16:00:32.947753593 +0200
+diff -up ecryptfs-utils-84/src/pam_ecryptfs/pam_ecryptfs.c.werror ecryptfs-utils-84/src/pam_ecryptfs/pam_ecryptfs.c
+--- ecryptfs-utils-84/src/pam_ecryptfs/pam_ecryptfs.c.werror	2010-12-17 18:34:04.000000000 +0100
++++ ecryptfs-utils-84/src/pam_ecryptfs/pam_ecryptfs.c	2011-01-04 14:13:41.747022438 +0100
 @@ -43,31 +43,6 @@
  
  #define PRIVATE_DIR "Private"
@@ -233,9 +242,9 @@ diff -up ecryptfs-utils-83/src/pam_ecryptfs/pam_ecryptfs.c.werror ecryptfs-utils
  		goto out;
  	}
  	saved_uid = geteuid();
-diff -up ecryptfs-utils-83/src/utils/test.c.werror ecryptfs-utils-83/src/utils/test.c
---- ecryptfs-utils-83/src/utils/test.c.werror	2010-07-26 16:03:39.171940344 +0200
-+++ ecryptfs-utils-83/src/utils/test.c	2010-07-26 16:03:39.227817822 +0200
+diff -up ecryptfs-utils-84/src/utils/test.c.werror ecryptfs-utils-84/src/utils/test.c
+--- ecryptfs-utils-84/src/utils/test.c.werror	2010-12-17 18:34:04.000000000 +0100
++++ ecryptfs-utils-84/src/utils/test.c	2011-01-04 14:13:41.750022429 +0100
 @@ -281,7 +281,7 @@ int ecryptfs_encrypt_page(int page_cache
  	struct inode *lower_inode;
  	struct ecryptfs_crypt_stat *crypt_stat;
diff --git a/ecryptfs-utils-84-fixsigness.patch b/ecryptfs-utils-84-fixsigness.patch
new file mode 100644
index 0000000..5a07520
--- /dev/null
+++ b/ecryptfs-utils-84-fixsigness.patch
@@ -0,0 +1,21 @@
+diff -up ecryptfs-utils-84/src/key_mod/ecryptfs_key_mod_pkcs11_helper.c.fixsigness ecryptfs-utils-84/src/key_mod/ecryptfs_key_mod_pkcs11_helper.c
+--- ecryptfs-utils-84/src/key_mod/ecryptfs_key_mod_pkcs11_helper.c.fixsigness	2011-01-04 14:15:58.711761181 +0100
++++ ecryptfs-utils-84/src/key_mod/ecryptfs_key_mod_pkcs11_helper.c	2011-01-04 14:15:58.744761153 +0100
+@@ -1144,7 +1144,7 @@ static int tf_pkcs11h_key_x509file(struc
+ 			goto out;
+ 		}
+ 
+-		if ((subgraph_key_ctx->pkcs11h_data.certificate_blob_size = i2d_X509 (x509, NULL)) < 0	) {
++		if ((ssize_t)(subgraph_key_ctx->pkcs11h_data.certificate_blob_size = i2d_X509 (x509, NULL)) < 0	) {
+ 			syslog(LOG_ERR, "PKCS#11: Cannot read decode certificate");
+ 			rc = -EIO;
+ 			goto out;
+@@ -1165,7 +1165,7 @@ static int tf_pkcs11h_key_x509file(struc
+ 		 */
+ 		p = subgraph_key_ctx->pkcs11h_data.certificate_blob;
+ 
+-		if ((subgraph_key_ctx->pkcs11h_data.certificate_blob_size = i2d_X509 (x509, &p)) < 0) {
++		if ((ssize_t)(subgraph_key_ctx->pkcs11h_data.certificate_blob_size = i2d_X509 (x509, &p)) < 0) {
+ 			syslog(LOG_ERR, "PKCS#11: Cannot read decode certificate");
+ 			goto out;
+ 		}
diff --git a/ecryptfs-utils.spec b/ecryptfs-utils.spec
index e6b3de9..4bd29dc 100644
--- a/ecryptfs-utils.spec
+++ b/ecryptfs-utils.spec
@@ -5,7 +5,7 @@
 
 Name: ecryptfs-utils
 Version: 84
-Release: 1%{?dist}
+Release: 2%{?dist}
 Summary: The eCryptfs mount helper and support libraries
 Group: System Environment/Base
 License: GPLv2+
@@ -26,6 +26,9 @@ Patch3: ecryptfs-utils-83-fixsalt.patch
 # fedora/rhel specific, rhbz#486139, remove nss dependency from umount.ecryptfs
 Patch4: ecryptfs-utils-83-splitnss.patch
 
+# rhbz#664474, fix unsigned < 0 test
+Patch5: ecryptfs-utils-84-fixsigness.patch
+
 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 Requires: keyutils, cryptsetup-luks, util-linux-ng, gettext
 BuildRequires: libgcrypt-devel keyutils-libs-devel openssl-devel pam-devel
@@ -67,9 +70,10 @@ the interface supplied by the ecryptfs-utils library.
 %patch2 -p1 -b .nocryptdisks
 %patch3 -p1 -b .fixsalt
 %patch4 -p1 -b .splitnss
+%patch5 -p1 -b .fixsigness
 
 %build
-export CFLAGS="$RPM_OPT_FLAGS -ggdb -O2 -Werror"
+export CFLAGS="$RPM_OPT_FLAGS -ggdb -O2 -Werror -Wtype-limits"
 #we're modifing Makefile.am
 autoreconf -fiv
 %configure --disable-rpath --enable-tspi --enable-nss --enable-pkcs11-helper
@@ -194,6 +198,9 @@ rm -rf $RPM_BUILD_ROOT
 %{python_sitearch}/ecryptfs-utils/_libecryptfs.so
 
 %changelog
+* Mon Jan 04 2011 Michal Hlavinka <mhlavink at redhat.com> - 84-2
+- fix unsigned < 0 test (#664474)
+
 * Mon Dec 20 2010 Michal Hlavinka <mhlavink at redhat.com> - 84-1
 - ecryptfs-utils updated to 84
 


More information about the scm-commits mailing list