rebase to deepin-pw-check-5.1.4-1

This commit is contained in:
zhangshaoning 2023-12-01 17:13:57 +08:00
parent 0ea1a55294
commit e75e9342ae
9 changed files with 202 additions and 117 deletions

View File

@ -0,0 +1,37 @@
diff --git a/docs/technical_solution.md b/docs/technical_solution.md
index 882b75a..246506f 100644
--- a/docs/technical_solution.md
+++ b/docs/technical_solution.md
@@ -212,8 +212,9 @@
for (int i = 0; r_destructors[i]; i++)
{
char *a;
+ char *area = NULL;
- if (!(a = Mangle((char*)pw, r_destructors[i])))
+ if (!(a = Mangle((char*)pw, r_destructors[i], area)))
{
continue;
}
@@ -336,4 +337,4 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, const char **argv)
}
```
## 总结
-使用以上方案使用同一套代码校验规则可以解决当前uos系统上遇到的密码校验规则不一致导致的一系列问题。
\ No newline at end of file
+使用以上方案使用同一套代码校验规则可以解决当前uos系统上遇到的密码校验规则不一致导致的一系列问题。
diff --git a/lib/word_check.c b/lib/word_check.c
index fc32446..ab70346 100644
--- a/lib/word_check.c
+++ b/lib/word_check.c
@@ -394,8 +394,9 @@ int word_check(const char* pw,const char* dict_path) {
for (int i = 0; r_destructors[i]; i++)
{
char *a;
+ char *area = NULL;
- if (!(a = Mangle((char*)pw, r_destructors[i])))
+ if (!(a = Mangle((char*)pw, r_destructors[i], area)))
{
continue;
}

View File

@ -1,17 +1,17 @@
From 2e84087cd91a7a0b8b268d4e2d8c97f6c38afcb0 Mon Sep 17 00:00:00 2001 From c80d5bd5718c2d56bd8498ffae9b766f5a07f9c7 Mon Sep 17 00:00:00 2001
From: leeffo <leeffo@yeah.net> From: songmingliang <songmingliang@uniontech.com>
Date: Tue, 21 Feb 2023 14:50:45 +0800 Date: Fri, 13 May 2022 18:11:36 +0800
Subject: [PATCH] deepin-pw-check modify password policy Subject: [PATCH] modify password policy
--- ---
tool/pwd_conf_update.c | 148 +++++++++++++++++++++-------------------- tool/pwd_conf_update.c | 154 +++++++++++++++++++++--------------------
1 file changed, 75 insertions(+), 73 deletions(-) 1 file changed, 78 insertions(+), 76 deletions(-)
diff --git a/tool/pwd_conf_update.c b/tool/pwd_conf_update.c diff --git a/tool/pwd_conf_update.c b/tool/pwd_conf_update.c
index ddcfca5..f30c2b8 100644 index ddcb130..3f90ee6 100644
--- a/tool/pwd_conf_update.c --- a/tool/pwd_conf_update.c
+++ b/tool/pwd_conf_update.c +++ b/tool/pwd_conf_update.c
@@ -90,15 +90,15 @@ const _default_conf default_conf[] = { @@ -85,15 +85,15 @@ const _default_conf default_conf[] = {
[OS_EULER] = [OS_EULER] =
{ {
.min_length = 8, .min_length = 8,
@ -19,7 +19,8 @@ index ddcfca5..f30c2b8 100644
+ .max_length = 511, + .max_length = 511,
.validate_policy = "1234567890;abcdefghijklmnopqrstuvwxyz;" .validate_policy = "1234567890;abcdefghijklmnopqrstuvwxyz;"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ;!\"#$%&'()*+,-./" "ABCDEFGHIJKLMNOPQRSTUVWXYZ;!\"#$%&'()*+,-./"
":;<=>?@[\\]^_`{|}~/", - ":;<=>?@[\\]^_`{|}~/",
+ ":;<=>?@[\\]^_`{|}~",
.validate_required = 3, .validate_required = 3,
.palindorme_num = 4, .palindorme_num = 4,
.word_check = 1, .word_check = 1,
@ -30,7 +31,7 @@ index ddcfca5..f30c2b8 100644
.first_letter_uppercase = 0, .first_letter_uppercase = 0,
}, },
}; };
@@ -252,15 +252,15 @@ int update_conf(OS_TYPE os_type) { @@ -247,15 +247,15 @@ int update_conf(OS_TYPE os_type) {
} else { } else {
// 如果找到了该字段 // 如果找到了该字段
// 如果是服务器版,强制覆盖配置 // 如果是服务器版,强制覆盖配置
@ -38,9 +39,9 @@ index ddcfca5..f30c2b8 100644
- // sprintf(append_string + offset, "STRONG_PASSWORD = %s\n", "true"); - // sprintf(append_string + offset, "STRONG_PASSWORD = %s\n", "true");
- // DEBUG("restore STRONG_PASSWORD"); - // DEBUG("restore STRONG_PASSWORD");
- // } else { - // } else {
+ if (OS_SERVER == os_type) { + if (OS_EULER == os_type) {
+ sprintf(append_string + offset, "STRONG_PASSWORD = %s\n", "true"); + sprintf(append_string + offset, "STRONG_PASSWORD = %s\n", "true");
+ DEBUG("restore STRONG_PASSWORD"); + DEBUG("restore STRONG_PASSWORD");
+ } else { + } else {
// 如果不是服务器版,则维持原配置 // 如果不是服务器版,则维持原配置
sprintf(append_string + offset, sprintf(append_string + offset,
@ -51,7 +52,7 @@ index ddcfca5..f30c2b8 100644
} }
offset = strlen(append_string); offset = strlen(append_string);
@@ -270,18 +270,18 @@ int update_conf(OS_TYPE os_type) { @@ -265,18 +265,18 @@ int update_conf(OS_TYPE os_type) {
default_conf[os_type].min_length); default_conf[os_type].min_length);
DEBUG("set PASSWORD_MIN_LENGTH"); DEBUG("set PASSWORD_MIN_LENGTH");
} else { } else {
@ -61,11 +62,11 @@ index ddcfca5..f30c2b8 100644
- // default_conf[os_type].min_length); - // default_conf[os_type].min_length);
- // DEBUG("restore PASSWORD_MIN_LENGTH"); - // DEBUG("restore PASSWORD_MIN_LENGTH");
- // } else { - // } else {
+ if (OS_SERVER == os_type) { + if (OS_EULER == os_type) {
+ sprintf(append_string + offset, + sprintf(append_string + offset,
+ "PASSWORD_MIN_LENGTH = %d\n", + "PASSWORD_MIN_LENGTH = %d\n",
+ default_conf[os_type].min_length); + default_conf[os_type].min_length);
+ DEBUG("restore PASSWORD_MIN_LENGTH"); + DEBUG("restore PASSWORD_MIN_LENGTH");
+ } else { + } else {
sprintf(append_string + offset, sprintf(append_string + offset,
"PASSWORD_MIN_LENGTH = %d\n", "PASSWORD_MIN_LENGTH = %d\n",
@ -77,7 +78,7 @@ index ddcfca5..f30c2b8 100644
} }
offset = strlen(append_string); offset = strlen(append_string);
@@ -291,18 +291,18 @@ int update_conf(OS_TYPE os_type) { @@ -286,38 +286,40 @@ int update_conf(OS_TYPE os_type) {
default_conf[os_type].max_length); default_conf[os_type].max_length);
DEBUG("set PASSWORD_MAX_LENGTH"); DEBUG("set PASSWORD_MAX_LENGTH");
} else { } else {
@ -87,11 +88,11 @@ index ddcfca5..f30c2b8 100644
- // default_conf[os_type].max_length); - // default_conf[os_type].max_length);
- // DEBUG("restore PASSWORD_MAX_LENGTH"); - // DEBUG("restore PASSWORD_MAX_LENGTH");
- // } else { - // } else {
+ if (OS_SERVER == os_type) { + if (OS_EULER == os_type) {
+ sprintf(append_string + offset, + sprintf(append_string + offset,
+ "PASSWORD_MAX_LENGTH = %d\n", + "PASSWORD_MAX_LENGTH = %d\n",
+ default_conf[os_type].max_length); + default_conf[os_type].max_length);
+ DEBUG("restore PASSWORD_MAX_LENGTH"); + DEBUG("restore PASSWORD_MAX_LENGTH");
+ } else { + } else {
sprintf(append_string + offset, sprintf(append_string + offset,
"PASSWORD_MAX_LENGTH = %d\n", "PASSWORD_MAX_LENGTH = %d\n",
@ -103,7 +104,13 @@ index ddcfca5..f30c2b8 100644
} }
offset = strlen(append_string); offset = strlen(append_string);
@@ -315,14 +315,16 @@ int update_conf(OS_TYPE os_type) { if (iniparser_find_entry(dic, "Password:VALIDATE_POLICY") == 0) {
sprintf(append_string + offset,
- "VALIDATE_POLICY = \"%s\"\n",
+ "VALIDATE_POLICY = %s \n",
default_conf[os_type].validate_policy);
DEBUG("set VALIDATE_POLICY");
} else {
// char cmd[512]; // char cmd[512];
// sprintf(cmd, "sed \"/^VALIDATE_POLICY.*/\"d -i %s", PASSWD_CONF_FILE_PATH); // sprintf(cmd, "sed \"/^VALIDATE_POLICY.*/\"d -i %s", PASSWD_CONF_FILE_PATH);
// system(cmd); // system(cmd);
@ -116,19 +123,19 @@ index ddcfca5..f30c2b8 100644
- get_validate_policy(buff); - get_validate_policy(buff);
- sprintf(append_string + offset, "VALIDATE_POLICY = %s\n", buff); - sprintf(append_string + offset, "VALIDATE_POLICY = %s\n", buff);
+ if (OS_EULER == os_type) { + if (OS_EULER == os_type) {
+ sprintf(append_string + offset, + sprintf(append_string + offset,
+ "VALIDATE_POLICY = %s\n", + "VALIDATE_POLICY = %s \n",
+ default_conf[os_type].validate_policy); + default_conf[os_type].validate_policy);
+ DEBUG("set VALIDATE_POLICY after delete"); + DEBUG("set VALIDATE_POLICY after delete");
+ } else { + } else {
+ char buff[512]; + char buff[512];
+ get_validate_policy(buff); + get_validate_policy(buff);
+ sprintf(append_string + offset, "VALIDATE_POLICY = %s\n", buff); + sprintf(append_string + offset, "VALIDATE_POLICY = %s\n", buff);
+ } + }
} }
offset = strlen(append_string); offset = strlen(append_string);
@@ -332,18 +334,18 @@ int update_conf(OS_TYPE os_type) { @@ -327,18 +329,18 @@ int update_conf(OS_TYPE os_type) {
default_conf[os_type].validate_required); default_conf[os_type].validate_required);
DEBUG("set VALIDATE_REQUIRED"); DEBUG("set VALIDATE_REQUIRED");
} else { } else {
@ -138,11 +145,11 @@ index ddcfca5..f30c2b8 100644
- // default_conf[os_type].validate_required); - // default_conf[os_type].validate_required);
- // DEBUG("restore VALIDATE_REQUIRED"); - // DEBUG("restore VALIDATE_REQUIRED");
- // } else { - // } else {
+ if (OS_SERVER == os_type) { + if (OS_EULER == os_type) {
+ sprintf(append_string + offset, + sprintf(append_string + offset,
+ "VALIDATE_REQUIRED = %d\n", + "VALIDATE_REQUIRED = %d\n",
+ default_conf[os_type].validate_required); + default_conf[os_type].validate_required);
+ DEBUG("restore VALIDATE_REQUIRED"); + DEBUG("restore VALIDATE_REQUIRED");
+ } else { + } else {
sprintf(append_string + offset, sprintf(append_string + offset,
"VALIDATE_REQUIRED = %d\n", "VALIDATE_REQUIRED = %d\n",
@ -154,7 +161,7 @@ index ddcfca5..f30c2b8 100644
} }
offset = strlen(append_string); offset = strlen(append_string);
@@ -353,18 +355,18 @@ int update_conf(OS_TYPE os_type) { @@ -348,18 +350,18 @@ int update_conf(OS_TYPE os_type) {
default_conf[os_type].palindorme_num); default_conf[os_type].palindorme_num);
DEBUG("set PALINDROME_NUM"); DEBUG("set PALINDROME_NUM");
} else { } else {
@ -164,11 +171,11 @@ index ddcfca5..f30c2b8 100644
- // default_conf[os_type].palindorme_num); - // default_conf[os_type].palindorme_num);
- // DEBUG("restore PALINDROME_NUM"); - // DEBUG("restore PALINDROME_NUM");
- // } else { - // } else {
+ if (OS_SERVER == os_type) { + if (OS_EULER == os_type) {
+ sprintf(append_string + offset, + sprintf(append_string + offset,
+ "PALINDROME_NUM = %d\n", + "PALINDROME_NUM = %d\n",
+ default_conf[os_type].palindorme_num); + default_conf[os_type].palindorme_num);
+ DEBUG("restore PALINDROME_NUM"); + DEBUG("restore PALINDROME_NUM");
+ } else { + } else {
sprintf(append_string + offset, sprintf(append_string + offset,
"PALINDROME_NUM = %d\n", "PALINDROME_NUM = %d\n",
@ -180,7 +187,7 @@ index ddcfca5..f30c2b8 100644
} }
offset = strlen(append_string); offset = strlen(append_string);
@@ -372,14 +374,14 @@ int update_conf(OS_TYPE os_type) { @@ -367,14 +369,14 @@ int update_conf(OS_TYPE os_type) {
sprintf(append_string + offset, "WORD_CHECK = %d\n", default_conf[os_type].word_check); sprintf(append_string + offset, "WORD_CHECK = %d\n", default_conf[os_type].word_check);
DEBUG("set WORD_CHECK"); DEBUG("set WORD_CHECK");
} else { } else {
@ -188,9 +195,9 @@ index ddcfca5..f30c2b8 100644
- // sprintf(append_string + offset, "WORD_CHECK = %d\n", - // sprintf(append_string + offset, "WORD_CHECK = %d\n",
- // default_conf[os_type].word_check); DEBUG("restore WORD_CHECK"); - // default_conf[os_type].word_check); DEBUG("restore WORD_CHECK");
- // } else { - // } else {
+ if (OS_SERVER == os_type) { + if (OS_EULER == os_type) {
+ sprintf(append_string + offset, "WORD_CHECK = %d\n", + sprintf(append_string + offset, "WORD_CHECK = %d\n",
+ default_conf[os_type].word_check); DEBUG("restore WORD_CHECK"); + default_conf[os_type].word_check); DEBUG("restore WORD_CHECK");
+ } else { + } else {
sprintf(append_string + offset, sprintf(append_string + offset,
"WORD_CHECK = %d\n", "WORD_CHECK = %d\n",
@ -200,7 +207,7 @@ index ddcfca5..f30c2b8 100644
} }
offset = strlen(append_string); offset = strlen(append_string);
@@ -389,18 +391,18 @@ int update_conf(OS_TYPE os_type) { @@ -384,18 +386,18 @@ int update_conf(OS_TYPE os_type) {
default_conf[os_type].monotone_same_character_num); default_conf[os_type].monotone_same_character_num);
DEBUG("set MONOTONE_CHARACTER_NUM"); DEBUG("set MONOTONE_CHARACTER_NUM");
} else { } else {
@ -210,11 +217,11 @@ index ddcfca5..f30c2b8 100644
- // default_conf[os_type].monotone_same_character_num); - // default_conf[os_type].monotone_same_character_num);
- // DEBUG("restore MONOTONE_CHARACTER_NUM"); - // DEBUG("restore MONOTONE_CHARACTER_NUM");
- // } else { - // } else {
+ if (OS_SERVER == os_type) { + if (OS_EULER == os_type) {
+ sprintf(append_string + offset, + sprintf(append_string + offset,
+ "MONOTONE_CHARACTER_NUM = %d\n", + "MONOTONE_CHARACTER_NUM = %d\n",
+ default_conf[os_type].monotone_same_character_num); + default_conf[os_type].monotone_same_character_num);
+ DEBUG("restore MONOTONE_CHARACTER_NUM"); + DEBUG("restore MONOTONE_CHARACTER_NUM");
+ } else { + } else {
sprintf(append_string + offset, sprintf(append_string + offset,
"MONOTONE_CHARACTER_NUM = %d\n", "MONOTONE_CHARACTER_NUM = %d\n",
@ -226,7 +233,7 @@ index ddcfca5..f30c2b8 100644
} }
offset = strlen(append_string); offset = strlen(append_string);
@@ -410,18 +412,18 @@ int update_conf(OS_TYPE os_type) { @@ -405,18 +407,18 @@ int update_conf(OS_TYPE os_type) {
default_conf[os_type].consecutive_same_character_num); default_conf[os_type].consecutive_same_character_num);
DEBUG("set CONSECUTIVE_SAME_CHARACTER_NUM"); DEBUG("set CONSECUTIVE_SAME_CHARACTER_NUM");
} else { } else {
@ -236,11 +243,11 @@ index ddcfca5..f30c2b8 100644
- // default_conf[os_type].consecutive_same_character_num); - // default_conf[os_type].consecutive_same_character_num);
- // DEBUG("restore CONSECUTIVE_SAME_CHARACTER_NUM"); - // DEBUG("restore CONSECUTIVE_SAME_CHARACTER_NUM");
- // } else { - // } else {
+ if (OS_SERVER == os_type) { + if (OS_EULER == os_type) {
+ sprintf(append_string + offset, + sprintf(append_string + offset,
+ "CONSECUTIVE_SAME_CHARACTER_NUM = %d\n", + "CONSECUTIVE_SAME_CHARACTER_NUM = %d\n",
+ default_conf[os_type].consecutive_same_character_num); + default_conf[os_type].consecutive_same_character_num);
+ DEBUG("restore CONSECUTIVE_SAME_CHARACTER_NUM"); + DEBUG("restore CONSECUTIVE_SAME_CHARACTER_NUM");
+ } else { + } else {
sprintf(append_string + offset, sprintf(append_string + offset,
"CONSECUTIVE_SAME_CHARACTER_NUM = %d\n", "CONSECUTIVE_SAME_CHARACTER_NUM = %d\n",
@ -252,7 +259,7 @@ index ddcfca5..f30c2b8 100644
} }
offset = strlen(append_string); offset = strlen(append_string);
@@ -429,14 +431,14 @@ int update_conf(OS_TYPE os_type) { @@ -424,14 +426,14 @@ int update_conf(OS_TYPE os_type) {
sprintf(append_string + offset, "DICT_PATH = %s\n", ""); sprintf(append_string + offset, "DICT_PATH = %s\n", "");
DEBUG("set DICT_PATH"); DEBUG("set DICT_PATH");
} else { } else {
@ -260,9 +267,9 @@ index ddcfca5..f30c2b8 100644
- // sprintf(append_string + offset, "DICT_PATH = %s\n", ""); - // sprintf(append_string + offset, "DICT_PATH = %s\n", "");
- // DEBUG("restore DICT_PATH"); - // DEBUG("restore DICT_PATH");
- // } else { - // } else {
+ if (OS_SERVER == os_type) { + if (OS_EULER == os_type) {
+ sprintf(append_string + offset, "DICT_PATH = %s\n", ""); + sprintf(append_string + offset, "DICT_PATH = %s\n", "");
+ DEBUG("restore DICT_PATH"); + DEBUG("restore DICT_PATH");
+ } else { + } else {
sprintf(append_string + offset, sprintf(append_string + offset,
"DICT_PATH = %s\n", "DICT_PATH = %s\n",
@ -272,7 +279,7 @@ index ddcfca5..f30c2b8 100644
} }
offset = strlen(append_string); offset = strlen(append_string);
@@ -444,15 +446,15 @@ int update_conf(OS_TYPE os_type) { @@ -439,15 +441,15 @@ int update_conf(OS_TYPE os_type) {
sprintf(append_string + offset, "FIRST_LETTER_UPPERCASE = %s\n", "false"); sprintf(append_string + offset, "FIRST_LETTER_UPPERCASE = %s\n", "false");
DEBUG("set FIRST_LETTER_UPPERCASE"); DEBUG("set FIRST_LETTER_UPPERCASE");
} else { } else {
@ -280,9 +287,9 @@ index ddcfca5..f30c2b8 100644
- // sprintf(append_string + offset, "FIRST_LETTER_UPPERCASE = %s\n", "false"); - // sprintf(append_string + offset, "FIRST_LETTER_UPPERCASE = %s\n", "false");
- // DEBUG("restore FIRST_LETTER_UPPERCASE"); - // DEBUG("restore FIRST_LETTER_UPPERCASE");
- // } else { - // } else {
+ if (OS_SERVER == os_type) { + if (OS_EULER == os_type) {
+ sprintf(append_string + offset, "FIRST_LETTER_UPPERCASE = %s\n", "false"); + sprintf(append_string + offset, "FIRST_LETTER_UPPERCASE = %s\n", "false");
+ DEBUG("restore FIRST_LETTER_UPPERCASE"); + DEBUG("restore FIRST_LETTER_UPPERCASE");
+ } else { + } else {
sprintf(append_string + offset, sprintf(append_string + offset,
"FIRST_LETTER_UPPERCASE = %s\n", "FIRST_LETTER_UPPERCASE = %s\n",
@ -293,6 +300,13 @@ index ddcfca5..f30c2b8 100644
} }
DEBUG("append string :%s", append_string); DEBUG("append string :%s", append_string);
@@ -491,4 +493,4 @@ int main(int argc, char **argv) {
}
return 0;
-}
\ No newline at end of file
+}
-- --
2.20.1 2.27.0

View File

@ -0,0 +1,34 @@
From f43960d62583c6e177079b3bab6795450cee3092 Mon Sep 17 00:00:00 2001
From: songmingliang <songmingliang@uniontech.com>
Date: Mon, 20 Jun 2022 13:48:00 +0800
Subject: [PATCH] delete blank
---
tool/pwd_conf_update.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tool/pwd_conf_update.c b/tool/pwd_conf_update.c
index 3f90ee6..cb417df 100644
--- a/tool/pwd_conf_update.c
+++ b/tool/pwd_conf_update.c
@@ -303,7 +303,7 @@ int update_conf(OS_TYPE os_type) {
if (iniparser_find_entry(dic, "Password:VALIDATE_POLICY") == 0) {
sprintf(append_string + offset,
- "VALIDATE_POLICY = %s \n",
+ "VALIDATE_POLICY = %s\n",
default_conf[os_type].validate_policy);
DEBUG("set VALIDATE_POLICY");
} else {
@@ -312,7 +312,7 @@ int update_conf(OS_TYPE os_type) {
// system(cmd);
if (OS_EULER == os_type) {
sprintf(append_string + offset,
- "VALIDATE_POLICY = %s \n",
+ "VALIDATE_POLICY = %s\n",
default_conf[os_type].validate_policy);
DEBUG("set VALIDATE_POLICY after delete");
} else {
--
2.27.0

View File

@ -1,12 +0,0 @@
[Password]
STRONG_PASSWORD = true
PASSWORD_MIN_LENGTH = 8
PASSWORD_MAX_LENGTH = 511
VALIDATE_POLICY = 1234567890;abcdefghijklmnopqrstuvwxyz;ABCDEFGHIJKLMNOPQRSTUVWXYZ;!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
VALIDATE_REQUIRED = 3
PALINDROME_NUM = 4
WORD_CHECK = 1
MONOTONE_CHARACTER_NUM = 0
CONSECUTIVE_SAME_CHARACTER_NUM = 0
DICT_PATH =
FIRST_LETTER_UPPERCASE = false

Binary file not shown.

Binary file not shown.

View File

@ -1,34 +1,39 @@
# Run tests in check section # Run tests in check section
# disable for bootstrapping # disable for bootstrapping
%bcond_with check %bcond_with check
%global with_debug 0 %global with_debug 1
%if 0%{?with_debug} %if 0%{?with_debug}
%global debug_package %{nil} %global debug_package %{nil}
%endif %endif
Name: deepin-pw-check Name: deepin-pw-check
Version: 5.1.17 Version: 5.1.4
Release: 1 Release: 1
Summary: Used to check password and manager the configuration for password. Summary: Used to check password and manager the configuration for password.
License: GPL-3.0 License: GPLv3
URL: https://github.com/linuxdeepin/%{name} URL: %{gourl}
Source0: %{name}-%{version}.tar.gz Source0: %{name}-%{version}.tar.gz
Source1: vendor.tar.gz
Source2: dde.conf
Patch1000: 0001-fix-for-UonioTech.patch Patch1000: 0001-fix-for-UonioTech.patch
Patch1001: 1000-deepin-pw-check-modify-password-policy.patch #uelc patch
Patch1001: 0001-Mangle-Suit-Cracklib2.9.6.patch
#uel patch
Patch1002: 1000-deepin-pw-check-modify-password-policy.patch
Patch1003: 1001-deepin-pw-check-uos-delete-blank.patch
BuildRequires: golang BuildRequires: compiler(go-compiler)
BuildRequires: pam-devel BuildRequires: pam-devel
BuildRequires: pkgconfig(gio-2.0) BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(gdk-3.0) BuildRequires: pkgconfig(gdk-3.0)
BuildRequires: deepin-gettext-tools BuildRequires: deepin-gettext-tools
BuildRequires: gocode
BuildRequires: cracklib-devel BuildRequires: cracklib-devel
BuildRequires: iniparser BuildRequires: iniparser
BuildRequires: golang-github-linuxdeepin-go-dbus-factory-devel
BuildRequires: go-lib-devel
BuildRequires: go-gir-generator
Requires: polkit Requires: polkit
Requires: license-config
%description %description
In order to unify the authentication interface, In order to unify the authentication interface,
this interface is designed to adapt to fingerprint, face and other authentication methods. this interface is designed to adapt to fingerprint, face and other authentication methods.
@ -44,22 +49,30 @@ this interface is designed to adapt to fingerprint, face and other authenticatio
%prep %prep
%setup -q %setup -q
%patch1000 -p1 %patch1000 -p1
%patch1001 -p1 %patch1002 -p1
%patch1003 -p1
tar -xf %{SOURCE1}
%build %build
go env -w GO111MODULE=auto %ifarch loongarch64
export CGO_ENABLED=1
export GOOS="linux"
%endif
BUILDID="0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" BUILDID="0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')"
export GOPATH=%{_builddir}/%{name}-%{version}/vendor:$GOPATH export GOPATH=/usr/share/gocode
%make_build GO_BUILD_FLAGS=-trimpath GOBUILD="go build -compiler gc -ldflags \"-B $BUILDID\"" %make_build GO_BUILD_FLAGS=-trimpath GOBUILD="go build -compiler gc -ldflags \"-B $BUILDID\""
%post %post
pwd-conf-update
sed -i "s/pam_pwquality.so/pam_deepin_pw_check.so/g" /etc/pam.d/system-auth
sed -i "s/pam_pwquality.so/pam_deepin_pw_check.so/g" /etc/pam.d/password-auth
%postun %postun
if [ "$1" = "0" ] ; then
sed -i "s/pam_deepin_pw_check.so/pam_pwquality.so/g" /etc/pam.d/system-auth
sed -i "s/pam_deepin_pw_check.so/pam_pwquality.so/g" /etc/pam.d/password-auth
fi
%install %install
mkdir -p %{buildroot}/%{_sysconfdir}/deepin mkdir -p %{buildroot}/%{_sysconfdir}/deepin
@ -68,37 +81,40 @@ export PKG_FILE_DIR=%{_libdir}/pkgconfig
%make_install PKG_FILE_DIR=%{_libdir}/pkgconfig LIBDIR=lib64 PAM_MODULE_DIR=%{_libdir}/security GOBUILD="go build -compiler gc -ldflags \"-B $BUILDID\"" %make_install PKG_FILE_DIR=%{_libdir}/pkgconfig LIBDIR=lib64 PAM_MODULE_DIR=%{_libdir}/security GOBUILD="go build -compiler gc -ldflags \"-B $BUILDID\""
%find_lang deepin-pw-check %find_lang deepin-pw-check
install -Dm644 %{SOURCE2} %{buildroot}%{_sysconfdir}/deepin/dde.conf %ifarch i686
mv %{buildroot}/usr/lib64/libdeepin_pw_check.so* %{buildroot}/usr/lib/
%endif
%files -f deepin-pw-check.lang %files -f deepin-pw-check.lang
%doc README.md %doc README.md
%license %license
%dir %{_sysconfdir}/deepin %dir %{_sysconfdir}/deepin
%{_sysconfdir}/deepin/dde.conf
%{_bindir}/pwd-conf-update %{_bindir}/pwd-conf-update
%{_prefix}/lib/deepin-pw-check/deepin-pw-check %{_prefix}/lib/deepin-pw-check/deepin-pw-check
%{_libdir}/libdeepin_pw_check.so.* %{_libdir}/libdeepin_pw_check.so.*
%ifarch i686
/usr/lib/security/pam_deepin_pw_check.so
%else
%{_libdir}/security/pam_deepin_pw_check.so %{_libdir}/security/pam_deepin_pw_check.so
%endif
%{_datadir}/dbus-1/system-services/*.service %{_datadir}/dbus-1/system-services/*.service
%{_datadir}/dbus-1/system.d/*.conf %{_datadir}/dbus-1/system.d/*.conf
%{_datadir}/polkit-1/actions/*.policy %{_datadir}/polkit-1/actions/*.policy
%files devel %files devel
%ifarch i686
/usr/lib64/libdeepin_pw_check.a
/usr/lib/pkgconfig/libdeepin_pw_check.pc
%else
%{_libdir}/libdeepin_pw_check.a %{_libdir}/libdeepin_pw_check.a
%{_libdir}/libdeepin_pw_check.so
%{_libdir}/pkgconfig/libdeepin_pw_check.pc %{_libdir}/pkgconfig/libdeepin_pw_check.pc
%endif
%{_libdir}/libdeepin_pw_check.so
%{_includedir}/deepin_pw_check.h %{_includedir}/deepin_pw_check.h
%changelog %changelog
* Tue Jul 25 2023 leeffo <liweiganga@uniontech.com> - 5.1.17-1 * Fri Dec 01 2023 zhangshaoning <zhangshaoning@uniontech.com> -5.1.4-1
- upgrade to version 5.1.17 - rebase to deepin-pw-check-5.1.4-1
* Wed Jun 28 2023 liweigang <liweiganga@uniontech.com> - 5.1.4-2
- feat: update golang.org/x/sys
* Mon Apr 03 2023 liweiganga <liweiganga@uniontech.com> - 5.1.4-1
- update: update to 5.1.4
* Wed Dec 21 2022 liweiganga <liweiganga@uniontech.com> - 5.0.20.7-3 * Wed Dec 21 2022 liweiganga <liweiganga@uniontech.com> - 5.0.20.7-3
- enable debuginfo for fix strip - enable debuginfo for fix strip

View File

@ -1,4 +0,0 @@
version_control: github
src_repo: linuxdeepin/deepin-pw-check
tag_prefix: ^v
seperator: .

Binary file not shown.