~ubuntu-branches/ubuntu/trusty/libpam-mount/trusty-proposed

« back to all changes in this revision

Viewing changes to debian/patches/check_authtok_retcode

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Kleineidam
  • Date: 2010-05-19 04:05:25 UTC
  • mfrom: (1.4.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20100519040525-yym18fn8k070smfe
Tags: 2.3-1
* New upstream release.
  + mount.crypt passes keyfile info to open LUKS volumes
    (Closes: #528366)
  + umount.crypt works again (Closes: #581713)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Only store authtok if conversion function returned success.
2
 
 
3
 
Index: libpam-mount-1.36/src/pam_mount.c
4
 
===================================================================
5
 
--- libpam-mount-1.36.orig/src/pam_mount.c      2010-04-21 21:37:31.000000000 +0200
6
 
+++ libpam-mount-1.36/src/pam_mount.c   2010-04-21 21:37:56.000000000 +0200
7
 
@@ -472,9 +472,8 @@ static char *ses_grab_authtok(pam_handle
8
 
                ret = read_password(pamh, Config.msg_sessionpw, &authtok);
9
 
                if (ret != PAM_SUCCESS)
10
 
                        l0g("warning: could not obtain password "
11
 
-                           "interactively either\n");
12
 
-       }
13
 
-       if (authtok != NULL) {
14
 
+                            "interactively either\n");
15
 
+                else {
16
 
                ret = pam_set_data(pamh, "pam_mount_system_authtok",
17
 
                      authtok, clean_system_authtok);
18
 
                if (ret == PAM_SUCCESS) {
19
 
@@ -482,7 +481,8 @@ static char *ses_grab_authtok(pam_handle
20
 
                                w4rn("mlock authtok: %s\n", strerror(errno));
21
 
                } else {
22
 
                        l0g("error trying to save authtok for session code\n");
23
 
-               }
24
 
+                }
25
 
+                }
26
 
        }
27
 
        /*
28
 
         * Always proceed, even if there is no password. Some volumes may not