Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
23cf4fe1
Commit
23cf4fe1
authored
Dec 19, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auth: when auth is integrated, don't write passwords
This finally repairs ssh key login. :)
parent
da024c5d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
auth.inc
src/etc/inc/auth.inc
+9
-4
No files found.
src/etc/inc/auth.inc
View file @
23cf4fe1
...
@@ -406,6 +406,7 @@ function local_user_set(&$user, $force_unlock = false)
...
@@ -406,6 +406,7 @@ function local_user_set(&$user, $force_unlock = false)
$user_uid
=
$user
[
'uid'
];
$user_uid
=
$user
[
'uid'
];
$user_name
=
$user
[
'name'
];
$user_name
=
$user
[
'name'
];
$user_pass
=
$user
[
'password'
];
$user_home
=
"/home/
{
$user_name
}
"
;
$user_home
=
"/home/
{
$user_name
}
"
;
$user_shell
=
'/sbin/nologin'
;
$user_shell
=
'/sbin/nologin'
;
$user_group
=
'nobody'
;
$user_group
=
'nobody'
;
...
@@ -423,12 +424,16 @@ function local_user_set(&$user, $force_unlock = false)
...
@@ -423,12 +424,16 @@ function local_user_set(&$user, $force_unlock = false)
$user_shell
=
'/bin/csh'
;
$user_shell
=
'/bin/csh'
;
}
}
/* unlock valid shell users (only when integrated auth is disabled, our users are locked locally by default)*/
/* unlock valid shell users */
if
(
!
is_account_disabled
(
$user_name
)
&&
!
is_account_expired
(
$user_name
)
if
(
!
is_account_disabled
(
$user_name
)
&&
!
is_account_expired
(
$user_name
))
{
&&
!
empty
(
$config
[
'system'
][
'disableintegratedauth'
]))
{
$lock_account
=
'unlock'
;
$lock_account
=
'unlock'
;
}
}
/* passwords only when integrated auth is disabled */
if
(
empty
(
$config
[
'system'
][
'disableintegratedauth'
]))
{
$user_pass
=
'*'
;
}
/* root user special handling */
/* root user special handling */
if
(
$user_uid
==
0
)
{
if
(
$user_uid
==
0
)
{
$user_shell
=
isset
(
$user
[
'shell'
])
?
$user
[
'shell'
]
:
'/usr/local/etc/rc.initial'
;
$user_shell
=
isset
(
$user
[
'shell'
])
?
$user
[
'shell'
]
:
'/usr/local/etc/rc.initial'
;
...
@@ -455,7 +460,7 @@ function local_user_set(&$user, $force_unlock = false)
...
@@ -455,7 +460,7 @@ function local_user_set(&$user, $force_unlock = false)
" -g
{
$user_group
}
-s
{
$user_shell
}
-d
{
$user_home
}
"
.
" -g
{
$user_group
}
-s
{
$user_shell
}
-d
{
$user_home
}
"
.
" -c "
.
escapeshellarg
(
$comment
)
.
" -H 0 2>&1"
;
" -c "
.
escapeshellarg
(
$comment
)
.
" -H 0 2>&1"
;
$fd
=
popen
(
$cmd
,
'w'
);
$fd
=
popen
(
$cmd
,
'w'
);
fwrite
(
$fd
,
$user
[
'password'
]
);
fwrite
(
$fd
,
$user
_pass
);
pclose
(
$fd
);
pclose
(
$fd
);
/* create user directory if required */
/* create user directory if required */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment