From 0e4ddb48bdf2a63e20518a0c9299cf7bcd17b2fa Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Aug 09 2011 12:39:54 +0000 Subject: refresh patch, so it applies with fuzz=0 --- diff --git a/ecryptfs-utils-87-syslog.patch b/ecryptfs-utils-87-syslog.patch index da0508e..b1d2382 100644 --- a/ecryptfs-utils-87-syslog.patch +++ b/ecryptfs-utils-87-syslog.patch @@ -1,6 +1,6 @@ diff -up ecryptfs-utils-87/src/include/ecryptfs.h.syslog ecryptfs-utils-87/src/include/ecryptfs.h ---- ecryptfs-utils-87/src/include/ecryptfs.h.syslog 2011-08-09 13:53:46.159665547 +0200 -+++ ecryptfs-utils-87/src/include/ecryptfs.h 2011-08-09 13:53:46.194664841 +0200 +--- ecryptfs-utils-87/src/include/ecryptfs.h.syslog 2011-08-09 14:38:08.941531270 +0200 ++++ ecryptfs-utils-87/src/include/ecryptfs.h 2011-08-09 14:38:08.951531067 +0200 @@ -143,7 +143,7 @@ #define ECRYPTFS_TAG_67_PACKET 0x43 @@ -11,9 +11,9 @@ diff -up ecryptfs-utils-87/src/include/ecryptfs.h.syslog ecryptfs-utils-87/src/i #define ECRYPTFS_MAX_NUM_CIPHERS 64 #define ECRYPTFS_ECHO_ON 1 diff -up ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.syslog ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c ---- ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.syslog 2011-08-09 13:53:46.155665627 +0200 -+++ ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c 2011-08-09 14:01:13.663636527 +0200 -@@ -88,7 +88,7 @@ static int wrap_passphrase_if_necessary( +--- ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.syslog 2011-08-09 14:38:08.933531435 +0200 ++++ ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c 2011-08-09 14:38:08.955530985 +0200 +@@ -91,7 +91,7 @@ static int wrap_passphrase_if_necessary( rc = asprintf(&unwrapped_pw_filename, "/dev/shm/.ecryptfs-%s", username); if (rc == -1) { @@ -22,7 +22,7 @@ diff -up ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.syslog ecryptfs-utils return -ENOMEM; } /* If /dev/shm/.ecryptfs-$USER exists and owned by the user -@@ -102,7 +102,7 @@ static int wrap_passphrase_if_necessary( +@@ -105,7 +105,7 @@ static int wrap_passphrase_if_necessary( setuid(uid); rc = ecryptfs_wrap_passphrase_file(wrapped_pw_filename, passphrase, salt, unwrapped_pw_filename); if (rc != 0) { @@ -31,7 +31,7 @@ diff -up ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.syslog ecryptfs-utils } return rc; } -@@ -119,10 +119,10 @@ PAM_EXTERN int pam_sm_authenticate(pam_h +@@ -122,10 +122,10 @@ PAM_EXTERN int pam_sm_authenticate(pam_h uint32_t version; struct ecryptfs_pam_data *epd = {0,}; @@ -44,7 +44,7 @@ diff -up ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.syslog ecryptfs-utils rc = -ENOMEM; goto out; } -@@ -131,7 +131,7 @@ PAM_EXTERN int pam_sm_authenticate(pam_h +@@ -134,7 +134,7 @@ PAM_EXTERN int pam_sm_authenticate(pam_h if (rc == PAM_SUCCESS) { struct passwd *pwd; @@ -53,7 +53,7 @@ diff -up ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.syslog ecryptfs-utils epd->username); pwd = getpwnam(epd->username); if (pwd) { -@@ -139,7 +139,7 @@ PAM_EXTERN int pam_sm_authenticate(pam_h +@@ -142,7 +142,7 @@ PAM_EXTERN int pam_sm_authenticate(pam_h epd->homedir = pwd->pw_dir; } } else { @@ -62,7 +62,7 @@ diff -up ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.syslog ecryptfs-utils "rc = [%ld]\n", epd->username, rc); goto out; } -@@ -147,7 +147,7 @@ PAM_EXTERN int pam_sm_authenticate(pam_h +@@ -150,7 +150,7 @@ PAM_EXTERN int pam_sm_authenticate(pam_h goto out; private_mnt = ecryptfs_fetch_private_mnt(epd->homedir); if (ecryptfs_private_is_mounted(NULL, private_mnt, NULL, 1)) { @@ -71,7 +71,7 @@ diff -up ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.syslog ecryptfs-utils epd->homedir); /* If private/home is already mounted, then we can skip costly loading of keys */ -@@ -156,7 +156,7 @@ PAM_EXTERN int pam_sm_authenticate(pam_h +@@ -159,7 +159,7 @@ PAM_EXTERN int pam_sm_authenticate(pam_h /* we need side effect of this check: load ecryptfs module if not loaded already */ if (ecryptfs_get_version(&version) != 0) @@ -80,8 +80,8 @@ diff -up ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.syslog ecryptfs-utils saved_uid = geteuid(); seteuid(epd->uid); if(file_exists_dotecryptfs(epd->homedir, "wrapping-independent") == 1) -@@ -165,7 +165,7 @@ PAM_EXTERN int pam_sm_authenticate(pam_h - rc = pam_get_item(pamh, PAM_AUTHTOK, (const void **)&epd->passphrase); +@@ -169,7 +169,7 @@ PAM_EXTERN int pam_sm_authenticate(pam_h + epd->passphrase = strdup(epd->passphrase); seteuid(saved_uid); if (rc != PAM_SUCCESS) { - syslog(LOG_ERR, "Error retrieving passphrase; rc = [%ld]\n", @@ -89,19 +89,16 @@ diff -up ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.syslog ecryptfs-utils rc); goto out; } -@@ -179,9 +179,9 @@ PAM_EXTERN int pam_sm_authenticate(pam_h +@@ -183,7 +183,7 @@ PAM_EXTERN int pam_sm_authenticate(pam_h epd->unwrap = ((argc == 1) && (memcmp(argv[0], "unwrap\0", 7) == 0)); if ((rc=pam_set_data(pamh, ECRYPTFS_PAM_DATA, epd, pam_free_ecryptfsdata)) != PAM_SUCCESS) { - syslog(LOG_ERR, "Unable to store ecryptfs pam data : %s", pam_strerror(pamh, rc)); + ecryptfs_syslog(LOG_ERR, "Unable to store ecryptfs pam data : %s", pam_strerror(pamh, rc)); goto out; -- } -+ } + } - out: - if (private_mnt != NULL) -@@ -203,13 +203,13 @@ static struct passwd *fetch_pwd(pam_hand +@@ -207,13 +207,13 @@ static struct passwd *fetch_pwd(pam_hand rc = pam_get_user(pamh, &username, NULL); if (rc != PAM_SUCCESS || username == NULL) { @@ -117,7 +114,7 @@ diff -up ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.syslog ecryptfs-utils "rc = [%ld]\n", username, rc); return NULL; } -@@ -241,13 +241,13 @@ static int private_dir(pam_handle_t *pam +@@ -245,13 +245,13 @@ static int private_dir(pam_handle_t *pam if ( (asprintf(&autofile, "%s/.ecryptfs/%s", pwd->pw_dir, a) < 0) || autofile == NULL) { @@ -133,7 +130,7 @@ diff -up ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.syslog ecryptfs-utils return 1; } if (stat(sigfile, &s) != 0) { -@@ -259,13 +259,13 @@ static int private_dir(pam_handle_t *pam +@@ -263,13 +263,13 @@ static int private_dir(pam_handle_t *pam goto out; } if ((pid = fork()) < 0) { @@ -149,7 +146,7 @@ diff -up ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.syslog ecryptfs-utils _exit(255); } -@@ -273,7 +273,7 @@ static int private_dir(pam_handle_t *pam +@@ -277,7 +277,7 @@ static int private_dir(pam_handle_t *pam if ((asprintf(&recorded, "%s/.ecryptfs/.wrapped-passphrase.recorded", pwd->pw_dir) < 0) || recorded == NULL) { @@ -158,7 +155,7 @@ diff -up ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.syslog ecryptfs-utils "Error allocating memory for recorded name"); _exit(255); } -@@ -286,7 +286,7 @@ static int private_dir(pam_handle_t *pam +@@ -290,7 +290,7 @@ static int private_dir(pam_handle_t *pam } if (stat(autofile, &s) != 0) { /* User does not want to auto-mount */ @@ -167,7 +164,7 @@ diff -up ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.syslog ecryptfs-utils "Skipping automatic eCryptfs mount"); _exit(0); } -@@ -294,11 +294,11 @@ static int private_dir(pam_handle_t *pam +@@ -298,11 +298,11 @@ static int private_dir(pam_handle_t *pam setresuid(pwd->pw_uid, pwd->pw_uid, pwd->pw_uid); execl("/sbin/mount.ecryptfs_private", "mount.ecryptfs_private", NULL); @@ -181,7 +178,7 @@ diff -up ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.syslog ecryptfs-utils "Skipping automatic eCryptfs unmount"); _exit(0); } -@@ -306,7 +306,7 @@ static int private_dir(pam_handle_t *pam +@@ -310,7 +310,7 @@ static int private_dir(pam_handle_t *pam setresuid(pwd->pw_uid, pwd->pw_uid, pwd->pw_uid); execl("/sbin/umount.ecryptfs_private", "umount.ecryptfs_private", NULL); @@ -190,7 +187,7 @@ diff -up ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.syslog ecryptfs-utils } _exit(255); } else { -@@ -335,25 +335,25 @@ static int fill_keyring(pam_handle_t *pa +@@ -339,25 +339,25 @@ static int fill_keyring(pam_handle_t *pa char *auth_tok_sig; auth_tok_sig = malloc(ECRYPTFS_SIG_SIZE_HEX + 1); if (!auth_tok_sig) { @@ -204,8 +201,7 @@ diff -up ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.syslog ecryptfs-utils - syslog(LOG_ERR,"Unable to get ecryptfs pam data : %s", pam_strerror(pamh, rc)); + ecryptfs_syslog(LOG_ERR,"Unable to get ecryptfs pam data : %s", pam_strerror(pamh, rc)); return -EINVAL; -- } -+ } + } if ((child_pid = fork()) == 0) { setuid(epd->uid); @@ -221,7 +217,7 @@ diff -up ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.syslog ecryptfs-utils "Cannot validate keyring integrity\n"); } rc = 0; -@@ -365,12 +365,12 @@ static int fill_keyring(pam_handle_t *pa +@@ -369,12 +369,12 @@ static int fill_keyring(pam_handle_t *pa epd->homedir, ECRYPTFS_DEFAULT_WRAPPED_PASSPHRASE_FILENAME); if (rc == -1) { @@ -236,7 +232,7 @@ diff -up ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.syslog ecryptfs-utils } else { goto out_child; } -@@ -386,7 +386,7 @@ static int fill_keyring(pam_handle_t *pa +@@ -390,7 +390,7 @@ static int fill_keyring(pam_handle_t *pa goto out_child; } if (rc) { @@ -245,7 +241,7 @@ diff -up ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.syslog ecryptfs-utils "user session keyring; rc = [%d]\n", rc); goto out_child; } -@@ -396,7 +396,7 @@ out_child: +@@ -400,7 +400,7 @@ out_child: } tmp_pid = waitpid(child_pid, NULL, 0); if (tmp_pid == -1)