Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Main
Synchronet
Commits
d5bcf897
Commit
d5bcf897
authored
23 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
do_seteuid() callback does nothing if username not set.
parent
3a2f438c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/sbbscon.c
+6
-3
6 additions, 3 deletions
src/sbbs3/sbbscon.c
with
6 additions
and
3 deletions
src/sbbs3/sbbscon.c
+
6
−
3
View file @
d5bcf897
...
...
@@ -86,6 +86,8 @@ ulong served=0;
int
prompt_len
=
0
;
#ifdef __unix__
char
*
new_uid_name
=
NULL
;
char
*
new_gid_name
=
NULL
;
uid_t
new_uid
;
uid_t
old_uid
;
gid_t
new_gid
;
...
...
@@ -203,6 +205,9 @@ static BOOL do_seteuid(BOOL to_new)
static
pthread_mutex_t
mutex
;
static
BOOL
mutex_initialized
;
if
(
new_uid_name
==
NULL
)
/* not set? */
return
(
TRUE
);
/* do nothing */
if
(
!
mutex_initialized
)
{
pthread_mutex_init
(
&
mutex
,
NULL
);
mutex_initialized
=
TRUE
;
...
...
@@ -606,8 +611,6 @@ int main(int argc, char** argv)
char
*
ctrl_dir
;
BOOL
quit
=
FALSE
;
#ifdef __unix__
char
*
new_uid_name
=
NULL
;
char
*
new_gid_name
=
NULL
;
FILE
*
pidfile
;
struct
passwd
*
pw_entry
;
struct
group
*
gr_entry
;
...
...
@@ -1014,7 +1017,7 @@ int main(int argc, char** argv)
if
(
getuid
())
/* are we running as a normal user? */
bbs_lputs
(
"!Started as non-root user. Cannot bind() to ports below 1024."
);
else
if
(
!
new_uid_name
)
/* check the user arg, if we have uid 0 */
else
if
(
new_uid_name
==
NULL
)
/* check the user arg, if we have uid 0 */
bbs_lputs
(
"Warning: No user account specified, running as root."
);
else
...
...
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