|
|
a7b4e2 |
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
|
|
|
20a2a6 |
--- ecryptfs-utils-96/src/key_mod/ecryptfs_key_mod_pkcs11_helper.c.werror 2012-06-04 14:47:13.021862738 +0200
|
|
|
20a2a6 |
+++ ecryptfs-utils-96/src/key_mod/ecryptfs_key_mod_pkcs11_helper.c 2012-06-04 14:47:13.036862853 +0200
|
|
Michal Hlavinka |
79c27c |
@@ -86,7 +86,7 @@ static int ecryptfs_pkcs11h_deserialize(
|
|
Michal Hlavinka |
79c27c |
pkcs11h_data->serialized_id = NULL;
|
|
Michal Hlavinka |
79c27c |
}
|
|
Michal Hlavinka |
79c27c |
else {
|
|
Michal Hlavinka |
79c27c |
- pkcs11h_data->serialized_id = blob + i;
|
|
Michal Hlavinka |
79c27c |
+ pkcs11h_data->serialized_id = (char *)blob + i;
|
|
Michal Hlavinka |
79c27c |
i += serialized_id_length;
|
|
Michal Hlavinka |
79c27c |
}
|
|
Michal Hlavinka |
79c27c |
pkcs11h_data->certificate_blob_size = blob[i++] % 256;
|
|
Michal Hlavinka |
79c27c |
@@ -104,12 +104,11 @@ static int ecryptfs_pkcs11h_deserialize(
|
|
Michal Hlavinka |
79c27c |
pkcs11h_data->passphrase = NULL;
|
|
Michal Hlavinka |
79c27c |
}
|
|
Michal Hlavinka |
79c27c |
else {
|
|
Michal Hlavinka |
79c27c |
- pkcs11h_data->passphrase = blob + i;
|
|
Michal Hlavinka |
79c27c |
+ pkcs11h_data->passphrase = (char *)blob + i;
|
|
Michal Hlavinka |
79c27c |
i += passphrase_length;
|
|
Michal Hlavinka |
79c27c |
}
|
|
Michal Hlavinka |
79c27c |
|
|
Michal Hlavinka |
79c27c |
rc = 0;
|
|
Michal Hlavinka |
79c27c |
-out:
|
|
Michal Hlavinka |
79c27c |
return rc;
|
|
Michal Hlavinka |
79c27c |
}
|
|
Michal Hlavinka |
79c27c |
|
|
Michal Hlavinka |
79c27c |
@@ -346,14 +345,14 @@ static int ecryptfs_pkcs11h_get_key_sig(
|
|
Michal Hlavinka |
79c27c |
data[i++] = '\02';
|
|
Michal Hlavinka |
79c27c |
data[i++] = (char)(nbits >> 8);
|
|
Michal Hlavinka |
79c27c |
data[i++] = (char)nbits;
|
|
Michal Hlavinka |
79c27c |
- BN_bn2bin(rsa->n, &(data[i]));
|
|
Michal Hlavinka |
79c27c |
+ BN_bn2bin(rsa->n, (unsigned char *)&(data[i]));
|
|
Michal Hlavinka |
79c27c |
i += nbytes;
|
|
Michal Hlavinka |
79c27c |
data[i++] = (char)(ebits >> 8);
|
|
Michal Hlavinka |
79c27c |
data[i++] = (char)ebits;
|
|
Michal Hlavinka |
79c27c |
- BN_bn2bin(rsa->e, &(data[i]));
|
|
Michal Hlavinka |
79c27c |
+ BN_bn2bin(rsa->e, (unsigned char *)&(data[i]));
|
|
Michal Hlavinka |
79c27c |
i += ebytes;
|
|
Michal Hlavinka |
79c27c |
- SHA1(data, len + 3, hash);
|
|
Michal Hlavinka |
79c27c |
- to_hex(sig, hash, ECRYPTFS_SIG_SIZE);
|
|
Michal Hlavinka |
79c27c |
+ SHA1((unsigned char *)data, len + 3, (unsigned char *)hash);
|
|
Michal Hlavinka |
79c27c |
+ to_hex((char *)sig, hash, ECRYPTFS_SIG_SIZE);
|
|
Michal Hlavinka |
79c27c |
sig[ECRYPTFS_SIG_SIZE_HEX] = '\0';
|
|
Michal Hlavinka |
79c27c |
|
|
Michal Hlavinka |
79c27c |
rc = 0;
|
|
Michal Hlavinka |
79c27c |
@@ -411,8 +410,8 @@ static int ecryptfs_pkcs11h_encrypt(char
|
|
Michal Hlavinka |
79c27c |
if (
|
|
Michal Hlavinka |
79c27c |
(rc = RSA_public_encrypt(
|
|
Michal Hlavinka |
79c27c |
from_size,
|
|
Michal Hlavinka |
79c27c |
- from,
|
|
Michal Hlavinka |
79c27c |
- to,
|
|
Michal Hlavinka |
79c27c |
+ (unsigned char *)from,
|
|
Michal Hlavinka |
79c27c |
+ (unsigned char *)to,
|
|
Michal Hlavinka |
79c27c |
rsa,
|
|
Michal Hlavinka |
79c27c |
RSA_PKCS1_PADDING
|
|
Michal Hlavinka |
79c27c |
)) == -1
|
|
Michal Hlavinka |
79c27c |
@@ -506,9 +505,9 @@ static int ecryptfs_pkcs11h_decrypt(char
|
|
Michal Hlavinka |
79c27c |
(rv = pkcs11h_certificate_decryptAny (
|
|
Michal Hlavinka |
79c27c |
certificate,
|
|
Michal Hlavinka |
79c27c |
CKM_RSA_PKCS,
|
|
Michal Hlavinka |
79c27c |
- from,
|
|
Michal Hlavinka |
79c27c |
+ (unsigned char *)from,
|
|
Michal Hlavinka |
79c27c |
from_size,
|
|
Michal Hlavinka |
79c27c |
- to,
|
|
Michal Hlavinka |
79c27c |
+ (unsigned char *)to,
|
|
Michal Hlavinka |
79c27c |
to_size
|
|
Michal Hlavinka |
79c27c |
)) != CKR_OK
|
|
Michal Hlavinka |
79c27c |
) {
|
|
Michal Hlavinka |
79c27c |
@@ -534,9 +533,9 @@ static int ecryptfs_pkcs11h_decrypt(char
|
|
Michal Hlavinka |
79c27c |
pkcs11h_certificate_decryptAny (
|
|
Michal Hlavinka |
79c27c |
certificate,
|
|
Michal Hlavinka |
79c27c |
CKM_RSA_PKCS,
|
|
Michal Hlavinka |
79c27c |
- from,
|
|
Michal Hlavinka |
79c27c |
+ (unsigned char *)from,
|
|
Michal Hlavinka |
79c27c |
from_size,
|
|
Michal Hlavinka |
79c27c |
- tmp,
|
|
Michal Hlavinka |
79c27c |
+ (unsigned char *)tmp,
|
|
Michal Hlavinka |
79c27c |
to_size
|
|
Michal Hlavinka |
79c27c |
);
|
|
Michal Hlavinka |
79c27c |
|
|
Michal Hlavinka |
79c27c |
@@ -851,7 +850,7 @@ static int ecryptfs_pkcs11h_process_key(
|
|
Michal Hlavinka |
79c27c |
rc = MOUNT_ERROR;
|
|
Michal Hlavinka |
79c27c |
goto out;
|
|
Michal Hlavinka |
79c27c |
}
|
|
Michal Hlavinka |
79c27c |
- if ((rc = ecryptfs_pkcs11h_serialize(subgraph_key_ctx->key_mod->blob,
|
|
Michal Hlavinka |
79c27c |
+ if ((rc = ecryptfs_pkcs11h_serialize((unsigned char *)subgraph_key_ctx->key_mod->blob,
|
|
Michal Hlavinka |
79c27c |
&subgraph_key_ctx->key_mod->blob_size,
|
|
Michal Hlavinka |
79c27c |
pkcs11h_data))) {
|
|
Michal Hlavinka |
79c27c |
syslog(LOG_ERR, "PKCS#11: Error serializing pkcs11; rc=[%d]\n", rc);
|
|
Michal Hlavinka |
79c27c |
@@ -930,7 +929,7 @@ static int tf_pkcs11h_global_loglevel(st
|
|
Michal Hlavinka |
79c27c |
|
|
Michal Hlavinka |
79c27c |
rc = DEFAULT_TOK;
|
|
Michal Hlavinka |
79c27c |
node->val = NULL;
|
|
Michal Hlavinka |
79c27c |
-out:
|
|
Michal Hlavinka |
79c27c |
+// out:
|
|
Michal Hlavinka |
79c27c |
return rc;
|
|
Michal Hlavinka |
79c27c |
}
|
|
Michal Hlavinka |
79c27c |
|
|
Michal Hlavinka |
79c27c |
@@ -943,7 +942,7 @@ static int tf_pkcs11h_global_pincache(st
|
|
Michal Hlavinka |
79c27c |
|
|
Michal Hlavinka |
79c27c |
rc = DEFAULT_TOK;
|
|
Michal Hlavinka |
79c27c |
node->val = NULL;
|
|
Michal Hlavinka |
79c27c |
-out:
|
|
Michal Hlavinka |
79c27c |
+// out:
|
|
Michal Hlavinka |
79c27c |
return rc;
|
|
Michal Hlavinka |
79c27c |
}
|
|
Michal Hlavinka |
79c27c |
|
|
Michal Hlavinka |
79c27c |
@@ -1013,7 +1012,7 @@ static int tf_pkcs11h_provider_prot_auth
|
|
Michal Hlavinka |
79c27c |
sscanf (node->val, "%x", &subgraph_provider_ctx->allow_protected_authentication);
|
|
Michal Hlavinka |
79c27c |
rc = DEFAULT_TOK;
|
|
Michal Hlavinka |
79c27c |
node->val = NULL;
|
|
Michal Hlavinka |
79c27c |
-out:
|
|
Michal Hlavinka |
79c27c |
+
|
|
Michal Hlavinka |
79c27c |
return rc;
|
|
Michal Hlavinka |
79c27c |
}
|
|
Michal Hlavinka |
79c27c |
|
|
Michal Hlavinka |
79c27c |
@@ -1027,7 +1026,7 @@ static int tf_pkcs11h_provider_cert_priv
|
|
Michal Hlavinka |
79c27c |
sscanf (node->val, "%x", &subgraph_provider_ctx->certificate_is_private);
|
|
Michal Hlavinka |
79c27c |
rc = DEFAULT_TOK;
|
|
Michal Hlavinka |
79c27c |
node->val = NULL;
|
|
Michal Hlavinka |
79c27c |
-out:
|
|
Michal Hlavinka |
79c27c |
+
|
|
Michal Hlavinka |
79c27c |
return rc;
|
|
Michal Hlavinka |
79c27c |
}
|
|
Michal Hlavinka |
79c27c |
|
|
Michal Hlavinka |
79c27c |
@@ -1042,7 +1041,7 @@ static int tf_pkcs11h_provider_private_m
|
|
Michal Hlavinka |
79c27c |
|
|
Michal Hlavinka |
79c27c |
rc = DEFAULT_TOK;
|
|
Michal Hlavinka |
79c27c |
node->val = NULL;
|
|
Michal Hlavinka |
79c27c |
-out:
|
|
Michal Hlavinka |
79c27c |
+
|
|
Michal Hlavinka |
79c27c |
return rc;
|
|
Michal Hlavinka |
79c27c |
}
|
|
Michal Hlavinka |
79c27c |
|
|
Michal Hlavinka |
79c27c |
@@ -1073,7 +1072,7 @@ static int tf_pkcs11h_provider_end(struc
|
|
Michal Hlavinka |
79c27c |
free(subgraph_provider_ctx);
|
|
Michal Hlavinka |
79c27c |
*foo = NULL;
|
|
Michal Hlavinka |
79c27c |
rc = DEFAULT_TOK;
|
|
Michal Hlavinka |
79c27c |
-out:
|
|
Michal Hlavinka |
79c27c |
+
|
|
Michal Hlavinka |
79c27c |
return rc;
|
|
Michal Hlavinka |
79c27c |
}
|
|
Michal Hlavinka |
79c27c |
|
|
|
9f5906 |
@@ -1120,7 +1119,7 @@ static int tf_pkcs11h_key_x509file(struc
|
|
|
9f5906 |
X509 *x509 = NULL;
|
|
|
9f5906 |
unsigned char *p = NULL;
|
|
|
9f5906 |
FILE *fp = NULL;
|
|
|
9f5906 |
- int rc;
|
|
|
9f5906 |
+ int rc = 0;
|
|
|
9f5906 |
|
|
|
9f5906 |
subgraph_key_ctx = (struct pkcs11h_subgraph_key_ctx *)(*foo);
|
|
|
9f5906 |
|
|
|
a7b4e2 |
diff -up ecryptfs-utils-96/src/libecryptfs/ecryptfs-stat.c.werror ecryptfs-utils-96/src/libecryptfs/ecryptfs-stat.c
|
|
|
a7b4e2 |
--- ecryptfs-utils-96/src/libecryptfs/ecryptfs-stat.c.werror 2011-12-14 00:01:38.000000000 +0100
|
|
|
20a2a6 |
+++ ecryptfs-utils-96/src/libecryptfs/ecryptfs-stat.c 2012-06-04 14:47:13.036862853 +0200
|
|
Michal Hlavinka |
14f112 |
@@ -146,7 +146,7 @@ int ecryptfs_parse_stat(struct ecryptfs_
|
|
Michal Hlavinka |
14f112 |
if (buf_size < (ECRYPTFS_FILE_SIZE_BYTES
|
|
Michal Hlavinka |
14f112 |
+ MAGIC_ECRYPTFS_MARKER_SIZE_BYTES
|
|
Michal Hlavinka |
14f112 |
+ 4)) {
|
|
Michal Hlavinka |
14f112 |
- printf("%s: Invalid metadata size; must have at least [%lu] "
|
|
Michal Hlavinka |
14f112 |
+ printf("%s: Invalid metadata size; must have at least [%zu] "
|
|
Michal Hlavinka |
14f112 |
"bytes; there are only [%zu] bytes\n", __FUNCTION__,
|
|
Michal Hlavinka |
14f112 |
(ECRYPTFS_FILE_SIZE_BYTES
|
|
Michal Hlavinka |
14f112 |
+ MAGIC_ECRYPTFS_MARKER_SIZE_BYTES
|
|
|
a7b4e2 |
diff -up ecryptfs-utils-96/src/pam_ecryptfs/pam_ecryptfs.c.werror ecryptfs-utils-96/src/pam_ecryptfs/pam_ecryptfs.c
|
|
|
a7b4e2 |
--- ecryptfs-utils-96/src/pam_ecryptfs/pam_ecryptfs.c.werror 2011-12-14 00:01:38.000000000 +0100
|
|
|
20a2a6 |
+++ ecryptfs-utils-96/src/pam_ecryptfs/pam_ecryptfs.c 2012-06-04 14:47:13.036862853 +0200
|
|
|
8813d2 |
@@ -39,35 +39,11 @@
|
|
|
8813d2 |
#include <sys/stat.h>
|
|
|
8813d2 |
#include <fcntl.h>
|
|
|
8813d2 |
#include <security/pam_modules.h>
|
|
|
8813d2 |
+#include <security/pam_ext.h>
|
|
|
8813d2 |
#include "../include/ecryptfs.h"
|
|
Michal Hlavinka |
a225d8 |
|
|
Michal Hlavinka |
538613 |
#define PRIVATE_DIR "Private"
|
|
Michal Hlavinka |
a225d8 |
|
|
Michal Hlavinka |
538613 |
-static void error(const char *msg)
|
|
Michal Hlavinka |
538613 |
-{
|
|
|
7731a0 |
- syslog(LOG_ERR, "pam_ecryptfs: errno = [%i]; strerror = [%m]\n", errno);
|
|
Michal Hlavinka |
538613 |
- switch (errno) {
|
|
Michal Hlavinka |
538613 |
- case ENOKEY:
|
|
|
7731a0 |
- syslog(LOG_ERR, "pam_ecryptfs: %s: Requested key not available\n", msg);
|
|
Michal Hlavinka |
538613 |
- return;
|
|
Michal Hlavinka |
538613 |
-
|
|
Michal Hlavinka |
538613 |
- case EKEYEXPIRED:
|
|
|
7731a0 |
- syslog(LOG_ERR, "pam_ecryptfs: %s: Key has expired\n", msg);
|
|
Michal Hlavinka |
538613 |
- return;
|
|
Michal Hlavinka |
538613 |
-
|
|
Michal Hlavinka |
538613 |
- case EKEYREVOKED:
|
|
|
7731a0 |
- syslog(LOG_ERR, "pam_ecryptfs: %s: Key has been revoked\n", msg);
|
|
Michal Hlavinka |
538613 |
- return;
|
|
Michal Hlavinka |
538613 |
-
|
|
Michal Hlavinka |
538613 |
- case EKEYREJECTED:
|
|
|
7731a0 |
- syslog(LOG_ERR, "pam_ecryptfs: %s: Key was rejected by service\n", msg);
|
|
Michal Hlavinka |
538613 |
- return;
|
|
Michal Hlavinka |
538613 |
- default:
|
|
|
7731a0 |
- syslog(LOG_ERR, "pam_ecryptfs: %s: Unknown key error\n", msg);
|
|
Michal Hlavinka |
538613 |
- return;
|
|
Michal Hlavinka |
538613 |
- }
|
|
Michal Hlavinka |
538613 |
-}
|
|
Michal Hlavinka |
538613 |
-
|
|
|
8813d2 |
/* returns: 0 if file does not exist, 1 if it exists, <0 for error */
|
|
|
8813d2 |
static int file_exists_dotecryptfs(const char *homedir, char *filename)
|
|
Michal Hlavinka |
538613 |
{
|
|
|
8813d2 |
@@ -87,7 +63,7 @@ out:
|
|
Michal Hlavinka |
c7231a |
return rc;
|
|
Michal Hlavinka |
c7231a |
}
|
|
Michal Hlavinka |
c7231a |
|
|
Michal Hlavinka |
c7231a |
-static int wrap_passphrase_if_necessary(char *username, uid_t uid, char *wrapped_pw_filename, char *passphrase, char *salt)
|
|
Michal Hlavinka |
c7231a |
+static int wrap_passphrase_if_necessary(const char *username, uid_t uid, char *wrapped_pw_filename, char *passphrase, char *salt)
|
|
Michal Hlavinka |
c7231a |
{
|
|
Michal Hlavinka |
c7231a |
char *unwrapped_pw_filename = NULL;
|
|
Michal Hlavinka |
c7231a |
struct stat s;
|
|
|
7731a0 |
@@ -195,8 +171,6 @@ PAM_EXTERN int pam_sm_authenticate(pam_h
|
|
Michal Hlavinka |
c7231a |
if ((argc == 1)
|
|
Michal Hlavinka |
c7231a |
&& (memcmp(argv[0], "unwrap\0", 7) == 0)) {
|
|
Michal Hlavinka |
c7231a |
char *wrapped_pw_filename;
|
|
Michal Hlavinka |
c7231a |
- char *unwrapped_pw_filename;
|
|
Michal Hlavinka |
c7231a |
- struct stat s;
|
|
Michal Hlavinka |
c7231a |
|
|
Michal Hlavinka |
c7231a |
rc = asprintf(
|
|
Michal Hlavinka |
c7231a |
&wrapped_pw_filename, "%s/.ecryptfs/%s",
|
|
|
7731a0 |
@@ -282,8 +256,6 @@ static int private_dir(pam_handle_t *pam
|
|
Michal Hlavinka |
538613 |
char *autoumount = "auto-umount";
|
|
Michal Hlavinka |
538613 |
struct stat s;
|
|
Michal Hlavinka |
538613 |
pid_t pid;
|
|
Michal Hlavinka |
538613 |
- struct utmp *u;
|
|
Michal Hlavinka |
538613 |
- int count = 0;
|
|
Michal Hlavinka |
a225d8 |
|
|
Michal Hlavinka |
538613 |
if ((pwd = fetch_pwd(pamh)) == NULL) {
|
|
Michal Hlavinka |
538613 |
/* fetch_pwd() logged a message */
|
|
|
7731a0 |
@@ -329,7 +301,7 @@ static int private_dir(pam_handle_t *pam
|
|
Michal Hlavinka |
538613 |
if (stat(recorded, &s) != 0 && stat("/usr/share/ecryptfs-utils/ecryptfs-record-passphrase", &s) == 0) {
|
|
Michal Hlavinka |
538613 |
/* User has not recorded their passphrase */
|
|
Michal Hlavinka |
538613 |
unlink("/var/lib/update-notifier/user.d/ecryptfs-record-passphrase");
|
|
Michal Hlavinka |
538613 |
- symlink("/usr/share/ecryptfs-utils/ecryptfs-record-passphrase", "/var/lib/update-notifier/user.d/ecryptfs-record-passphrase");
|
|
Michal Hlavinka |
538613 |
+ rc=symlink("/usr/share/ecryptfs-utils/ecryptfs-record-passphrase", "/var/lib/update-notifier/user.d/ecryptfs-record-passphrase");
|
|
Michal Hlavinka |
538613 |
fd = open("/var/lib/update-notifier/dpkg-run-stamp", O_WRONLY|O_CREAT|O_NONBLOCK, 0666);
|
|
Michal Hlavinka |
538613 |
close(fd);
|
|
Michal Hlavinka |
538613 |
}
|
|
|
7731a0 |
@@ -398,7 +370,6 @@ PAM_EXTERN int pam_sm_chauthtok(pam_hand
|
|
|
5d320b |
char *old_passphrase = NULL;
|
|
|
5d320b |
char *new_passphrase = NULL;
|
|
|
5d320b |
char *wrapped_pw_filename;
|
|
|
5d320b |
- char *name = NULL;
|
|
|
5d320b |
char salt[ECRYPTFS_SALT_SIZE];
|
|
|
5d320b |
char salt_hex[ECRYPTFS_SALT_SIZE_HEX];
|
|
|
5d320b |
pid_t child_pid, tmp_pid;
|
|
|
7731a0 |
@@ -412,10 +383,9 @@ PAM_EXTERN int pam_sm_chauthtok(pam_hand
|
|
|
5d320b |
if (pwd) {
|
|
|
5d320b |
uid = pwd->pw_uid;
|
|
|
5d320b |
homedir = pwd->pw_dir;
|
|
|
5d320b |
- name = pwd->pw_name;
|
|
Michal Hlavinka |
538613 |
}
|
|
Michal Hlavinka |
538613 |
} else {
|
|
|
7731a0 |
- syslog(LOG_ERR, "pam_ecryptfs: Error getting passwd info for user [%s]; rc = [%ld]\n", username, rc);
|
|
|
7731a0 |
+ syslog(LOG_ERR, "pam_ecryptfs: Error getting passwd info for user [%s]; rc = [%d]\n", username, rc);
|
|
Michal Hlavinka |
538613 |
goto out;
|
|
Michal Hlavinka |
538613 |
}
|
|
Michal Hlavinka |
538613 |
saved_uid = geteuid();
|
|
|
a7b4e2 |
diff -up ecryptfs-utils-96/src/utils/mount.ecryptfs.c.werror ecryptfs-utils-96/src/utils/mount.ecryptfs.c
|
|
|
20a2a6 |
--- ecryptfs-utils-96/src/utils/mount.ecryptfs.c.werror 2012-06-04 14:47:13.033862831 +0200
|
|
|
20a2a6 |
+++ ecryptfs-utils-96/src/utils/mount.ecryptfs.c 2012-06-04 14:47:13.037862861 +0200
|
|
|
5d320b |
@@ -461,7 +461,7 @@ static int ecryptfs_do_mount(int argc, c
|
|
|
5d320b |
{
|
|
|
5d320b |
int rc;
|
|
|
5d320b |
int flags = 0;
|
|
|
5d320b |
- int num_opts = 0;
|
|
|
5d320b |
+// int num_opts = 0;
|
|
|
5d320b |
char *src = NULL, *targ = NULL, *opts = NULL, *new_opts = NULL, *temp;
|
|
|
5d320b |
char *val;
|
|
|
5d320b |
|
|
|
5d320b |
@@ -472,7 +472,7 @@ static int ecryptfs_do_mount(int argc, c
|
|
|
5d320b |
rc = strip_userland_opts(opts);
|
|
|
5d320b |
if (rc)
|
|
|
5d320b |
goto out;
|
|
|
5d320b |
- num_opts = ecryptfs_generate_mount_flags(opts, &flags);
|
|
|
5d320b |
+ ecryptfs_generate_mount_flags(opts, &flags);
|
|
|
5d320b |
if (!(temp = strdup("ecryptfs_unlink_sigs"))) {
|
|
|
5d320b |
rc = -ENOMEM;
|
|
|
5d320b |
goto out;
|
|
|
a7b4e2 |
diff -up ecryptfs-utils-96/src/utils/mount.ecryptfs_private.c.werror ecryptfs-utils-96/src/utils/mount.ecryptfs_private.c
|
|
|
20a2a6 |
--- ecryptfs-utils-96/src/utils/mount.ecryptfs_private.c.werror 2012-06-04 14:47:13.027862783 +0200
|
|
|
20a2a6 |
+++ ecryptfs-utils-96/src/utils/mount.ecryptfs_private.c 2012-06-04 14:47:13.037862861 +0200
|
|
|
8813d2 |
@@ -95,7 +95,6 @@ int read_config(char *pw_dir, int uid, c
|
|
|
8813d2 |
*s = strdup(e->mnt_fsname);
|
|
|
8813d2 |
if (!*s)
|
|
|
8813d2 |
return -2;
|
|
|
8813d2 |
-out:
|
|
|
8813d2 |
return 0;
|
|
|
8813d2 |
}
|
|
|
8813d2 |
|
|
|
7731a0 |
@@ -302,7 +301,7 @@ int update_mtab(char *dev, char *mnt, ch
|
|
|
88dca2 |
goto fail_early;
|
|
|
88dca2 |
}
|
|
|
88dca2 |
|
|
|
88dca2 |
- while (old_ent = getmntent(old_mtab)) {
|
|
|
88dca2 |
+ while ((old_ent = getmntent(old_mtab))) {
|
|
|
88dca2 |
if (addmntent(new_mtab, old_ent) != 0) {
|
|
|
88dca2 |
perror("addmntent");
|
|
|
88dca2 |
goto fail;
|
|
|
a7b4e2 |
diff -up ecryptfs-utils-96/src/utils/test.c.werror ecryptfs-utils-96/src/utils/test.c
|
|
|
a7b4e2 |
--- ecryptfs-utils-96/src/utils/test.c.werror 2011-12-14 00:01:38.000000000 +0100
|
|
|
20a2a6 |
+++ ecryptfs-utils-96/src/utils/test.c 2012-06-04 14:47:13.038862869 +0200
|
|
Michal Hlavinka |
beb646 |
@@ -281,7 +281,7 @@ int ecryptfs_encrypt_page(int page_cache
|
|
Michal Hlavinka |
beb646 |
struct inode *lower_inode;
|
|
Michal Hlavinka |
beb646 |
struct ecryptfs_crypt_stat *crypt_stat;
|
|
Michal Hlavinka |
beb646 |
int rc = 0;
|
|
Michal Hlavinka |
beb646 |
- int lower_byte_offset;
|
|
Michal Hlavinka |
beb646 |
+ int lower_byte_offset = 0;
|
|
Michal Hlavinka |
beb646 |
int orig_byte_offset = 0;
|
|
Michal Hlavinka |
beb646 |
int num_extents_per_page;
|
|
Michal Hlavinka |
beb646 |
#define ECRYPTFS_PAGE_STATE_UNREAD 0
|
|
|
a7b4e2 |
diff -up ecryptfs-utils-96/tests/kernel/directory-concurrent/test.c.werror ecryptfs-utils-96/tests/kernel/directory-concurrent/test.c
|
|
|
a7b4e2 |
--- ecryptfs-utils-96/tests/kernel/directory-concurrent/test.c.werror 2012-02-13 17:30:32.000000000 +0100
|
|
|
20a2a6 |
+++ ecryptfs-utils-96/tests/kernel/directory-concurrent/test.c 2012-06-04 14:47:13.038862869 +0200
|
|
|
a7b4e2 |
@@ -149,7 +149,7 @@ int hang_check(int option, const char *f
|
|
|
a7b4e2 |
|
|
|
a7b4e2 |
int test_dirs(const char *path, const int max_dirs)
|
|
|
a7b4e2 |
{
|
|
|
a7b4e2 |
- int i, j;
|
|
|
a7b4e2 |
+ int i/*, j*/;
|
|
|
a7b4e2 |
char *filename;
|
|
|
a7b4e2 |
size_t len = strlen(path) + 32;
|
|
|
a7b4e2 |
int ret = TEST_PASSED;
|
|
|
20a2a6 |
diff -up ecryptfs-utils-96/tests/kernel/extend-file-random/test.c.werror ecryptfs-utils-96/tests/kernel/extend-file-random/test.c
|
|
|
20a2a6 |
--- ecryptfs-utils-96/tests/kernel/extend-file-random/test.c.werror 2012-02-13 17:30:32.000000000 +0100
|
|
|
20a2a6 |
+++ ecryptfs-utils-96/tests/kernel/extend-file-random/test.c 2012-06-04 14:48:48.034597731 +0200
|
|
|
20a2a6 |
@@ -48,7 +48,7 @@ int test_write(int fd, char *buffer, siz
|
|
|
20a2a6 |
}
|
|
|
20a2a6 |
|
|
|
20a2a6 |
if (write(fd, buffer, len) != len) {
|
|
|
20a2a6 |
- fprintf(stderr, "Failed to write %lu bytes, position %lu: %s\n",
|
|
|
20a2a6 |
+ fprintf(stderr, "Failed to write %zu bytes, position %lu: %s\n",
|
|
|
20a2a6 |
len, offset, strerror(errno));
|
|
|
20a2a6 |
return TEST_FAILED;
|
|
|
20a2a6 |
}
|
|
|
20a2a6 |
@@ -58,13 +58,13 @@ int test_write(int fd, char *buffer, siz
|
|
|
20a2a6 |
int test_read(int fd, char *buffer, size_t len, off_t offset)
|
|
|
20a2a6 |
{
|
|
|
20a2a6 |
if (lseek(fd, offset, SEEK_SET) < 0) {
|
|
|
20a2a6 |
- fprintf(stderr, "Failed to seek to position %lu: %s\n",
|
|
|
20a2a6 |
+ fprintf(stderr, "Failed to seek to position %ld: %s\n",
|
|
|
20a2a6 |
offset, strerror(errno));
|
|
|
20a2a6 |
return TEST_FAILED;
|
|
|
20a2a6 |
}
|
|
|
20a2a6 |
|
|
|
20a2a6 |
if (read(fd, buffer, len) != len) {
|
|
|
20a2a6 |
- fprintf(stderr, "Failed to read %lu bytes, position %lu: %s\n",
|
|
|
20a2a6 |
+ fprintf(stderr, "Failed to read %zu bytes, position %lu: %s\n",
|
|
|
20a2a6 |
len, offset, strerror(errno));
|
|
|
20a2a6 |
return TEST_FAILED;
|
|
|
20a2a6 |
}
|
|
|
a7b4e2 |
diff -up ecryptfs-utils-96/tests/kernel/file-concurrent/test.c.werror ecryptfs-utils-96/tests/kernel/file-concurrent/test.c
|
|
|
a7b4e2 |
--- ecryptfs-utils-96/tests/kernel/file-concurrent/test.c.werror 2012-02-13 17:30:32.000000000 +0100
|
|
|
20a2a6 |
+++ ecryptfs-utils-96/tests/kernel/file-concurrent/test.c 2012-06-04 14:47:13.038862869 +0200
|
|
|
a7b4e2 |
@@ -178,7 +178,7 @@ int hang_check(int option, const char *f
|
|
|
a7b4e2 |
|
|
|
a7b4e2 |
int test_dirs(const char *path, const int max_files)
|
|
|
a7b4e2 |
{
|
|
|
a7b4e2 |
- int i, j;
|
|
|
a7b4e2 |
+ int i;
|
|
|
a7b4e2 |
char *filename;
|
|
|
a7b4e2 |
size_t len = strlen(path) + 32;
|
|
|
a7b4e2 |
int ret = TEST_PASSED;
|
|
|
a7b4e2 |
diff -up ecryptfs-utils-96/tests/kernel/inode-race-stat/test.c.werror ecryptfs-utils-96/tests/kernel/inode-race-stat/test.c
|
|
|
20a2a6 |
--- ecryptfs-utils-96/tests/kernel/inode-race-stat/test.c.werror 2012-02-16 03:56:20.000000000 +0100
|
|
|
20a2a6 |
+++ ecryptfs-utils-96/tests/kernel/inode-race-stat/test.c 2012-06-04 14:47:13.040862885 +0200
|
|
|
a7b4e2 |
@@ -106,7 +106,6 @@ static void do_test(const int fdin, cons
|
|
|
a7b4e2 |
{
|
|
|
a7b4e2 |
for (;;) {
|
|
|
a7b4e2 |
int n;
|
|
|
a7b4e2 |
- int ret;
|
|
|
a7b4e2 |
char cmd[32];
|
|
|
a7b4e2 |
|
|
|
a7b4e2 |
if ((n = read(fdin, cmd, sizeof(cmd))) < 1) {
|
|
|
20a2a6 |
@@ -122,7 +121,7 @@ static void do_test(const int fdin, cons
|
|
|
20a2a6 |
if (cmd[0] == CMD_TEST) {
|
|
|
20a2a6 |
int ret;
|
|
|
20a2a6 |
off_t sz;
|
|
|
20a2a6 |
- sscanf(cmd+1, "%zd", &sz);
|
|
|
20a2a6 |
+ sscanf(cmd+1, "%ld", &sz);
|
|
|
20a2a6 |
|
|
|
20a2a6 |
ret = check_size(filename, sz);
|
|
|
20a2a6 |
switch (ret) {
|
|
|
20a2a6 |
@@ -290,7 +289,7 @@ int main(int argc, char **argv)
|
|
|
20a2a6 |
}
|
|
|
20a2a6 |
|
|
|
20a2a6 |
/* Now tell children to stat the file */
|
|
|
20a2a6 |
- snprintf(cmd, sizeof(cmd), "%c%zd", CMD_TEST, sz);
|
|
|
20a2a6 |
+ snprintf(cmd, sizeof(cmd), "%c%ld", CMD_TEST, sz);
|
|
|
20a2a6 |
for (i = 0; i < threads; i++) {
|
|
|
20a2a6 |
if (write(pipe_to[i][1], cmd, strlen(cmd)+1) < 0) {
|
|
|
20a2a6 |
fprintf(stderr, "write to pipe failed: %s\n",
|
|
|
a7b4e2 |
@@ -347,6 +346,7 @@ abort:
|
|
|
a7b4e2 |
int ret;
|
|
|
a7b4e2 |
|
|
|
a7b4e2 |
ret = write(pipe_to[i][1], cmd, 1);
|
|
|
a7b4e2 |
+ (void)ret;
|
|
|
a7b4e2 |
(void)waitpid(pids[i], &status, 0);
|
|
|
a7b4e2 |
|
|
|
a7b4e2 |
(void)close(pipe_to[i][1]);
|
|
|
a7b4e2 |
diff -up ecryptfs-utils-96/tests/kernel/trunc-file/test.c.werror ecryptfs-utils-96/tests/kernel/trunc-file/test.c
|
|
|
a7b4e2 |
--- ecryptfs-utils-96/tests/kernel/trunc-file/test.c.werror 2012-02-13 17:30:32.000000000 +0100
|
|
|
20a2a6 |
+++ ecryptfs-utils-96/tests/kernel/trunc-file/test.c 2012-06-04 14:47:13.040862885 +0200
|
|
|
a7b4e2 |
@@ -39,7 +39,7 @@
|
|
|
a7b4e2 |
|
|
|
a7b4e2 |
int write_buff(int fd, unsigned char *data, ssize_t size)
|
|
|
a7b4e2 |
{
|
|
|
a7b4e2 |
- char *ptr = data;
|
|
|
a7b4e2 |
+ unsigned char *ptr = data;
|
|
|
a7b4e2 |
ssize_t n;
|
|
|
a7b4e2 |
ssize_t sz = size;
|
|
|
a7b4e2 |
|
|
|
a7b4e2 |
@@ -55,7 +55,7 @@ int write_buff(int fd, unsigned char *da
|
|
|
a7b4e2 |
|
|
|
a7b4e2 |
int read_buff(int fd, unsigned char *data, ssize_t size)
|
|
|
a7b4e2 |
{
|
|
|
a7b4e2 |
- char *ptr = data;
|
|
|
a7b4e2 |
+ unsigned char *ptr = data;
|
|
|
a7b4e2 |
ssize_t n;
|
|
|
a7b4e2 |
ssize_t sz = size;
|
|
|
a7b4e2 |
|
|
|
a7b4e2 |
@@ -88,6 +88,7 @@ int test_write_random(char *filename, in
|
|
|
a7b4e2 |
}
|
|
|
a7b4e2 |
buflen -= n;
|
|
|
a7b4e2 |
}
|
|
|
a7b4e2 |
+ return TEST_PASSED;
|
|
|
a7b4e2 |
}
|
|
|
a7b4e2 |
|
|
|
a7b4e2 |
int test_read_random(char *filename, int fd, unsigned char *buff, ssize_t size)
|
|
|
a7b4e2 |
@@ -157,9 +158,6 @@ int test_read_rest(char *filename, int f
|
|
|
a7b4e2 |
int test_exercise(char *filename, ssize_t size)
|
|
|
a7b4e2 |
{
|
|
|
a7b4e2 |
int fd;
|
|
|
a7b4e2 |
- ssize_t i;
|
|
|
a7b4e2 |
- ssize_t n;
|
|
|
a7b4e2 |
- ssize_t buflen;
|
|
|
a7b4e2 |
int ret = TEST_FAILED;
|
|
|
a7b4e2 |
ssize_t trunc_size = size / 2;
|
|
|
a7b4e2 |
struct stat statbuf;
|
|
|
a7b4e2 |
@@ -254,8 +252,6 @@ void sighandler(int dummy)
|
|
|
a7b4e2 |
int main(int argc, char **argv)
|
|
|
a7b4e2 |
{
|
|
|
a7b4e2 |
off_t len = DEFAULT_SIZE;
|
|
|
a7b4e2 |
- int i;
|
|
|
a7b4e2 |
- int ret;
|
|
|
a7b4e2 |
|
|
|
a7b4e2 |
if (argc < 2) {
|
|
|
a7b4e2 |
fprintf(stderr, "Syntax: %s filename [size_in_K]\n", argv[0]);
|
|
|
20a2a6 |
@@ -272,7 +268,7 @@ int main(int argc, char **argv)
|
|
|
630323 |
|
|
|
630323 |
len *= 1024;
|
|
|
630323 |
if (len > SSIZE_MAX) {
|
|
|
630323 |
- fprintf(stderr, "size should be < %zd\n", SSIZE_MAX / 1024);
|
|
|
630323 |
+ fprintf(stderr, "size should be < %zd\n", (size_t)SSIZE_MAX / 1024);
|
|
|
630323 |
exit(TEST_ERROR);
|
|
|
630323 |
}
|
|
|
630323 |
|