~ubuntu-branches/ubuntu/trusty/pam-kwallet/trusty-updates

« back to all changes in this revision

Viewing changes to debian/patches/upstream_If-we-fail-creating-a-directory-log-it-into-syslog.patch

  • Committer: Package Import Robot
  • Author(s): Harald Sitter
  • Date: 2014-04-29 11:12:58 UTC
  • Revision ID: package-import@ubuntu.com-20140429111258-ru1ssg7ax6irxwyw
Tags: 0.0~git20140410-0ubuntu2.1
* Import upstream patch set to improve reliability and debugability:
  + upstream_Removed-not-needed-strdup.patch
    Remove an unnecessary strdup.
    UBUNTU-ERROR: 30e961156f64c241b58a65ecbb009688e3aeb2ec
    LP: #1314118
  + upstream_If-we-fail-creating-a-directory-log-it-into-syslog.patch
    Adds logging on directory creation failure
  + upstream_If-we-can-t-open-the-file-where-salt-will-be-saved-f.patch
    If the salt file cannot be opened, fail properly instead of running
    into nullptr fd crashes
    UBUNTU-ERROR: ae1ef304fcd7d26e215563c4c95fcb25a74a6559
    LP: #1314119
  + upstream_If-kwallet_hash-fails-return-with-PAM_IGNORE.patch
    When hash creation fails, fail properly instead of allowing for crashes
    later on.
  + upstream_Add-more-checks-against-null-fd.patch
    Adding nullptr checks after selected fopen() and mallocs
    UBUNTU-ERROR: 28ad0356a00142a5ec12fb842f15e18f3fae1a63
    LP: #1314120
  + upstream_Replace-fprintf-with-syslog-and-add-some-extra-ones.patch
    Prefering syslog over fprintf and adding more logging on failure

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 1c4a257caac7cd33c61cf8834e9ef62c7cee9246 Mon Sep 17 00:00:00 2001
 
2
From: =?UTF-8?q?=C3=80lex=20Fiestas?= <afiestas@kde.org>
 
3
Date: Mon, 28 Apr 2014 18:00:11 +0200
 
4
Subject: [PATCH 1/5] If we fail creating a directory, log it into syslog
 
5
 
 
6
---
 
7
 pam_kwallet.c | 1 +
 
8
 1 file changed, 1 insertion(+)
 
9
 
 
10
diff --git a/pam_kwallet.c b/pam_kwallet.c
 
11
index 392f029..18eb981 100644
 
12
--- a/pam_kwallet.c
 
13
+++ b/pam_kwallet.c
 
14
@@ -482,6 +482,7 @@ int mkpath(char *path, struct passwd *userInfo)
 
15
         if (stat(path, &sb)) {
 
16
             if (errno != ENOENT || (mkdir(path, 0777) &&
 
17
                 errno != EEXIST)) {
 
18
+                syslog(LOG_ERR, "Couldn't create directory: %s because: %d-%s", path, errno, strerror(errno));
 
19
                 return (-1);
 
20
             } else {
 
21
                 if (chown(path, userInfo->pw_uid, userInfo->pw_gid) == -1) {
 
22
-- 
 
23
1.9.1
 
24