Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
LSH
lsh
Commits
1cff8e2b
Commit
1cff8e2b
authored
Dec 07, 2001
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added comments on how to fix use of setuid.
Rev: src/unix_user.c:1.43
parent
b63de24d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
src/unix_user.c
src/unix_user.c
+12
-1
No files found.
src/unix_user.c
View file @
1cff8e2b
...
...
@@ -660,7 +660,8 @@ do_read_file(struct lsh_user *u,
{
int
fd
;
close
(
out
[
0
]);
/* FIXME: Use seteuid instead? */
if
(
(
me
!=
user
->
super
.
uid
)
&&
(
setuid
(
user
->
super
.
uid
)
<
0
)
)
{
werror
(
"unix_user.c: do_read_file: setuid failed (errno = %i): %z
\n
"
,
...
...
@@ -755,6 +756,16 @@ change_uid(struct unix_user *user)
return
1
;
}
/* FIXME: In child processes, between do_fork_process and do_exec_shell,
* we're running with the user's uid, which seems dangerous.
* It seems better to move uid handling to exec-time, and perhaps
* to a separate program.
*
* The potential problem is that a user can read the process memory
* before exec, and learn the host key or other secrets. The safest
* way seems to be to be to exec a separate program, which changes
* persona and then exec's the real login shell. */
static
int
do_fork_process
(
struct
lsh_user
*
u
,
struct
lsh_process
**
process
,
...
...
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