From: Jo-Philipp Wich Date: Fri, 12 Aug 2011 10:33:40 +0000 (+0000) Subject: luci-0.10: merge r7347 - r7354 X-Git-Tag: 0.10.0~85 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1fe56398321f6569ac9c75c703f9a5dc5198642b;p=oweals%2Fluci.git luci-0.10: merge r7347 - r7354 --- diff --git a/libs/lucid/luasrc/lucid.lua b/libs/lucid/luasrc/lucid.lua index 7ecdf2acd..38b34fde9 100644 --- a/libs/lucid/luasrc/lucid.lua +++ b/libs/lucid/luasrc/lucid.lua @@ -150,6 +150,7 @@ function run() if tpids[pid] ~= true then tpids[pid](pid, stat, code) end + tpids[pid] = nil end pid, stat, code = nixio.wait(-1, "nohang") end diff --git a/libs/nixio/Makefile b/libs/nixio/Makefile index 2a7552daf..42d366652 100644 --- a/libs/nixio/Makefile +++ b/libs/nixio/Makefile @@ -10,6 +10,7 @@ AXTLS_VERSION = 1.2.1 AXTLS_DIR = axTLS AXTLS_FILE = $(AXTLS_DIR)-$(AXTLS_VERSION).tar.gz NIXIO_TLS ?= openssl +NIXIO_SHADOW ?= $(shell echo 'int main(void){ return !getspnam("root"); }' | $(CC) -include shadow.h -xc -o/dev/null - 2>/dev/null && echo yes) NIXIO_SO = nixio.so NIXIO_LDFLAGS = @@ -20,8 +21,8 @@ else endif NIXIO_OBJ = src/nixio.o src/socket.o src/sockopt.o src/bind.o src/address.o \ - src/poll.o src/io.o src/file.o src/splice.o src/process.o src/syslog.o \ - src/bit.o src/binary.o src/fs.o src/user.o \ + src/protoent.o src/poll.o src/io.o src/file.o src/splice.o src/process.o \ + src/syslog.o src/bit.o src/binary.o src/fs.o src/user.o \ $(if $(NIXIO_TLS),src/tls-crypto.o src/tls-context.o src/tls-socket.o,) ifeq ($(NIXIO_TLS),axtls) @@ -45,6 +46,10 @@ ifeq ($(NIXIO_TLS),) NIXIO_CFLAGS += -DNO_TLS endif +ifneq ($(NIXIO_SHADOW),yes) + NIXIO_CFLAGS += -DNO_SHADOW +endif + ifeq ($(OS),SunOS) NIXIO_LDFLAGS += -lsocket -lnsl -lsendfile diff --git a/libs/nixio/docsrc/nixio.lua b/libs/nixio/docsrc/nixio.lua index 90331cf23..1b434d76d 100644 --- a/libs/nixio/docsrc/nixio.lua +++ b/libs/nixio/docsrc/nixio.lua @@ -37,6 +37,39 @@ module "nixio" --
  • ifindex = Interface Index (Linux, "packet"-family)
  • -- +--- Get protocol entry by name. +-- @usage This function returns nil if the given protocol is unknown. +-- @class function +-- @name nixio.getprotobyname +-- @param name protocol name to lookup +-- @return Table containing the following fields: + +--- Get protocol entry by number. +-- @usage This function returns nil if the given protocol is unknown. +-- @class function +-- @name nixio.getprotobynumber +-- @param proto protocol number to lookup +-- @return Table containing the following fields: + +--- Get all or a specifc proto entry. +-- @class function +-- @name nixio.getproto +-- @param proto protocol number or name to lookup (optional) +-- @return Table (or if no parameter is given, a table of tables) +-- containing the following fields: + --- Create a new socket and bind it to a network address. -- This function is a shortcut for calling nixio.socket and then bind() -- on the socket object. @@ -431,4 +464,4 @@ module "nixio" -- @class function -- @name nixio.tls -- @param mode TLS-Mode ["client", "server"] --- @return TLSContext Object \ No newline at end of file +-- @return TLSContext Object diff --git a/libs/nixio/src/bind.c b/libs/nixio/src/bind.c index 81ab0bb48..711205955 100644 --- a/libs/nixio/src/bind.c +++ b/libs/nixio/src/bind.c @@ -180,7 +180,7 @@ static int nixio_sock__bind_connect(lua_State *L, int do_bind) { } /* on success */ - if (!status) { + if (!status || errno == EINPROGRESS) { break; } } diff --git a/libs/nixio/src/nixio.c b/libs/nixio/src/nixio.c index f6e8e184c..ae81c6f96 100644 --- a/libs/nixio/src/nixio.c +++ b/libs/nixio/src/nixio.c @@ -22,7 +22,7 @@ #include #include -#define VERSION 0.3 +#define VERSION 0.4 /* pushes nil, error number and errstring on the stack */ @@ -133,6 +133,7 @@ NIXIO_API int luaopen_nixio(lua_State *L) { nixio_open_sockopt(L); nixio_open_bind(L); nixio_open_address(L); + nixio_open_protoent(L); nixio_open_poll(L); nixio_open_io(L); nixio_open_splice(L); @@ -198,6 +199,8 @@ NIXIO_API int luaopen_nixio(lua_State *L) { NIXIO_PUSH_CONSTANT(SIGSEGV); #ifndef __WINNT__ + NIXIO_PUSH_CONSTANT(EALREADY); + NIXIO_PUSH_CONSTANT(EINPROGRESS); NIXIO_PUSH_CONSTANT(EWOULDBLOCK); NIXIO_PUSH_CONSTANT(ELOOP); NIXIO_PUSH_CONSTANT(EOVERFLOW); diff --git a/libs/nixio/src/nixio.h b/libs/nixio/src/nixio.h index 2be197f13..8802e9204 100644 --- a/libs/nixio/src/nixio.h +++ b/libs/nixio/src/nixio.h @@ -111,6 +111,7 @@ void nixio_open_socket(lua_State *L); void nixio_open_sockopt(lua_State *L); void nixio_open_bind(lua_State *L); void nixio_open_address(lua_State *L); +void nixio_open_protoent(lua_State *L); void nixio_open_poll(lua_State *L); void nixio_open_io(lua_State *L); void nixio_open_splice(lua_State *L); diff --git a/libs/nixio/src/protoent.c b/libs/nixio/src/protoent.c new file mode 100644 index 000000000..bda68a584 --- /dev/null +++ b/libs/nixio/src/protoent.c @@ -0,0 +1,103 @@ +/* + * nixio - Linux I/O library for lua + * + * Copyright (C) 2011 Jo-Philipp Wich + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "nixio.h" + +#ifndef __WINNT__ +#include +#endif + +/** + * protoent conversion helper + */ +static int nixio__pushprotoent(lua_State *L, struct protoent *e) { + int i; + if (e) { + lua_newtable(L); + + lua_pushstring(L, e->p_name); + lua_setfield(L, -2, "name"); + + lua_pushnumber(L, e->p_proto); + lua_setfield(L, -2, "proto"); + + lua_newtable(L); + for (i = 0; e->p_aliases[i]; i++) { + lua_pushstring(L, e->p_aliases[i]); + lua_rawseti(L, -2, i+1); + } + lua_setfield(L, -2, "aliases"); + return 1; + } else { + return 0; + } +} + +/** + * getprotobyname(name) + */ +static int nixio_getprotobyname(lua_State *L) { + const char *name = luaL_checkstring(L, 1); + struct protoent *res = getprotobyname(name); + return nixio__pushprotoent(L, res); +} + +/** + * getprotobynumber(proto) + */ +static int nixio_getprotobynumber(lua_State *L) { + int proto = luaL_checkinteger(L, 1); + struct protoent *res = getprotobynumber(proto); + return nixio__pushprotoent(L, res); +} + +/** + * getproto(name_or_proto) + */ +static int nixio_getproto(lua_State *L) { + int i = 1; + struct protoent *res; + if (lua_isnumber(L, 1)) { + return nixio_getprotobynumber(L); + } else if (lua_isstring(L, 1)) { + return nixio_getprotobyname(L); + } else if (lua_isnoneornil(L, 1)) { + setprotoent(1); + lua_newtable(L); + while ((res = getprotoent()) != NULL) { + nixio__pushprotoent(L, res); + lua_rawseti(L, -2, i++); + } + endprotoent(); + return 1; + } else { + return luaL_argerror(L, 1, "supported values: , "); + } +} + +/* module table */ +static const luaL_reg R[] = { + {"getprotobyname", nixio_getprotobyname}, + {"getprotobynumber", nixio_getprotobynumber}, + {"getproto", nixio_getproto}, + {NULL, NULL} +}; + +void nixio_open_protoent(lua_State *L) { + luaL_register(L, NULL, R); +} diff --git a/libs/nixio/src/user.c b/libs/nixio/src/user.c index bc2184f99..b701bac95 100644 --- a/libs/nixio/src/user.c +++ b/libs/nixio/src/user.c @@ -28,7 +28,9 @@ #include #ifndef BSD +#ifndef NO_SHADOW #include +#endif #include #endif @@ -162,6 +164,7 @@ static int nixio_getpw(lua_State *L) { } #ifndef BSD +#ifndef NO_SHADOW static int nixio__push_spwd(lua_State *L, struct spwd *sp) { lua_createtable(L, 0, 9); lua_pushstring(L, sp->sp_namp); @@ -216,6 +219,7 @@ static int nixio_getsp(lua_State *L) { return nixio__push_spwd(L, sp); } } +#endif /* !NO_SHADOW */ #endif /* !BSD */ static int nixio_crypt(lua_State *L) { @@ -239,7 +243,9 @@ static const luaL_reg R[] = { {"getgr", nixio_getgr}, {"getpw", nixio_getpw}, #ifndef BSD +#ifndef NO_SHADOW {"getsp", nixio_getsp}, +#endif #endif {NULL, NULL} }; diff --git a/po/de/asterisk.po b/po/de/asterisk.po index 3947abd35..9bf21345d 100644 --- a/po/de/asterisk.po +++ b/po/de/asterisk.po @@ -3,13 +3,15 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-05-26 17:57+0200\n" -"PO-Revision-Date: 2009-05-20 23:51+0200\n" -"Last-Translator: Stefan Pirwitz \n" +"PO-Revision-Date: 2011-08-07 16:59+0200\n" +"Last-Translator: Manuel \n" "Language-Team: LANGUAGE \n" +"Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Pootle 1.1.0\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Pootle 2.0.4\n" #. Asterisk General Options #: applications/luci-asterisk/luasrc/i18n/asterisk.en.lua:1 @@ -19,7 +21,7 @@ msgstr "Grundeinstellungen für Asterisk" #. AGI directory #: applications/luci-asterisk/luasrc/i18n/asterisk.en.lua:2 msgid "AGI directory" -msgstr "AGI - Verzeichniss" +msgstr "AGI - Verzeichnis" #. Cache recorded sound files during recording #: applications/luci-asterisk/luasrc/i18n/asterisk.en.lua:3 @@ -29,7 +31,6 @@ msgstr "Puffere aufgenommene Audiodateien während der Aufname." #. Debug Level #: applications/luci-asterisk/luasrc/i18n/asterisk.en.lua:4 -#, fuzzy msgid "Debug Level" msgstr "Fehlerausgabestufe" @@ -52,24 +53,22 @@ msgstr "Hohe Priorität" #. Initialise Crypto #: applications/luci-asterisk/luasrc/i18n/asterisk.en.lua:8 msgid "Initialise Crypto" -msgstr "" +msgstr "Verschlüsselung initialisieren" #. Use Internal Timing #: applications/luci-asterisk/luasrc/i18n/asterisk.en.lua:9 msgid "Use Internal Timing" -msgstr "" +msgstr "Interne Zeitreferenz benutzen" #. Log directory #: applications/luci-asterisk/luasrc/i18n/asterisk.en.lua:10 -#, fuzzy msgid "Log directory" -msgstr "AGI - Verzeichniss" +msgstr "Log - Verzeichnis" #. Maximum number of calls allowed #: applications/luci-asterisk/luasrc/i18n/asterisk.en.lua:11 -#, fuzzy msgid "Maximum number of calls allowed" -msgstr "AGI - Verzeichniss" +msgstr "Maximale Anruferanzahl" #. Maximum load to stop accepting new calls #: applications/luci-asterisk/luasrc/i18n/asterisk.en.lua:12 diff --git a/po/de/diag_core.po b/po/de/diag_core.po index 0fcf3506d..95d5a9612 100644 --- a/po/de/diag_core.po +++ b/po/de/diag_core.po @@ -1,17 +1,22 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2011-08-07 17:01+0200\n" +"Last-Translator: Manuel \n" "Language-Team: none\n" +"Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Pootle 2.0.4\n" msgid "" "With this menu you can configure network diagnostics, such as network device " "scans and ping tests." msgstr "" +"Hier werden die Netzwerk Diagnose Tools konfiguriert (zB. Netzwerkscans und " +"Pings)." msgid "" "The entries in the menu allow you to perform diagnostic tests on your system " @@ -19,7 +24,7 @@ msgid "" msgstr "" msgid "Configure Diagnostics" -msgstr "" +msgstr "Diagnose-Tests konfigurieren" msgid "l_d_diag" msgstr "" diff --git a/po/fr/base.po b/po/fr/base.po index 69c8f65cc..512816ffd 100644 --- a/po/fr/base.po +++ b/po/fr/base.po @@ -3,8 +3,8 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-06-10 03:40+0200\n" -"PO-Revision-Date: 2011-06-18 10:16+0200\n" -"Last-Translator: fredb \n" +"PO-Revision-Date: 2011-08-07 16:47+0200\n" +"Last-Translator: Manuel \n" "Language-Team: LANGUAGE \n" "Language: fr\n" "MIME-Version: 1.0\n" @@ -44,7 +44,7 @@ msgid "40MHz 2nd channel above" msgstr "Second canal de 40 MHz suivant" msgid "40MHz 2nd channel below" -msgstr "Decond canal de 40 MHz précédent" +msgstr "Second canal de 40 MHz précédent" msgid "5 Minute Load:" msgstr "Charge sur 5 minutes :" @@ -2233,8 +2233,8 @@ msgid "" "The following files are detected by the system and will be kept " "automatically during sysupgrade" msgstr "" -"LEs fichiers suivants ont été détectés par le système et seront " -"automatiquement< préservés pendant la mise à jour" +"Les fichiers suivants ont été détectés par le système et seront " +"automatiquement préservés pendant la mise à jour" msgid "The following rules are currently active on this system." msgstr "Les règles suivantes sont actuellement actives sur ce système."