kasunath | 951f1aa | 2022-08-10 11:08:14 -0700 | [diff] [blame] | 1 | # Remove cracklib from PAM, to avoid breaking PAM and further dependencies |
| 2 | # This allows cracklib to be neatly severed from the system. |
| 3 | |
| 4 | EXTRA_OECONF:append:gbmc = " --disable-cracklib" |
| 5 | |
| 6 | DEPENDS:remove:gbmc = "cracklib" |
| 7 | |
| 8 | RDEPENDS:${PN}-runtime:remove:gbmc = "pam-plugin-cracklib-suffix" |
| 9 | |
| 10 | RDEPENDS:${PN}-xtests:remove:gbmc = "${MLPREFIX}pam-plugin-cracklib-${libpam_suffix}" |
| 11 | |
| 12 | do_install:append:gbmc() { |
| 13 | # Remove reference to cracklib library from PAM config file |
| 14 | sed -i '/pam_cracklib.so/d' ${D}${sysconfdir}/pam.d/common-password |
Oskar Senft | 6cc57fe | 2022-10-05 08:27:03 -0400 | [diff] [blame^] | 15 | |
| 16 | # Remove the first occurrence of "use_authtok" in the first line starting |
| 17 | # with "password". This makes sure that if pam_cracklib.so was the first |
| 18 | # entry, we didn't invalidate the next entry in the stack. If the first |
| 19 | # entry has the "use_authtok" set, this "forces the module to not prompt |
| 20 | # the user for a new password but use the one provided by the previously |
| 21 | # stacked password module". Since there is no "previous" entry, it never |
| 22 | # asks for a password which causes the process to fail. |
| 23 | awk '/^password/ && !f{sub(/ use_authtok/, ""); f=1} 1' \ |
| 24 | ${D}${sysconfdir}/pam.d/common-password \ |
| 25 | > ${D}${sysconfdir}/pam.d/common-password.new |
| 26 | mv ${D}${sysconfdir}/pam.d/common-password.new \ |
| 27 | ${D}${sysconfdir}/pam.d/common-password |
kasunath | 951f1aa | 2022-08-10 11:08:14 -0700 | [diff] [blame] | 28 | } |