Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
fe31e420
Commit
fe31e420
authored
Apr 01, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lua http: remove ACL in favor of the password
parent
e8150e43
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
52 deletions
+12
-52
share/Makefile.am
share/Makefile.am
+0
-2
share/lua/http/.hosts
share/lua/http/.hosts
+0
-24
share/lua/http/dialogs/.hosts
share/lua/http/dialogs/.hosts
+0
-2
share/lua/intf/http.lua
share/lua/intf/http.lua
+12
-24
No files found.
share/Makefile.am
View file @
fe31e420
...
...
@@ -283,7 +283,6 @@ DIST_http_lua = \
lua/http/dialogs/batch_window.html
\
lua/http/dialogs/error_window.html
\
lua/http/dialogs/browse_window.html
\
lua/http/dialogs/.hosts
\
lua/http/dialogs/stream_window.html
\
lua/http/dialogs/offset_window.html
\
lua/http/dialogs/stream_config_window.html
\
...
...
@@ -346,7 +345,6 @@ DIST_http_lua = \
lua/http/mobile_browse.html
\
lua/http/favicon.ico
\
lua/http/mobile_view.html
\
lua/http/.hosts
\
lua/http/requests/playlist.xml
\
lua/http/requests/playlist.json
\
lua/http/requests/README.txt
\
...
...
share/lua/http/.hosts
deleted
100644 → 0
View file @
e8150e43
#
# Access-list for VLC HTTP interface
# $Id$
#
# localhost
::1
127.0.0.1
# link-local addresses
#fe80::/64
# private addresses
#fc00::/7
#fec0::/10
#10.0.0.0/8
#172.16.0.0/12
#192.168.0.0/16
#169.254.0.0/16
# The world (uncommenting these 2 lines is not quite safe)
#::/0
#0.0.0.0/0
share/lua/http/dialogs/.hosts
deleted
100644 → 0
View file @
e8150e43
# This file is an empty access list. Leave it as is.
# You are not supposed to access files from this directory directly.
share/lua/intf/http.lua
View file @
fe31e420
...
...
@@ -116,7 +116,7 @@ function callback_error(path,url,msg)
</html>]]
end
function
dirlisting
(
url
,
listing
,
acl_
)
function
dirlisting
(
url
,
listing
)
local
list
=
{}
for
_
,
f
in
ipairs
(
listing
)
do
if
not
string.match
(
f
,
"^%."
)
then
...
...
@@ -134,7 +134,7 @@ function dirlisting(url,listing,acl_)
</body>
</html>]]
end
return
h
:
file
(
url
,
"text/html"
,
nil
,
password
,
acl_
,
callback
,
nil
)
return
h
:
file
(
url
,
"text/html"
,
nil
,
password
,
nil
,
callback
,
nil
)
end
-- FIXME: Experimental art support. Needs some cleaning up.
...
...
@@ -181,7 +181,7 @@ Error
return
content
end
function
file
(
h
,
path
,
url
,
acl_
,
mime
)
function
file
(
h
,
path
,
url
,
mime
)
local
generate_page
=
process
(
path
)
local
callback
=
function
(
data
,
request
)
-- FIXME: I'm sure that we could define a real sandbox
...
...
@@ -207,10 +207,10 @@ function file(h,path,url,acl_,mime)
end
return
table.concat
(
page
)
end
return
h
:
file
(
url
or
path
,
mime
,
nil
,
password
,
acl_
,
callback
,
nil
)
return
h
:
file
(
url
or
path
,
mime
,
nil
,
password
,
nil
,
callback
,
nil
)
end
function
rawfile
(
h
,
path
,
url
,
acl_
)
function
rawfile
(
h
,
path
,
url
)
local
filename
=
path
local
mtime
=
0
-- vlc.net.stat(filename).modification_time
local
page
=
false
-- io.open(filename):read("*a")
...
...
@@ -228,7 +228,7 @@ function rawfile(h,path,url,acl_)
end
return
page
end
return
h
:
file
(
url
or
path
,
nil
,
nil
,
password
,
acl_
,
callback
,
nil
)
return
h
:
file
(
url
or
path
,
nil
,
nil
,
password
,
nil
,
callback
,
nil
)
end
function
parse_url_request
(
request
)
...
...
@@ -278,19 +278,9 @@ do
package.path
=
oldpath
end
local
files
=
{}
local
function
load_dir
(
dir
,
root
,
parent_acl
)
local
function
load_dir
(
dir
,
root
)
local
root
=
root
or
"/"
local
has_index
=
false
local
my_acl
=
parent_acl
do
local
af
=
dir
..
"/.hosts"
local
s
=
vlc
.
net
.
stat
(
af
)
if
s
and
s
.
type
==
"file"
then
-- We found an acl
my_acl
=
vlc
.
acl
(
false
)
my_acl
:
load_file
(
af
)
end
end
local
d
=
vlc
.
net
.
opendir
(
dir
)
for
_
,
f
in
ipairs
(
d
)
do
if
not
string.match
(
f
,
"^%."
)
then
...
...
@@ -307,20 +297,19 @@ local function load_dir(dir,root,parent_acl)
local
mime
=
mimes
[
ext
]
-- print(url,mime)
if
mime
and
string.match
(
mime
,
"^text/"
)
then
table.insert
(
files
,
file
(
h
,
dir
..
"/"
..
f
,
url
,
m
y_acl
,
m
ime
))
table.insert
(
files
,
file
(
h
,
dir
..
"/"
..
f
,
url
,
mime
))
else
table.insert
(
files
,
rawfile
(
h
,
dir
..
"/"
..
f
,
url
,
my_acl
))
table.insert
(
files
,
rawfile
(
h
,
dir
..
"/"
..
f
,
url
))
end
elseif
s
.
type
==
"dir"
then
load_dir
(
dir
..
"/"
..
f
,
root
..
f
..
"/"
,
my_acl
)
load_dir
(
dir
..
"/"
..
f
,
root
..
f
..
"/"
)
end
end
end
if
not
has_index
and
not
config
.
no_index
then
-- print("Adding index for", root)
table.insert
(
files
,
dirlisting
(
root
,
d
,
my_acl
))
table.insert
(
files
,
dirlisting
(
root
,
d
))
end
return
my_acl
end
if
config
.
host
then
...
...
@@ -331,5 +320,4 @@ end
password
=
vlc
.
var
.
inherit
(
nil
,
"http-password"
)
h
=
vlc
.
httpd
()
local
root_acl
=
load_dir
(
http_dir
)
local
a
=
h
:
handler
(
"/art"
,
nil
,
password
,
root_acl
,
callback_art
,
nil
)
local
a
=
h
:
handler
(
"/art"
,
nil
,
password
,
nil
,
callback_art
,
nil
)
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