|
Michal Hlavinka |
c7231a |
diff -up ecryptfs-utils-83/src/libecryptfs/ecryptfs-stat.c.werror ecryptfs-utils-83/src/libecryptfs/ecryptfs-stat.c
|
|
Michal Hlavinka |
c7231a |
--- ecryptfs-utils-83/src/libecryptfs/ecryptfs-stat.c.werror 2009-10-20 20:49:55.000000000 +0200
|
|
Michal Hlavinka |
c7231a |
+++ ecryptfs-utils-83/src/libecryptfs/ecryptfs-stat.c 2010-02-18 10:40:45.447667184 +0100
|
|
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
|
|
Michal Hlavinka |
c7231a |
diff -up ecryptfs-utils-83/src/pam_ecryptfs/pam_ecryptfs.c.werror ecryptfs-utils-83/src/pam_ecryptfs/pam_ecryptfs.c
|
|
Michal Hlavinka |
c7231a |
--- ecryptfs-utils-83/src/pam_ecryptfs/pam_ecryptfs.c.werror 2010-02-16 18:01:43.000000000 +0100
|
|
Michal Hlavinka |
c7231a |
+++ ecryptfs-utils-83/src/pam_ecryptfs/pam_ecryptfs.c 2010-02-18 10:41:48.792416776 +0100
|
|
Michal Hlavinka |
c7231a |
@@ -43,31 +43,6 @@
|
|
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 |
-{
|
|
Michal Hlavinka |
538613 |
- syslog(LOG_ERR, "errno = [%i]; strerror = [%m]\n", errno);
|
|
Michal Hlavinka |
538613 |
- switch (errno) {
|
|
Michal Hlavinka |
538613 |
- case ENOKEY:
|
|
Michal Hlavinka |
538613 |
- syslog(LOG_ERR, "%s: Requested key not available\n", msg);
|
|
Michal Hlavinka |
538613 |
- return;
|
|
Michal Hlavinka |
538613 |
-
|
|
Michal Hlavinka |
538613 |
- case EKEYEXPIRED:
|
|
Michal Hlavinka |
538613 |
- syslog(LOG_ERR, "%s: Key has expired\n", msg);
|
|
Michal Hlavinka |
538613 |
- return;
|
|
Michal Hlavinka |
538613 |
-
|
|
Michal Hlavinka |
538613 |
- case EKEYREVOKED:
|
|
Michal Hlavinka |
538613 |
- syslog(LOG_ERR, "%s: Key has been revoked\n", msg);
|
|
Michal Hlavinka |
538613 |
- return;
|
|
Michal Hlavinka |
538613 |
-
|
|
Michal Hlavinka |
538613 |
- case EKEYREJECTED:
|
|
Michal Hlavinka |
538613 |
- syslog(LOG_ERR, "%s: Key was rejected by service\n", msg);
|
|
Michal Hlavinka |
538613 |
- return;
|
|
Michal Hlavinka |
538613 |
- default:
|
|
Michal Hlavinka |
538613 |
- syslog(LOG_ERR, "%s: Unknown key error\n", msg);
|
|
Michal Hlavinka |
538613 |
- return;
|
|
Michal Hlavinka |
538613 |
- }
|
|
Michal Hlavinka |
538613 |
-}
|
|
Michal Hlavinka |
538613 |
-
|
|
Michal Hlavinka |
538613 |
/* returns: 0 for pam automounting not set, 1 for set, <0 for error */
|
|
Michal Hlavinka |
538613 |
static int ecryptfs_pam_automount_set(const char *homedir)
|
|
Michal Hlavinka |
538613 |
{
|
|
Michal Hlavinka |
c7231a |
@@ -87,7 +62,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;
|
|
Michal Hlavinka |
c7231a |
@@ -198,8 +173,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",
|
|
Michal Hlavinka |
c7231a |
@@ -291,8 +264,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 */
|
|
Michal Hlavinka |
c7231a |
@@ -339,7 +310,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 |
}
|
|
Michal Hlavinka |
c7231a |
@@ -428,7 +399,7 @@ PAM_EXTERN int pam_sm_chauthtok(pam_hand
|
|
Michal Hlavinka |
538613 |
}
|
|
Michal Hlavinka |
538613 |
} else {
|
|
Michal Hlavinka |
538613 |
syslog(LOG_ERR, "Error getting passwd info for user [%s]; "
|
|
Michal Hlavinka |
538613 |
- "rc = [%ld]\n", username, rc);
|
|
Michal Hlavinka |
538613 |
+ "rc = [%d]\n", username, rc);
|
|
Michal Hlavinka |
538613 |
goto out;
|
|
Michal Hlavinka |
538613 |
}
|
|
Michal Hlavinka |
538613 |
saved_uid = geteuid();
|