From 8a837cdeefb22f84a36a0e5a42813a2f80a71c19 Mon Sep 17 00:00:00 2001 From: Peter Hormanns Date: Fri, 19 Mar 2021 19:18:31 +0100 Subject: [PATCH] check password complexity in backend --- hsarback/.classpath | 2 +- ...OT.jar => hsadmin-util-4.0.4-SNAPSHOT.jar} | Bin 10465 -> 10991 bytes .../hsadmin/mods/user/UnixUserModuleImpl.java | 8 +++++++- 3 files changed, 8 insertions(+), 2 deletions(-) rename hsarback/lib/{hsadmin-util-4.0.3-SNAPSHOT.jar => hsadmin-util-4.0.4-SNAPSHOT.jar} (65%) diff --git a/hsarback/.classpath b/hsarback/.classpath index a3b02bc..0b07c1a 100644 --- a/hsarback/.classpath +++ b/hsarback/.classpath @@ -37,6 +37,6 @@ - + diff --git a/hsarback/lib/hsadmin-util-4.0.3-SNAPSHOT.jar b/hsarback/lib/hsadmin-util-4.0.4-SNAPSHOT.jar similarity index 65% rename from hsarback/lib/hsadmin-util-4.0.3-SNAPSHOT.jar rename to hsarback/lib/hsadmin-util-4.0.4-SNAPSHOT.jar index 8c60531e0c954e5d5353665db62eda6a4a9d2992..cde4b6a13fc3594312c8a5eb7de48e2b5b8e5c21 100644 GIT binary patch delta 2150 zcmZXV3pmsJAIE3r(!VXn%w=iV7-NcImWotE{<(~mNJ;L-&eCNowRW68%ZadZi6~PR zB9};qzw5H*5^^d0TT=ATQO1c>a<<>|Kb@!N|9hVA^ZI_@-|zeRKF|02{k=bvz8`2X zA5Ue-KR}AFIWHj-hE;Bo!|ob@flUAw%oO0Glq>;yC~Z-&Hc{y}Fwofw`KqENSEvP- z7DJbnK_DkJ5C{k2bFpZSKZ8NHK1M&9kdQ_T@*Afhz9Ankn40L};(6L*SnQpf(HjHz zZq}oQ#(VXe=4NH-YSyS)!n546QP=XkN^_iD7g}SZB13NHMN7Z%ZS!tRCAkm(RTo8> z`Mq#)uCP{04qTPZRJADSwNt?!P|?jv0VG+*1d|g@M5VroNRG%Ix&kTIOAEE)LXu1L za$cn)R4mMja}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_n}ynAWV z8JTsPt}J?V=8sLZur0G~^4$dc;|&S?{{{3I0=yZSM3~{lSP-~8gA$w|da{D55~yUG z?5b)HPFU@#dSH5osu`I6sA>(S_0=4}bdg#Cn0~6}$A?<9O?Fgw2TOIUOEX3C082UX z$@|qMz(TixLV|)|AwCTy1(3$yGiD!L1$4njAl3sp1qzllz7ql}v;phu*N|p= 0) { throw new AuthorisationException(loginUser, "add", newUnixUser, "userId"); } + PasswordTool.checkPasswordComplexity(passWord); Query qPac = em.createQuery("SELECT obj FROM Pacs obj WHERE obj.name = :pacName"); qPac.setParameter("pacName", userName.substring(0, 5)); Object singleResult = qPac.getSingleResult(); @@ -164,7 +166,11 @@ public class UnixUserModuleImpl extends AbstractModuleImpl { if (!attachedUnixUser.getName().equals(detachedUnixUser.getName())) { throw new AuthorisationException(loginUser, "update", detachedUnixUser, "name"); } - attachedUnixUser.setPassword(detachedUnixUser.getPassword()); + final String passWord = detachedUnixUser.getPassword(); + if (passWord != null && passWord.length() > 0) { + PasswordTool.checkPasswordComplexity(passWord); + attachedUnixUser.setPassword(passWord); + } if (hasFullAccessOnPacOf(attachedUnixUser)) { attachedUnixUser.setComment(detachedUnixUser.getComment()); attachedUnixUser.setHomedir(detachedUnixUser.getHomedir());