From a7b4e21911d9f3c9650826a63b0fd44a8dbca737 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Apr 16 2012 12:40:52 +0000 Subject: Apply 1 latest change(s) from f16 branch --- diff --git a/ecryptfs-utils-75-werror.patch b/ecryptfs-utils-75-werror.patch index fa58946..a76a825 100644 --- a/ecryptfs-utils-75-werror.patch +++ b/ecryptfs-utils-75-werror.patch @@ -1,6 +1,6 @@ -diff -up ecryptfs-utils-93/src/key_mod/ecryptfs_key_mod_pkcs11_helper.c.werror ecryptfs-utils-93/src/key_mod/ecryptfs_key_mod_pkcs11_helper.c ---- ecryptfs-utils-93/src/key_mod/ecryptfs_key_mod_pkcs11_helper.c.werror 2011-10-31 14:18:18.136758412 +0100 -+++ ecryptfs-utils-93/src/key_mod/ecryptfs_key_mod_pkcs11_helper.c 2011-10-31 14:18:18.156758569 +0100 +diff -up ecryptfs-utils-96/src/key_mod/ecryptfs_key_mod_pkcs11_helper.c.werror ecryptfs-utils-96/src/key_mod/ecryptfs_key_mod_pkcs11_helper.c +--- ecryptfs-utils-96/src/key_mod/ecryptfs_key_mod_pkcs11_helper.c.werror 2012-02-21 14:42:39.625960362 +0100 ++++ ecryptfs-utils-96/src/key_mod/ecryptfs_key_mod_pkcs11_helper.c 2012-02-21 14:42:39.640960446 +0100 @@ -86,7 +86,7 @@ static int ecryptfs_pkcs11h_deserialize( pkcs11h_data->serialized_id = NULL; } @@ -150,9 +150,9 @@ diff -up ecryptfs-utils-93/src/key_mod/ecryptfs_key_mod_pkcs11_helper.c.werror e subgraph_key_ctx = (struct pkcs11h_subgraph_key_ctx *)(*foo); -diff -up ecryptfs-utils-93/src/libecryptfs/ecryptfs-stat.c.werror ecryptfs-utils-93/src/libecryptfs/ecryptfs-stat.c ---- ecryptfs-utils-93/src/libecryptfs/ecryptfs-stat.c.werror 2011-10-27 17:53:07.000000000 +0200 -+++ ecryptfs-utils-93/src/libecryptfs/ecryptfs-stat.c 2011-10-31 14:18:18.157758576 +0100 +diff -up ecryptfs-utils-96/src/libecryptfs/ecryptfs-stat.c.werror ecryptfs-utils-96/src/libecryptfs/ecryptfs-stat.c +--- ecryptfs-utils-96/src/libecryptfs/ecryptfs-stat.c.werror 2011-12-14 00:01:38.000000000 +0100 ++++ ecryptfs-utils-96/src/libecryptfs/ecryptfs-stat.c 2012-02-21 14:42:39.640960446 +0100 @@ -146,7 +146,7 @@ int ecryptfs_parse_stat(struct ecryptfs_ if (buf_size < (ECRYPTFS_FILE_SIZE_BYTES + MAGIC_ECRYPTFS_MARKER_SIZE_BYTES @@ -162,9 +162,9 @@ diff -up ecryptfs-utils-93/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-93/src/pam_ecryptfs/pam_ecryptfs.c.werror ecryptfs-utils-93/src/pam_ecryptfs/pam_ecryptfs.c ---- ecryptfs-utils-93/src/pam_ecryptfs/pam_ecryptfs.c.werror 2011-10-27 17:53:07.000000000 +0200 -+++ ecryptfs-utils-93/src/pam_ecryptfs/pam_ecryptfs.c 2011-10-31 14:18:29.644847653 +0100 +diff -up ecryptfs-utils-96/src/pam_ecryptfs/pam_ecryptfs.c.werror ecryptfs-utils-96/src/pam_ecryptfs/pam_ecryptfs.c +--- ecryptfs-utils-96/src/pam_ecryptfs/pam_ecryptfs.c.werror 2011-12-14 00:01:38.000000000 +0100 ++++ ecryptfs-utils-96/src/pam_ecryptfs/pam_ecryptfs.c 2012-02-21 14:42:39.640960446 +0100 @@ -39,35 +39,11 @@ #include #include @@ -258,9 +258,9 @@ diff -up ecryptfs-utils-93/src/pam_ecryptfs/pam_ecryptfs.c.werror ecryptfs-utils goto out; } saved_uid = geteuid(); -diff -up ecryptfs-utils-93/src/utils/mount.ecryptfs.c.werror ecryptfs-utils-93/src/utils/mount.ecryptfs.c ---- ecryptfs-utils-93/src/utils/mount.ecryptfs.c.werror 2011-10-31 14:18:18.153758546 +0100 -+++ ecryptfs-utils-93/src/utils/mount.ecryptfs.c 2011-10-31 14:18:18.158758583 +0100 +diff -up ecryptfs-utils-96/src/utils/mount.ecryptfs.c.werror ecryptfs-utils-96/src/utils/mount.ecryptfs.c +--- ecryptfs-utils-96/src/utils/mount.ecryptfs.c.werror 2012-02-21 14:42:39.637960431 +0100 ++++ ecryptfs-utils-96/src/utils/mount.ecryptfs.c 2012-02-21 14:42:39.641960452 +0100 @@ -461,7 +461,7 @@ static int ecryptfs_do_mount(int argc, c { int rc; @@ -279,9 +279,9 @@ diff -up ecryptfs-utils-93/src/utils/mount.ecryptfs.c.werror ecryptfs-utils-93/s if (!(temp = strdup("ecryptfs_unlink_sigs"))) { rc = -ENOMEM; goto out; -diff -up ecryptfs-utils-93/src/utils/mount.ecryptfs_private.c.werror ecryptfs-utils-93/src/utils/mount.ecryptfs_private.c ---- ecryptfs-utils-93/src/utils/mount.ecryptfs_private.c.werror 2011-10-31 14:18:18.146758491 +0100 -+++ ecryptfs-utils-93/src/utils/mount.ecryptfs_private.c 2011-10-31 14:18:18.158758583 +0100 +diff -up ecryptfs-utils-96/src/utils/mount.ecryptfs_private.c.werror ecryptfs-utils-96/src/utils/mount.ecryptfs_private.c +--- ecryptfs-utils-96/src/utils/mount.ecryptfs_private.c.werror 2012-02-21 14:42:39.630960389 +0100 ++++ ecryptfs-utils-96/src/utils/mount.ecryptfs_private.c 2012-02-21 14:42:39.641960452 +0100 @@ -95,7 +95,6 @@ int read_config(char *pw_dir, int uid, c *s = strdup(e->mnt_fsname); if (!*s) @@ -299,9 +299,9 @@ diff -up ecryptfs-utils-93/src/utils/mount.ecryptfs_private.c.werror ecryptfs-ut if (addmntent(new_mtab, old_ent) != 0) { perror("addmntent"); goto fail; -diff -up ecryptfs-utils-93/src/utils/test.c.werror ecryptfs-utils-93/src/utils/test.c ---- ecryptfs-utils-93/src/utils/test.c.werror 2011-10-27 17:53:07.000000000 +0200 -+++ ecryptfs-utils-93/src/utils/test.c 2011-10-31 14:18:18.159758591 +0100 +diff -up ecryptfs-utils-96/src/utils/test.c.werror ecryptfs-utils-96/src/utils/test.c +--- ecryptfs-utils-96/src/utils/test.c.werror 2011-12-14 00:01:38.000000000 +0100 ++++ ecryptfs-utils-96/src/utils/test.c 2012-02-21 14:42:39.642960459 +0100 @@ -281,7 +281,7 @@ int ecryptfs_encrypt_page(int page_cache struct inode *lower_inode; struct ecryptfs_crypt_stat *crypt_stat; @@ -311,3 +311,94 @@ diff -up ecryptfs-utils-93/src/utils/test.c.werror ecryptfs-utils-93/src/utils/t int orig_byte_offset = 0; int num_extents_per_page; #define ECRYPTFS_PAGE_STATE_UNREAD 0 +diff -up ecryptfs-utils-96/tests/kernel/directory-concurrent/test.c.werror ecryptfs-utils-96/tests/kernel/directory-concurrent/test.c +--- ecryptfs-utils-96/tests/kernel/directory-concurrent/test.c.werror 2012-02-13 17:30:32.000000000 +0100 ++++ ecryptfs-utils-96/tests/kernel/directory-concurrent/test.c 2012-02-21 14:42:39.642960459 +0100 +@@ -149,7 +149,7 @@ int hang_check(int option, const char *f + + int test_dirs(const char *path, const int max_dirs) + { +- int i, j; ++ int i/*, j*/; + char *filename; + size_t len = strlen(path) + 32; + int ret = TEST_PASSED; +diff -up ecryptfs-utils-96/tests/kernel/file-concurrent/test.c.werror ecryptfs-utils-96/tests/kernel/file-concurrent/test.c +--- ecryptfs-utils-96/tests/kernel/file-concurrent/test.c.werror 2012-02-13 17:30:32.000000000 +0100 ++++ ecryptfs-utils-96/tests/kernel/file-concurrent/test.c 2012-02-21 14:42:39.642960459 +0100 +@@ -178,7 +178,7 @@ int hang_check(int option, const char *f + + int test_dirs(const char *path, const int max_files) + { +- int i, j; ++ int i; + char *filename; + size_t len = strlen(path) + 32; + int ret = TEST_PASSED; +diff -up ecryptfs-utils-96/tests/kernel/inode-race-stat/test.c.werror ecryptfs-utils-96/tests/kernel/inode-race-stat/test.c +--- ecryptfs-utils-96/tests/kernel/inode-race-stat/test.c.werror 2012-02-21 14:43:30.646252841 +0100 ++++ ecryptfs-utils-96/tests/kernel/inode-race-stat/test.c 2012-02-21 14:44:11.720488580 +0100 +@@ -106,7 +106,6 @@ static void do_test(const int fdin, cons + { + for (;;) { + int n; +- int ret; + char cmd[32]; + + if ((n = read(fdin, cmd, sizeof(cmd))) < 1) { +@@ -347,6 +346,7 @@ abort: + int ret; + + ret = write(pipe_to[i][1], cmd, 1); ++ (void)ret; + (void)waitpid(pids[i], &status, 0); + + (void)close(pipe_to[i][1]); +diff -up ecryptfs-utils-96/tests/kernel/trunc-file/test.c.werror ecryptfs-utils-96/tests/kernel/trunc-file/test.c +--- ecryptfs-utils-96/tests/kernel/trunc-file/test.c.werror 2012-02-13 17:30:32.000000000 +0100 ++++ ecryptfs-utils-96/tests/kernel/trunc-file/test.c 2012-02-21 14:42:39.643960466 +0100 +@@ -39,7 +39,7 @@ + + int write_buff(int fd, unsigned char *data, ssize_t size) + { +- char *ptr = data; ++ unsigned char *ptr = data; + ssize_t n; + ssize_t sz = size; + +@@ -55,7 +55,7 @@ int write_buff(int fd, unsigned char *da + + int read_buff(int fd, unsigned char *data, ssize_t size) + { +- char *ptr = data; ++ unsigned char *ptr = data; + ssize_t n; + ssize_t sz = size; + +@@ -88,6 +88,7 @@ int test_write_random(char *filename, in + } + buflen -= n; + } ++ return TEST_PASSED; + } + + int test_read_random(char *filename, int fd, unsigned char *buff, ssize_t size) +@@ -157,9 +158,6 @@ int test_read_rest(char *filename, int f + int test_exercise(char *filename, ssize_t size) + { + int fd; +- ssize_t i; +- ssize_t n; +- ssize_t buflen; + int ret = TEST_FAILED; + ssize_t trunc_size = size / 2; + struct stat statbuf; +@@ -254,8 +252,6 @@ void sighandler(int dummy) + int main(int argc, char **argv) + { + off_t len = DEFAULT_SIZE; +- int i; +- int ret; + + if (argc < 2) { + fprintf(stderr, "Syntax: %s filename [size_in_K]\n", argv[0]); diff --git a/ecryptfs-utils.spec b/ecryptfs-utils.spec index 2c6d5c8..e0f96e0 100644 --- a/ecryptfs-utils.spec +++ b/ecryptfs-utils.spec @@ -121,7 +121,7 @@ the interface supplied by the ecryptfs-utils library. export CFLAGS="$RPM_OPT_FLAGS -Werror -Wtype-limits" #we're modifing Makefile.am autoreconf -fiv -%configure --disable-rpath --enable-tspi --enable-nss --enable-pkcs11-helper +%configure --disable-rpath --enable-tspi --enable-nss --enable-pkcs11-helper --enable-tests make clean #disable rpath sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool @@ -159,6 +159,7 @@ if ldd $RPM_BUILD_ROOT%{_sbindir}/umount.ecryptfs | grep -q '/usr/' then exit 1 fi +make check %pre groupadd -r -f ecryptfs