Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
1f61d23a
Commit
1f61d23a
authored
Dec 16, 2005
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Accept UID 0 as a valid though dangerous user
parent
fedbe507
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
src/network/rootwrap.c
src/network/rootwrap.c
+16
-5
No files found.
src/network/rootwrap.c
View file @
1f61d23a
...
@@ -67,7 +67,7 @@ static uid_t parse_user (const char *name)
...
@@ -67,7 +67,7 @@ static uid_t parse_user (const char *name)
pw
=
getpwnam
(
name
);
pw
=
getpwnam
(
name
);
if
(
pw
==
NULL
)
if
(
pw
==
NULL
)
return
0
;
return
(
uid_t
)(
-
1
)
;
return
pw
->
pw_uid
;
return
pw
->
pw_uid
;
}
}
...
@@ -91,7 +91,7 @@ static uid_t guess_user (void)
...
@@ -91,7 +91,7 @@ static uid_t guess_user (void)
if
(
name
!=
NULL
)
if
(
name
!=
NULL
)
{
{
uid
=
parse_user
(
name
);
uid
=
parse_user
(
name
);
if
(
uid
!=
0
)
if
(
uid
!=
(
uid_t
)(
-
1
)
)
return
uid
;
return
uid
;
}
}
...
@@ -100,18 +100,18 @@ static uid_t guess_user (void)
...
@@ -100,18 +100,18 @@ static uid_t guess_user (void)
if
(
name
!=
NULL
)
if
(
name
!=
NULL
)
{
{
uid
=
parse_user
(
name
);
uid
=
parse_user
(
name
);
if
(
uid
!=
0
)
if
(
uid
!=
(
uid_t
)(
-
1
)
)
return
uid
;
return
uid
;
}
}
/* Try vlc */
/* Try vlc */
uid
=
parse_user
(
"vlc"
);
uid
=
parse_user
(
"vlc"
);
if
(
uid
!=
0
)
if
(
uid
!=
(
uid_t
)(
-
1
)
)
return
uid
;
return
uid
;
/* Try nobody */
/* Try nobody */
uid
=
parse_user
(
"nobody"
);
uid
=
parse_user
(
"nobody"
);
if
(
uid
!=
0
)
if
(
uid
!=
(
uid_t
)(
-
1
)
)
return
uid
;
return
uid
;
return
65534
;
return
65534
;
...
@@ -287,6 +287,17 @@ void rootwrap (void)
...
@@ -287,6 +287,17 @@ void rootwrap (void)
g
=
guess_gid
(
u
);
g
=
guess_gid
(
u
);
fprintf
(
stderr
,
", using GID %u
\n
"
,
(
unsigned
)
g
);
fprintf
(
stderr
,
", using GID %u
\n
"
,
(
unsigned
)
g
);
if
(
u
==
0
)
{
fputs
(
"***************************************
\n
"
"* Running VLC as root is discouraged. *
\n
"
"***************************************
\n
"
"
\n
"
" It is potentially dangerous, "
"and might not even work properly."
,
stderr
);
return
;
}
/* GID */
/* GID */
setgid
(
g
);
setgid
(
g
);
setgroups
(
0
,
NULL
);
setgroups
(
0
,
NULL
);
...
...
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