diff options
Diffstat (limited to 'meta/recipes-extended/sudo/files/crypt.patch')
-rw-r--r-- | meta/recipes-extended/sudo/files/crypt.patch | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/meta/recipes-extended/sudo/files/crypt.patch b/meta/recipes-extended/sudo/files/crypt.patch deleted file mode 100644 index d0622d372c..0000000000 --- a/meta/recipes-extended/sudo/files/crypt.patch +++ /dev/null | |||
@@ -1,100 +0,0 @@ | |||
1 | Upstream-Status: Backport | ||
2 | Signed-off-by: Ross Burton <ross.burton@intel.com> | ||
3 | |||
4 | # HG changeset patch | ||
5 | # User Todd C. Miller <Todd.Miller@courtesan.com> | ||
6 | # Date 1365700240 14400 | ||
7 | # Node ID 887b9df243df5254e56c467a016f1b0a7a8507dd | ||
8 | # Parent fd7eda53cdd76aaf8336800c61005ae93de95ac7 | ||
9 | Check for crypt() returning NULL. Traditionally, crypt() never returned | ||
10 | NULL but newer versions of eglibc have a crypt() that does. Bug #598 | ||
11 | |||
12 | diff -r fd7eda53cdd7 -r 887b9df243df plugins/sudoers/auth/passwd.c | ||
13 | --- a/plugins/sudoers/auth/passwd.c Thu Apr 11 09:09:53 2013 -0400 | ||
14 | +++ b/plugins/sudoers/auth/passwd.c Thu Apr 11 13:10:40 2013 -0400 | ||
15 | @@ -68,15 +68,15 @@ | ||
16 | char sav, *epass; | ||
17 | char *pw_epasswd = auth->data; | ||
18 | size_t pw_len; | ||
19 | - int error; | ||
20 | + int matched = 0; | ||
21 | debug_decl(sudo_passwd_verify, SUDO_DEBUG_AUTH) | ||
22 | |||
23 | pw_len = strlen(pw_epasswd); | ||
24 | |||
25 | #ifdef HAVE_GETAUTHUID | ||
26 | /* Ultrix shadow passwords may use crypt16() */ | ||
27 | - error = strcmp(pw_epasswd, (char *) crypt16(pass, pw_epasswd)); | ||
28 | - if (!error) | ||
29 | + epass = (char *) crypt16(pass, pw_epasswd); | ||
30 | + if (epass != NULL && strcmp(pw_epasswd, epass) == 0) | ||
31 | debug_return_int(AUTH_SUCCESS); | ||
32 | #endif /* HAVE_GETAUTHUID */ | ||
33 | |||
34 | @@ -95,12 +95,14 @@ | ||
35 | */ | ||
36 | epass = (char *) crypt(pass, pw_epasswd); | ||
37 | pass[8] = sav; | ||
38 | - if (HAS_AGEINFO(pw_epasswd, pw_len) && strlen(epass) == DESLEN) | ||
39 | - error = strncmp(pw_epasswd, epass, DESLEN); | ||
40 | - else | ||
41 | - error = strcmp(pw_epasswd, epass); | ||
42 | + if (epass != NULL) { | ||
43 | + if (HAS_AGEINFO(pw_epasswd, pw_len) && strlen(epass) == DESLEN) | ||
44 | + matched = !strncmp(pw_epasswd, epass, DESLEN); | ||
45 | + else | ||
46 | + matched = !strcmp(pw_epasswd, epass); | ||
47 | + } | ||
48 | |||
49 | - debug_return_int(error ? AUTH_FAILURE : AUTH_SUCCESS); | ||
50 | + debug_return_int(matched ? AUTH_SUCCESS : AUTH_FAILURE); | ||
51 | } | ||
52 | |||
53 | int | ||
54 | diff -r fd7eda53cdd7 -r 887b9df243df plugins/sudoers/auth/secureware.c | ||
55 | --- a/plugins/sudoers/auth/secureware.c Thu Apr 11 09:09:53 2013 -0400 | ||
56 | +++ b/plugins/sudoers/auth/secureware.c Thu Apr 11 13:10:40 2013 -0400 | ||
57 | @@ -73,30 +73,28 @@ | ||
58 | sudo_secureware_verify(struct passwd *pw, char *pass, sudo_auth *auth) | ||
59 | { | ||
60 | char *pw_epasswd = auth->data; | ||
61 | + char *epass = NULL; | ||
62 | debug_decl(sudo_secureware_verify, SUDO_DEBUG_AUTH) | ||
63 | #ifdef __alpha | ||
64 | { | ||
65 | extern int crypt_type; | ||
66 | |||
67 | -# ifdef HAVE_DISPCRYPT | ||
68 | - if (strcmp(pw_epasswd, dispcrypt(pass, pw_epasswd, crypt_type)) == 0) | ||
69 | - debug_return_int(AUTH_SUCCESS); | ||
70 | -# else | ||
71 | - if (crypt_type == AUTH_CRYPT_BIGCRYPT) { | ||
72 | - if (strcmp(pw_epasswd, bigcrypt(pass, pw_epasswd)) == 0) | ||
73 | - debug_return_int(AUTH_SUCCESS); | ||
74 | - } else if (crypt_type == AUTH_CRYPT_CRYPT16) { | ||
75 | - if (strcmp(pw_epasswd, crypt(pass, pw_epasswd)) == 0) | ||
76 | - debug_return_int(AUTH_SUCCESS); | ||
77 | - } | ||
78 | +# ifdef HAVE_DISPCRYPT | ||
79 | + epass = dispcrypt(pass, pw_epasswd, crypt_type); | ||
80 | +# else | ||
81 | + if (crypt_type == AUTH_CRYPT_BIGCRYPT) | ||
82 | + epass = bigcrypt(pass, pw_epasswd); | ||
83 | + else if (crypt_type == AUTH_CRYPT_CRYPT16) | ||
84 | + epass = crypt(pass, pw_epasswd); | ||
85 | } | ||
86 | -# endif /* HAVE_DISPCRYPT */ | ||
87 | +# endif /* HAVE_DISPCRYPT */ | ||
88 | #elif defined(HAVE_BIGCRYPT) | ||
89 | - if (strcmp(pw_epasswd, bigcrypt(pass, pw_epasswd)) == 0) | ||
90 | - debug_return_int(AUTH_SUCCESS); | ||
91 | + epass = bigcrypt(pass, pw_epasswd); | ||
92 | #endif /* __alpha */ | ||
93 | |||
94 | - debug_return_int(AUTH_FAILURE); | ||
95 | + if (epass != NULL && strcmp(pw_epasswd, epass) == 0) | ||
96 | + debug_return_int(AUTH_SUCCESS); | ||
97 | + debug_return_int(AUTH_FAILURE); | ||
98 | } | ||
99 | |||
100 | int | ||