Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
acfaec68
Commit
acfaec68
authored
8 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
FIX CVE-2017-7888
parent
36b18f03
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/core/login/functions_dolibarr.php
+2
-1
2 additions, 1 deletion
htdocs/core/login/functions_dolibarr.php
htdocs/install/step5.php
+9
-4
9 additions, 4 deletions
htdocs/install/step5.php
with
11 additions
and
5 deletions
htdocs/core/login/functions_dolibarr.php
+
2
−
1
View file @
acfaec68
...
...
@@ -78,6 +78,7 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest=
// Check crypted password
$cryptType
=
''
;
if
(
!
empty
(
$conf
->
global
->
DATABASE_PWD_ENCRYPTED
))
$cryptType
=
$conf
->
global
->
DATABASE_PWD_ENCRYPTED
;
// By default, we used MD5
if
(
!
in_array
(
$cryptType
,
array
(
'md5'
)))
$cryptType
=
'md5'
;
// Check crypted password according to crypt algorithm
...
...
This diff is collapsed.
Click to expand it.
htdocs/install/step5.php
+
9
−
4
View file @
acfaec68
...
...
@@ -162,18 +162,23 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i',$action))
{
$conf
->
setValues
(
$db
);
// Create user
// Create
admin
user
include_once
DOL_DOCUMENT_ROOT
.
'/user/class/user.class.php'
;
// Set default encryption to yes if there is no user yet into database
// Set default encryption to yes
, generate a salt and set default encryption algorythm (but only
if there is no user yet into database
)
$sql
=
"SELECT u.rowid, u.pass, u.pass_crypted"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"user as u"
;
//$sql.= " WHERE u.pass IS NOT NULL AND LENGTH(u.pass) < 32"; // Not a MD5 value
$resql
=
$db
->
query
(
$sql
);
if
(
$resql
)
{
$numrows
=
$db
->
num_rows
(
$resql
);
if
(
$numrows
==
0
)
dolibarr_set_const
(
$db
,
"DATABASE_PWD_ENCRYPTED"
,
"1"
,
'chaine'
,
0
,
''
,
$conf
->
entity
);
if
(
$numrows
==
0
)
{
// Define default setup for password encryption
dolibarr_set_const
(
$db
,
"DATABASE_PWD_ENCRYPTED"
,
"1"
,
'chaine'
,
0
,
''
,
$conf
->
entity
);
dolibarr_set_const
(
$db
,
"MAIN_SECURITY_SALT"
,
dol_print_date
(
dol_now
(),
'dayhourlog'
),
'chaine'
,
0
,
''
,
0
);
// All entities
dolibarr_set_const
(
$db
,
"MAIN_SECURITY_HASH_ALGO"
,
'sha1md5'
,
'chaine'
,
0
,
''
,
0
);
// All entities
}
}
// Create user used to create the admin user
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment