2022-03-18 14:56:13 +01:00
|
|
|
Remove dependency on /usr/bin/pwscore that is part of libpwquality-tools
|
|
|
|
but we don't ship it in SLES
|
2022-06-10 13:54:30 +02:00
|
|
|
Index: cockpit/pkg/lib/cockpit-components-password.jsx
|
|
|
|
===================================================================
|
|
|
|
--- cockpit.orig/pkg/lib/cockpit-components-password.jsx
|
|
|
|
+++ cockpit/pkg/lib/cockpit-components-password.jsx
|
2022-03-18 14:56:13 +01:00
|
|
|
@@ -18,7 +18,7 @@
|
|
|
|
*/
|
|
|
|
import cockpit from 'cockpit';
|
2022-06-10 13:54:30 +02:00
|
|
|
import React, { useState } from 'react';
|
2022-03-18 14:56:13 +01:00
|
|
|
-import { FormGroup, Popover, Progress, ProgressSize, ProgressMeasureLocation, TextInput } from '@patternfly/react-core';
|
|
|
|
+import { FormGroup, Popover, TextInput } from '@patternfly/react-core';
|
|
|
|
import { HelpIcon } from '@patternfly/react-icons';
|
|
|
|
|
|
|
|
import './cockpit-components-password.scss';
|
|
|
|
@@ -27,6 +27,7 @@ const _ = cockpit.gettext;
|
|
|
|
|
|
|
|
export function password_quality(password, force) {
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
+ /*
|
|
|
|
cockpit.spawn('/usr/bin/pwscore', { err: "message" })
|
|
|
|
.input(password)
|
|
|
|
.done(function(content) {
|
2022-06-10 13:54:30 +02:00
|
|
|
@@ -42,6 +43,8 @@ export function password_quality(passwor
|
2022-03-18 14:56:13 +01:00
|
|
|
else
|
|
|
|
resolve({ value: 0 });
|
|
|
|
});
|
|
|
|
+ */
|
|
|
|
+ resolve({ message: _("pwscore not checked") });
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-06-13 13:16:05 +02:00
|
|
|
@@ -60,6 +63,7 @@ export const PasswordFormFields = ({
|
|
|
|
setPassword(value);
|
|
|
|
change("password", value);
|
|
|
|
|
2022-06-10 13:54:30 +02:00
|
|
|
+/*
|
2022-06-13 13:16:05 +02:00
|
|
|
if (value) {
|
|
|
|
password_quality(value)
|
|
|
|
.catch(ex => {
|
2022-06-10 13:54:30 +02:00
|
|
|
@@ -84,6 +88,7 @@ export const PasswordFormFields = ({
|
2022-03-18 14:56:13 +01:00
|
|
|
variant = "warning";
|
|
|
|
else
|
|
|
|
variant = "danger";
|
|
|
|
+ */
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
2022-06-10 13:54:30 +02:00
|
|
|
@@ -101,16 +106,7 @@ export const PasswordFormFields = ({
|
2022-03-18 14:56:13 +01:00
|
|
|
fieldId={idPrefix + "-pw1"}>
|
|
|
|
<TextInput className="check-passwords" type="password" id={idPrefix + "-pw1"}
|
2022-06-10 13:54:30 +02:00
|
|
|
autocomplete="new-password" value={password} onChange={onPasswordChanged} />
|
2022-03-18 14:56:13 +01:00
|
|
|
- <div>
|
|
|
|
- <Progress id={idPrefix + "-meter"}
|
|
|
|
- className={"ct-password-strength-meter " + variant}
|
|
|
|
- title={_("password quality")}
|
|
|
|
- size={ProgressSize.sm}
|
|
|
|
- measureLocation={ProgressMeasureLocation.none}
|
|
|
|
- variant={variant}
|
2022-06-10 13:54:30 +02:00
|
|
|
- value={Number.isInteger(passwordStrength) ? passwordStrength : 0} />
|
|
|
|
<div id={idPrefix + "-password-meter-message"} className="pf-c-form__helper-text" aria-live="polite">{passwordMessage}</div>
|
2022-03-18 14:56:13 +01:00
|
|
|
- </div>
|
|
|
|
</FormGroup>
|
|
|
|
|
|
|
|
{password_confirm_label && <FormGroup label={password_confirm_label}
|