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
0b5239ff
Commit
0b5239ff
authored
Apr 01, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lua: remove now unused ACL functions
parent
f478936f
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
0 additions
and
159 deletions
+0
-159
modules/lua/Modules.am
modules/lua/Modules.am
+0
-1
modules/lua/extension.c
modules/lua/extension.c
+0
-1
modules/lua/intf.c
modules/lua/intf.c
+0
-1
modules/lua/libs.h
modules/lua/libs.h
+0
-1
modules/lua/libs/acl.c
modules/lua/libs/acl.c
+0
-144
po/POTFILES.in
po/POTFILES.in
+0
-1
share/lua/README.txt
share/lua/README.txt
+0
-10
No files found.
modules/lua/Modules.am
View file @
0b5239ff
...
@@ -9,7 +9,6 @@ SOURCES_lua = \
...
@@ -9,7 +9,6 @@ SOURCES_lua = \
vlc.c \
vlc.c \
vlc.h \
vlc.h \
libs.h \
libs.h \
libs/acl.c \
libs/configuration.c \
libs/configuration.c \
libs/equalizer.c \
libs/equalizer.c \
libs/gettext.c \
libs/gettext.c \
...
...
modules/lua/extension.c
View file @
0b5239ff
...
@@ -822,7 +822,6 @@ static lua_State* GetLuaState( extensions_manager_t *p_mgr,
...
@@ -822,7 +822,6 @@ static lua_State* GetLuaState( extensions_manager_t *p_mgr,
if
(
p_ext
)
if
(
p_ext
)
{
{
/* Load more libraries */
/* Load more libraries */
luaopen_acl
(
L
);
luaopen_config
(
L
);
luaopen_config
(
L
);
luaopen_dialog
(
L
,
p_ext
);
luaopen_dialog
(
L
,
p_ext
);
luaopen_input
(
L
);
luaopen_input
(
L
);
...
...
modules/lua/intf.c
View file @
0b5239ff
...
@@ -246,7 +246,6 @@ static int Start_LuaIntf( vlc_object_t *p_this, const char *name )
...
@@ -246,7 +246,6 @@ static int Start_LuaIntf( vlc_object_t *p_this, const char *name )
luaL_register
(
L
,
"vlc"
,
p_reg
);
luaL_register
(
L
,
"vlc"
,
p_reg
);
/* register submodules */
/* register submodules */
luaopen_acl
(
L
);
luaopen_config
(
L
);
luaopen_config
(
L
);
luaopen_volume
(
L
);
luaopen_volume
(
L
);
luaopen_httpd
(
L
);
luaopen_httpd
(
L
);
...
...
modules/lua/libs.h
View file @
0b5239ff
...
@@ -24,7 +24,6 @@
...
@@ -24,7 +24,6 @@
#ifndef VLC_LUA_LIBS_H
#ifndef VLC_LUA_LIBS_H
#define VLC_LUA_LIBS_H
#define VLC_LUA_LIBS_H
void
luaopen_acl
(
lua_State
*
);
void
luaopen_config
(
lua_State
*
);
void
luaopen_config
(
lua_State
*
);
void
luaopen_dialog
(
lua_State
*
,
void
*
);
void
luaopen_dialog
(
lua_State
*
,
void
*
);
void
luaopen_httpd
(
lua_State
*
);
void
luaopen_httpd
(
lua_State
*
);
...
...
modules/lua/libs/acl.c
deleted
100644 → 0
View file @
f478936f
/*****************************************************************************
* acl.c: Access list related functions
*****************************************************************************
* Copyright (C) 2007-2010 the VideoLAN team
* $Id$
*
* Authors: Antoine Cellerier <dionoea at videolan tod org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_acl.h>
#include "../vlc.h"
#include "../libs.h"
/*****************************************************************************
*
*****************************************************************************/
static
int
vlclua_acl_create_inner
(
lua_State
*
,
vlc_acl_t
*
);
static
int
vlclua_acl_delete
(
lua_State
*
);
static
int
vlclua_acl_check
(
lua_State
*
);
static
int
vlclua_acl_duplicate
(
lua_State
*
);
static
int
vlclua_acl_add_host
(
lua_State
*
);
static
int
vlclua_acl_add_net
(
lua_State
*
);
static
int
vlclua_acl_load_file
(
lua_State
*
);
static
const
luaL_Reg
vlclua_acl_reg
[]
=
{
{
"check"
,
vlclua_acl_check
},
{
"duplicate"
,
vlclua_acl_duplicate
},
{
"add_host"
,
vlclua_acl_add_host
},
{
"add_net"
,
vlclua_acl_add_net
},
{
"load_file"
,
vlclua_acl_load_file
},
{
NULL
,
NULL
}
};
static
int
vlclua_acl_create
(
lua_State
*
L
)
{
vlc_object_t
*
p_this
=
vlclua_get_this
(
L
);
bool
b_allow
=
luaL_checkboolean
(
L
,
1
);
vlc_acl_t
*
p_acl
=
ACL_Create
(
p_this
,
b_allow
);
return
vlclua_acl_create_inner
(
L
,
p_acl
);
}
static
int
vlclua_acl_create_inner
(
lua_State
*
L
,
vlc_acl_t
*
p_acl
)
{
if
(
!
p_acl
)
return
luaL_error
(
L
,
"ACL creation failed."
);
vlc_acl_t
**
pp_acl
=
lua_newuserdata
(
L
,
sizeof
(
vlc_acl_t
*
)
);
*
pp_acl
=
p_acl
;
if
(
luaL_newmetatable
(
L
,
"acl"
)
)
{
lua_newtable
(
L
);
luaL_register
(
L
,
NULL
,
vlclua_acl_reg
);
lua_setfield
(
L
,
-
2
,
"__index"
);
lua_pushcfunction
(
L
,
vlclua_acl_delete
);
lua_setfield
(
L
,
-
2
,
"__gc"
);
}
lua_setmetatable
(
L
,
-
2
);
return
1
;
}
static
int
vlclua_acl_delete
(
lua_State
*
L
)
{
vlc_acl_t
**
pp_acl
=
(
vlc_acl_t
**
)
luaL_checkudata
(
L
,
1
,
"acl"
);
ACL_Destroy
(
*
pp_acl
);
return
0
;
}
static
int
vlclua_acl_check
(
lua_State
*
L
)
{
vlc_acl_t
**
pp_acl
=
(
vlc_acl_t
**
)
luaL_checkudata
(
L
,
1
,
"acl"
);
const
char
*
psz_ip
=
luaL_checkstring
(
L
,
2
);
lua_pushinteger
(
L
,
ACL_Check
(
*
pp_acl
,
psz_ip
)
);
return
1
;
}
static
int
vlclua_acl_duplicate
(
lua_State
*
L
)
{
vlc_object_t
*
p_this
=
vlclua_get_this
(
L
);
vlc_acl_t
**
pp_acl
=
(
vlc_acl_t
**
)
luaL_checkudata
(
L
,
1
,
"acl"
);
vlc_acl_t
*
p_acl_new
=
ACL_Duplicate
(
p_this
,
*
pp_acl
);
return
vlclua_acl_create_inner
(
L
,
p_acl_new
);
}
static
int
vlclua_acl_add_host
(
lua_State
*
L
)
{
vlc_acl_t
**
pp_acl
=
(
vlc_acl_t
**
)
luaL_checkudata
(
L
,
1
,
"acl"
);
const
char
*
psz_ip
=
luaL_checkstring
(
L
,
2
);
bool
b_allow
=
luaL_checkboolean
(
L
,
3
);
lua_pushinteger
(
L
,
ACL_AddHost
(
*
pp_acl
,
psz_ip
,
b_allow
)
);
return
1
;
}
static
int
vlclua_acl_add_net
(
lua_State
*
L
)
{
vlc_acl_t
**
pp_acl
=
(
vlc_acl_t
**
)
luaL_checkudata
(
L
,
1
,
"acl"
);
const
char
*
psz_ip
=
luaL_checkstring
(
L
,
2
);
int
i_len
=
luaL_checkint
(
L
,
3
);
bool
b_allow
=
luaL_checkboolean
(
L
,
4
);
lua_pushinteger
(
L
,
ACL_AddNet
(
*
pp_acl
,
psz_ip
,
i_len
,
b_allow
)
);
return
1
;
}
static
int
vlclua_acl_load_file
(
lua_State
*
L
)
{
vlc_acl_t
**
pp_acl
=
(
vlc_acl_t
**
)
luaL_checkudata
(
L
,
1
,
"acl"
);
const
char
*
psz_path
=
luaL_checkstring
(
L
,
2
);
lua_pushinteger
(
L
,
ACL_LoadFile
(
*
pp_acl
,
psz_path
)
);
return
1
;
}
void
luaopen_acl
(
lua_State
*
L
)
{
lua_pushcfunction
(
L
,
vlclua_acl_create
);
lua_setfield
(
L
,
-
2
,
"acl"
);
}
po/POTFILES.in
View file @
0b5239ff
...
@@ -892,7 +892,6 @@ modules/gui/skins2/x11/x11_window.cpp
...
@@ -892,7 +892,6 @@ modules/gui/skins2/x11/x11_window.cpp
modules/gui/skins2/x11/x11_window.hpp
modules/gui/skins2/x11/x11_window.hpp
modules/lua/demux.c
modules/lua/demux.c
modules/lua/intf.c
modules/lua/intf.c
modules/lua/libs/acl.c
modules/lua/libs/configuration.c
modules/lua/libs/configuration.c
modules/lua/libs.h
modules/lua/libs.h
modules/lua/libs/httpd.c
modules/lua/libs/httpd.c
...
...
share/lua/README.txt
View file @
0b5239ff
...
@@ -36,16 +36,6 @@ vlc.msg.info( "This is an info message and will be displayed in the console" )
...
@@ -36,16 +36,6 @@ vlc.msg.info( "This is an info message and will be displayed in the console" )
Note: availability of the different VLC specific Lua modules depends on
Note: availability of the different VLC specific Lua modules depends on
the type of VLC Lua script your are in.
the type of VLC Lua script your are in.
Access lists
------------
local a = vlc.acl(true) -> new ACL with default set to allow
a:check("10.0.0.1") -> 0 == allow, 1 == deny, -1 == error
a("10.0.0.1") -> same as a:check("10.0.0.1")
a:duplicate() -> duplicate ACL object
a:add_host("10.0.0.1",true) -> allow 10.0.0.1
a:add_net("10.0.0.0",24,true) -> allow 10.0.0.0/24 (not sure)
a:load_file("/path/to/acl") -> load ACL from file
Configuration
Configuration
-------------
-------------
config.get( name ): Get the VLC configuration option "name"'s value.
config.get( name ): Get the VLC configuration option "name"'s value.
...
...
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