mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-28 23:29:17 +08:00
Compare commits
1 Commits
dubus
...
asterisk13
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd29a10221 |
@@ -1,61 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2014-2015 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dbus-glib
|
||||
PKG_VERSION:=0.108
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_URL:=https://dbus.freedesktop.org/releases/dbus-glib/
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
|
||||
|
||||
PKG_LICENSE:=LGPL-2.1
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
define Package/libdbus-glib
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=libdbus-glib
|
||||
DEPENDS:=+libdbus +glib2
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-shared \
|
||||
--enable-static \
|
||||
--enable-debug=no \
|
||||
--disable-tests \
|
||||
--disable-bash-completion \
|
||||
|
||||
TARGET_LDFLAGS += -Wl,-rpath-link=$(ICONV_PREFIX)/lib
|
||||
TARGET_LDFLAGS += -Wl,-rpath-link=$(INTL_PREFIX)/lib
|
||||
|
||||
MAKE_PATH = dbus
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
||||
$(CP) $(PKG_BUILD_DIR)/dbus-glib-1.pc $(1)/usr/lib/pkgconfig/
|
||||
endef
|
||||
|
||||
define Package/libdbus-glib/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libdbus-glib))
|
||||
@@ -1,19 +0,0 @@
|
||||
--- a/dbus/Makefile.am
|
||||
+++ b/dbus/Makefile.am
|
||||
@@ -1,4 +1,4 @@
|
||||
-SUBDIRS = . examples
|
||||
+SUBDIRS = .
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir) \
|
||||
--- a/dbus/Makefile.in
|
||||
+++ b/dbus/Makefile.in
|
||||
@@ -612,7 +612,7 @@ target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
-SUBDIRS = . examples
|
||||
+SUBDIRS = .
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_builddir) \
|
||||
@@ -1,40 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2013 Inteno
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dubus
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
#PKG_SOURCE_VERSION:=e51cd2c2af6dd31c4fe563317a14b546ae2c5ed7
|
||||
PKG_SOURCE_VERSION:=e1ba28a08ca45b2f3bb77e74d127116071576850
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=git@private.inteno.se:dubus
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
|
||||
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/dubus
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=+libdbus +libubox +libubus +libblobmsg-json +libxml2
|
||||
TITLE:=dbus proxy for ubus
|
||||
endef
|
||||
|
||||
define Package/dubus/description
|
||||
dubus is dbus proxy for ubus. It allows calling dbus
|
||||
methods through ubus
|
||||
endef
|
||||
|
||||
define Package/dubus/install
|
||||
$(CP) $(PKG_INSTALL_DIR)/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,dubus))
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=3.0-2017-06-01
|
||||
PKG_VERSION:=3.0-2017-05-01
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=http://public.inteno.se:/icwmp.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=cff928dae59aa115a6f74f68ee4f08dfda2beeb7
|
||||
PKG_SOURCE_VERSION:=5a1b5c439524c56dca7a1921d4cf2fcd2d4c1ff0
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
@@ -39,7 +39,7 @@ test_ip() {
|
||||
uci set netmode.setup.repeaterready=0
|
||||
uci commit netmode
|
||||
local pid="$(ps | grep wificontro[l] | awk '/repeater/ {print $1}')"
|
||||
[ "$pid" != "" ] && kill -9 $pid
|
||||
[ "$pid" != "" ] && kill $pid
|
||||
pid="$(pidof netmode-client-detect)"
|
||||
[ "$pid" == "" ] && /sbin/netmode-client-detect &
|
||||
}
|
||||
|
||||
@@ -85,7 +85,6 @@ case "$ACTION" in
|
||||
uci commit network
|
||||
ubus call network reload
|
||||
ping -c 1 -w 10 $defroute >/dev/null 2>&1 || {
|
||||
killall -9 wifi
|
||||
wifi reload nodat
|
||||
killall -USR1 udhcpc
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ config wifi-iface
|
||||
|
||||
config wifi-device rai0
|
||||
option band a
|
||||
option channel auto
|
||||
option channel 36
|
||||
option bandwidth '80'
|
||||
option hwmode 11ac
|
||||
option htmode VHT80
|
||||
|
||||
@@ -6,7 +6,7 @@ config wifi-status 'status'
|
||||
|
||||
config wifi-device ra0
|
||||
option band b
|
||||
option channel auto
|
||||
option channel 1
|
||||
option bandwidth '20'
|
||||
option hwmode 11n
|
||||
option htmode HT20
|
||||
|
||||
@@ -3,22 +3,17 @@
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
state="exit"
|
||||
TMPPATH="/tmp/netmode_config_backup"
|
||||
CURMODE=""
|
||||
SLEEPTIME=300
|
||||
local state="exit"
|
||||
|
||||
set_wireless_values() {
|
||||
local iface_num="$1"
|
||||
local ssid="$2"
|
||||
local key="$3"
|
||||
local encryption="$4"
|
||||
local device="$5"
|
||||
local old_ssid old_key old_encryption
|
||||
if ! uci -q get wireless.@wifi-iface[$iface_num] >/dev/null 2>&1; then
|
||||
state="reload"
|
||||
uci add wireless wifi-iface >/dev/null 2>&1
|
||||
uci set wireless.@wifi-iface[$iface_num].device="$device"
|
||||
fi
|
||||
local network="$(uci -q get wireless.@wifi-iface[$iface_num].network)"
|
||||
old_ssid="$(uci -q get wireless.@wifi-iface[$iface_num].ssid)"
|
||||
@@ -59,13 +54,10 @@ get_iface_num() {
|
||||
local dev
|
||||
while true; do
|
||||
[ $i -gt 100 ] && break ## just a safty messure
|
||||
if ! uci -q get wireless.@wifi-iface[$i] >/dev/null; then
|
||||
break
|
||||
fi
|
||||
mode="$(uci -q get wireless.@wifi-iface[$i].mode)"
|
||||
if [ "$mode" != "ap" ]; then
|
||||
i=$((i+1))
|
||||
continue
|
||||
break
|
||||
fi
|
||||
dev="$(uci -q get wireless.@wifi-iface[$i].device)"
|
||||
if [ "$dev" != "$device" ]; then
|
||||
@@ -81,38 +73,11 @@ get_iface_num() {
|
||||
eval "export -- \"$__save=$i\""
|
||||
}
|
||||
|
||||
restore() {
|
||||
if [ "$1" == "back" ]; then
|
||||
uci set juci.juci.homepage='netmode-wizard'
|
||||
uci commit juci
|
||||
cp $TMPPATH/* /etc/config/
|
||||
uci set netmode.setup.curmode=$CURMODE
|
||||
uci commit netmode
|
||||
ubus call network reload
|
||||
wifi reload
|
||||
ubus call router.network reload
|
||||
fi
|
||||
rm -r $TMPPATH
|
||||
ubus call leds set '{"state":"normal"}'
|
||||
}
|
||||
|
||||
backup() {
|
||||
mkdir -p $TMPPATH
|
||||
cp /etc/config/* $TMPPATH/
|
||||
CURMODE="$(uci -q get netmode.setup.curmode)"
|
||||
ubus call leds set '{"state":"allflash"}'
|
||||
}
|
||||
|
||||
###### START HERE #######
|
||||
|
||||
file="$1"
|
||||
from_gui="$2"
|
||||
|
||||
|
||||
local file="$1"
|
||||
[ -f "$file" ] || exit
|
||||
|
||||
[ "$from_gui" == "true" ] && backup
|
||||
|
||||
json_load "`cat $file`"
|
||||
json_select "wifi_ifaces"
|
||||
|
||||
@@ -148,18 +113,10 @@ while json_get_var dummy $i; do
|
||||
i=$((i+1))
|
||||
done
|
||||
|
||||
[ "$apcliband" == "$band" ] || {
|
||||
[ "$from_gui" == "true" ] && restore "back"
|
||||
exit
|
||||
}
|
||||
[ "$apcliband" == "$band" ] || exit
|
||||
|
||||
repeater_iface_num=$(uci -q show wireless | grep -e ".mode='wet'" -e ".mode='sta'" | sed 's/.*\[\([0-9]\)\].*/\1/')
|
||||
|
||||
[ -z "$repeater_iface_num" ] && {
|
||||
[ "$from_gui" == "true" ] && restore "back"
|
||||
exit
|
||||
}
|
||||
|
||||
[ -z "$repeater_iface_num" ] && exit
|
||||
json_get_var ssid ssid
|
||||
json_get_var key key
|
||||
json_get_var encryption encryption
|
||||
@@ -188,14 +145,11 @@ while json_get_var dummy $i; do
|
||||
b_num=$((b_num+1))
|
||||
;;
|
||||
esac
|
||||
[ -z $iface_num ] && {
|
||||
[ "$from_gui" == "true" ] && restore "back"
|
||||
exit
|
||||
}
|
||||
[ -z $iface_num ] && return
|
||||
json_get_var ssid ssid
|
||||
json_get_var encryption encryption
|
||||
json_get_var key key
|
||||
set_wireless_values "$iface_num" "$ssid" "$key" "$encryption" "$device"
|
||||
set_wireless_values "$iface_num" "$ssid" "$key" "$encryption"
|
||||
json_select ..
|
||||
i=$((i+1))
|
||||
done
|
||||
@@ -213,38 +167,14 @@ done
|
||||
|
||||
uci commit wireless
|
||||
|
||||
if [ "$from_gui" == "true" ]; then
|
||||
# check for connectivity
|
||||
if [ "$state" == "exit" ]; then
|
||||
return
|
||||
elif [ "$state" == "apply" ]; then
|
||||
# wifi apply
|
||||
wifi reload
|
||||
[ -f /etc/init.d/layer2_interface_ethernet -a -f /etc/config/layer2_interface_ethernet ] && /etc/init.d/layer2_interface_ethernet reload
|
||||
i=$SLEEPTIME;
|
||||
|
||||
while [ $i -gt 0 ]; do
|
||||
ip=`route -n | awk '/^0.0.0.0/{print $2}'`
|
||||
if [ "$ip" == "" ]; then
|
||||
i=$((i-10))
|
||||
sleep 10
|
||||
continue
|
||||
fi
|
||||
ping -w1 $ip
|
||||
if [ $? -eq 0 ]; then
|
||||
restore
|
||||
exit
|
||||
else
|
||||
i=$((i-10))
|
||||
sleep 9
|
||||
fi
|
||||
done
|
||||
restore "back"
|
||||
else
|
||||
if [ "$state" == "exit" ]; then
|
||||
return
|
||||
elif [ "$state" == "apply" ]; then
|
||||
# wifi apply
|
||||
wifi reload
|
||||
else
|
||||
# wifi reload
|
||||
wifi reload
|
||||
fi
|
||||
[ -f /etc/init.d/layer2_interface_ethernet -a -f /etc/config/layer2_interface_ethernet ] && /etc/init.d/layer2_interface_ethernet reload
|
||||
# wifi reload
|
||||
wifi reload
|
||||
fi
|
||||
|
||||
[ -f /etc/init.d/layer2_interface_ethernet -a -f /etc/config/layer2_interface_ethernet ] && /etc/init.d/layer2_interface_ethernet reload
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
MTK=0
|
||||
[ "$(db -q get hw.board.hardware)" == "EX400" ] && MTK=1
|
||||
|
||||
if [ $MTK -eq 1 ]; then
|
||||
WANDEV="eth0.2"
|
||||
link=$(swconfig dev switch0 port 0 get link | awk '{print$2}' | cut -d':' -f2)
|
||||
else
|
||||
WANDEV="$(uci get layer2_interface_ethernet.Wan.ifname)"
|
||||
link=$(cat /sys/class/net/${WANDEV:0:4}/operstate)
|
||||
fi
|
||||
|
||||
[ "$link" == "up" ] && action=add
|
||||
[ "$link" == "down" ] && action=remove
|
||||
[ -z "$action" ] && exit
|
||||
|
||||
# trigger a fake hotplug net event
|
||||
INTERFACE=$WANDEV ACTION=$action /sbin/hotplug-call net
|
||||
@@ -87,7 +87,7 @@ duplicate_if_single_radio() {
|
||||
|
||||
case "$1" in
|
||||
list)
|
||||
echo '{ "get_creds": { "network": "str", "file": "str" }, "set_creds": { "file": "str", "from_gui": "str" } }'
|
||||
echo '{ "get_creds": { "network": "str", "file": "str" }, "set_creds": { "file": "str" } }'
|
||||
;;
|
||||
call)
|
||||
case "$2" in
|
||||
@@ -121,11 +121,10 @@ case "$1" in
|
||||
json_dump
|
||||
;;
|
||||
set_creds)
|
||||
local file from_gui
|
||||
local file
|
||||
read input
|
||||
json_load "$input"
|
||||
json_get_var file file
|
||||
json_get_var from_gui from_gui
|
||||
validate_file "$file" || write_error "invalid filename (\"$file\"), file must be in /tmp and exist"
|
||||
json_load "`cat $file`" || write_error "invalid file content"
|
||||
json_select "wifi_ifaces" || write_error "invalid file content"
|
||||
@@ -135,7 +134,7 @@ case "$1" in
|
||||
json_add_string "status" success
|
||||
json_dump
|
||||
|
||||
netmode-conf "$file" "$from_gui" >/dev/null 2>&1 &
|
||||
netmode-conf $file >/dev/null 2>&1 &
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
@@ -106,7 +106,7 @@ function genconfig {
|
||||
local ALL="$1"
|
||||
local CUSTOMER="$2"
|
||||
if [ "$CUSTOMER" -a -d "$CUSTCONF/$CUSTOMER" ]; then
|
||||
local boards="$(ls -1 "$CUSTCONF/$CUSTOMER" | grep -v common | grep -v juci-theme)"
|
||||
local boards="$(ls -1 "$CUSTCONF/$CUSTOMER" | grep -v common)"
|
||||
if [ "$boards" ]; then
|
||||
echo "$CUSTOMER has following boards:"
|
||||
for board in $boards; do
|
||||
@@ -120,10 +120,10 @@ function genconfig {
|
||||
exit 1
|
||||
elif [ -d $CUSTCONF ]; then
|
||||
local customers="$(ls -1 $CUSTCONF)"
|
||||
if [ "$customers" -a "$ALL" == 1 ]; then
|
||||
if [ "$customers" -a "$1" == 1 ]; then
|
||||
for customer in $customers; do
|
||||
echo $customer
|
||||
local boards="$(ls -1 $CUSTCONF/$customer | grep -v common | grep -v juci-theme)"
|
||||
local boards="$(ls -1 $CUSTCONF/$customer | grep -v common)"
|
||||
if [ "$boards" ]; then
|
||||
for board in $boards; do
|
||||
echo -e "\t$board"
|
||||
|
||||
@@ -394,7 +394,7 @@ insert_hash_in_feeds_config()
|
||||
check_packages()
|
||||
{
|
||||
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
|
||||
echo "Now checking if any changes have been done to the packages."
|
||||
echo "Now checking if any changes has been done to the packages."
|
||||
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
|
||||
|
||||
# only scan in the build directory that is currently in use.
|
||||
|
||||
@@ -21,7 +21,7 @@ define Package/iup
|
||||
endef
|
||||
|
||||
define Package/iup/description
|
||||
This package contains Inteno's IUP Client
|
||||
This package contains Intenos IUP Client
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
|
||||
@@ -4,7 +4,6 @@ echo $$ > /var/run/iup.pid
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/network.sh
|
||||
. /lib/functions/savecfg.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
include /lib/upgrade
|
||||
@@ -14,6 +13,8 @@ export IUPCONFFILES=/tmp/iup/sysupgrade.conffiles.tar.gz
|
||||
export IUPMD5=/etc/configchecksums
|
||||
export CONFILESLURP='/tmp/iup/*.conf'
|
||||
export IUPTEMP="/tmp/iup"
|
||||
export IUPUSERCFG="/tmp/iupusercfg"
|
||||
export IUPUSERCFG_WIFI="/tmp/iupusercfg_wifi"
|
||||
export INTERACTIVE=0
|
||||
export VERBOSE=0
|
||||
export CONF=1
|
||||
@@ -68,7 +69,41 @@ reload ()
|
||||
|
||||
save_usercfg()
|
||||
{
|
||||
savecfg_save_config fw_redirect fw_parental wifi
|
||||
rm -f $IUPUSERCFG $IUPUSERCFG_WIFI
|
||||
touch $IUPUSERCFG $IUPUSERCFG_WIFI
|
||||
|
||||
# save the firewall redirects/port forwarding
|
||||
uci show firewall | grep redirect >> $IUPUSERCFG
|
||||
|
||||
# save the parental rules
|
||||
local parentalrules=$(uci show firewall | grep -i "Parental Rule" | grep -o "rule\[.*\]")
|
||||
for rule in $parentalrules ; do
|
||||
rule=${rule//\[/\\[} # escape [
|
||||
rule=${rule//]/\]} # escape ]
|
||||
uci show firewall | grep "$rule" >>$IUPUSERCFG
|
||||
done
|
||||
|
||||
# tranfsorm the output of uci show into a uci script
|
||||
|
||||
# prepend "set" to each line NOT containing "]="
|
||||
# firewall.@redirect[0].enabled='1' becomes
|
||||
# set firewall.@redirect[0].enabled='1'
|
||||
sed -i '/.*]=.*/! s/.*/set \0/' $IUPUSERCFG
|
||||
|
||||
# prepend "add" to each line containing "]="
|
||||
# AND keep only the package name (before the first dot) and section type (after equal)
|
||||
# firewall.@redirect[0]=redirect becomes
|
||||
# add firewall redirect
|
||||
sed -i 's/\(.*\)\..*]=\(.*\)/add \1 \2/' $IUPUSERCFG
|
||||
|
||||
# change all the array indexes to [-1]
|
||||
sed -i 's/\[.\?.\?.\?.\?\]/[-1]/' $IUPUSERCFG
|
||||
|
||||
# commit at the end of the script
|
||||
[ -s $IUPUSERCFG ] && echo "commit" >> $IUPUSERCFG
|
||||
|
||||
# save wireless interfaces
|
||||
uci show wireless | grep "wifi-iface" > $IUPUSERCFG_WIFI
|
||||
}
|
||||
|
||||
apply_usercfg()
|
||||
@@ -79,11 +114,64 @@ apply_usercfg()
|
||||
config_get_bool keep configserver keepuserconfig "0"
|
||||
v "apply_usercfg(): keepuserconfig = $keep"
|
||||
if [ "$keep" != "1" ] ; then
|
||||
savecfg_rm_files
|
||||
rm -f $IUPUSERCFG $IUPUSERCFG_WIFI
|
||||
return
|
||||
fi
|
||||
|
||||
savecfg_apply_config fw_redirect fw_parental wifi
|
||||
local index ifname network
|
||||
local newindex newifname newnetwork
|
||||
|
||||
# loop through all the user wifi-ifaces
|
||||
for index in $(seq 0 99) ; do
|
||||
ifname=$(sed -n 's/.*wifi-iface\['$index'\]\.ifname='\''\(.*\)'\''/\1/p' $IUPUSERCFG_WIFI )
|
||||
[ "$ifname" ] || break
|
||||
network=$(sed -n 's/.*wifi-iface\['$index'\]\.network='\''\(.*\)'\''/\1/p' $IUPUSERCFG_WIFI )
|
||||
|
||||
newindex=""
|
||||
newifname=""
|
||||
newnetwork=""
|
||||
|
||||
# loop through all the newly configured wifi-ifaces
|
||||
for newindex in $(seq 0 99) ; do
|
||||
newifname=$( uci show wireless | grep wifi-iface | sed -n 's/.*wifi-iface\['$newindex'\]\.ifname='\''\(.*\)'\''/\1/p' )
|
||||
if [ -z "$newifname" ] ; then
|
||||
# no newifname means that all the wifi-ifaces have already been parsed
|
||||
newindex="-1"
|
||||
break
|
||||
fi
|
||||
newnetwork=$(uci show wireless | grep wifi-iface | sed -n 's/.*wifi-iface\['$newindex'\]\.network='\''\(.*\)'\''/\1/p' )
|
||||
|
||||
# two wifi interfaces are the same if "ifname" and "network" are the same
|
||||
if [ "$newifname" == "$ifname" ] && [ "$newnetwork" == "$network" ] ; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# prepend "set" to each line NOT containing "]="
|
||||
# wireless.@wifi-iface[$index].<option>='<value>' becomes
|
||||
# set wireless.@wifi-iface[$index].<option>='<value>'
|
||||
sed -i '/.*]=.*/! s/\(.*\[\)'$index'\(\].*\)/set \1'$newindex'\2/' $IUPUSERCFG_WIFI
|
||||
|
||||
if [ "$newindex" == "-1" ] ; then
|
||||
# prepend "add" to each line containing "]="
|
||||
# AND keep only the package name (before the first dot) and section type (after equal)
|
||||
# wireless.@wifi-iface[0]=wifi-iface becomes
|
||||
# add wireless wifi-iface
|
||||
sed -i 's/\(.*\)\..*\['$index'\]=\(.*\)/add \1 \2/' $IUPUSERCFG_WIFI
|
||||
else
|
||||
# no need to create a new uci section, just delete the line defining a new section
|
||||
sed -i '/\(.*\)\..*\['$index'\]=\(.*\)/d' $IUPUSERCFG_WIFI
|
||||
fi
|
||||
|
||||
done
|
||||
# commit at the end of the script
|
||||
[ -s $IUPUSERCFG_WIFI ] && echo "commit" >> $IUPUSERCFG_WIFI
|
||||
|
||||
# run the uci batch scripts
|
||||
cat $IUPUSERCFG | uci batch >/dev/null 2>&1
|
||||
cat $IUPUSERCFG_WIFI | uci batch >/dev/null 2>&1
|
||||
|
||||
rm -f $IUPUSERCFG $IUPUSERCFG_WIFI
|
||||
}
|
||||
|
||||
handle_provisioning() {
|
||||
@@ -388,6 +476,8 @@ parse_dhcp_options()
|
||||
json_get_var vlanid vlanid # option 132
|
||||
json_get_var vlanpriority vlanpriority # option 133
|
||||
|
||||
v "Processing dhcp options"
|
||||
|
||||
if [ $privopt224 ]; then
|
||||
v "dhcp option 224 firmware url $privopt224"
|
||||
handle_option224 $privopt224
|
||||
|
||||
@@ -50,11 +50,10 @@ addethernet() {
|
||||
config_get baseifname $1 baseifname
|
||||
config_get ifname $1 ifname
|
||||
config_get bridge $1 bridge
|
||||
config_get mac2 $1 mac2
|
||||
|
||||
ifname="${ifname:-$baseifname.1}"
|
||||
|
||||
brcm_virtual_interface_rules "$baseifname" "$ifname" "$bridge" "$mac2"
|
||||
brcm_virtual_interface_rules "$baseifname" "$ifname" "$bridge"
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -161,38 +161,12 @@ addbrcmvlan()
|
||||
fi
|
||||
}
|
||||
|
||||
update_last_mac_group()
|
||||
{
|
||||
local ifname=$1
|
||||
local last_mac_group=$2
|
||||
|
||||
local full_mac modified_mac dev_mac
|
||||
|
||||
full_mac="$(ifconfig $ifname | awk '{print $NF; exit}')"
|
||||
|
||||
[ "${full_mac}" == "" ] && return
|
||||
|
||||
modified_mac="${full_mac:0:15}${last_mac_group}"
|
||||
|
||||
devs="wl0 wl1 bcmsw"
|
||||
|
||||
for dev in $devs; do
|
||||
dev_mac="$(ifconfig $dev | awk '{print $NF; exit}')"
|
||||
if [ "$dev_mac" == "$modified_mac" ]; then
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
ifconfig $ifname hw ether "${modified_mac}"
|
||||
}
|
||||
|
||||
|
||||
brcm_virtual_interface_rules()
|
||||
{
|
||||
local baseifname=$1
|
||||
local ifname=$2
|
||||
local bridge=$3
|
||||
local last_mac_group=$4
|
||||
|
||||
bridge="${bridge:-0}"
|
||||
|
||||
@@ -256,10 +230,6 @@ brcm_virtual_interface_rules()
|
||||
vlanctl --if $baseifname --rx --tags 0 --set-rxif $ifname --filter-vlan-dev-mac-addr 1 --rule-insert-before -1
|
||||
fi
|
||||
|
||||
if [ "$last_mac_group" != "" ]; then
|
||||
update_last_mac_group $ifname $last_mac_group
|
||||
fi
|
||||
|
||||
ifconfig $ifname up
|
||||
ifconfig $ifname multicast
|
||||
}
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2014 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dbus-python
|
||||
PKG_VERSION:=1.2.4
|
||||
PKG_RELEASE:=1
|
||||
PKG_LICENSE:=MIT
|
||||
|
||||
PKG_SOURCE:=dbus-python-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://pypi.python.org/packages/source/d/dbus-python/
|
||||
PKG_MD5SUM:=7372a588c83a7232b4e08159bfd48fe5
|
||||
|
||||
PKG_BUILD_DEPENDS:=python
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
$(call include_mk, python-package.mk)
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
TARGET_LDFLAGS += -Wl,-rpath-link=$(ICONV_PREFIX)/lib
|
||||
TARGET_LDFLAGS += -Wl,-rpath-link=$(INTL_PREFIX)/lib
|
||||
|
||||
define Package/python-dbus
|
||||
SECTION:=language-python
|
||||
CATEGORY:=Languages
|
||||
SUBMENU:=Python
|
||||
TITLE:=python-dbus
|
||||
MAINTAINER:=Denis Osvald <denis.osvald@sartura.hr>
|
||||
DEPENDS:=+python +libdbus +libdbus-glib +glib2
|
||||
endef
|
||||
|
||||
define Package/python-dbus/description
|
||||
Python bindings for libdbus
|
||||
endef
|
||||
|
||||
$(eval $(call PyPackage,python-dbus))
|
||||
$(eval $(call BuildPackage,python-dbus))
|
||||
@@ -1,430 +0,0 @@
|
||||
diff --git a/dbus/decorators.py b/dbus/decorators.py
|
||||
index 71c8be0..a792861 100644
|
||||
--- a/dbus/decorators.py
|
||||
+++ b/dbus/decorators.py
|
||||
@@ -352,3 +352,105 @@ def signal(dbus_interface, signature=None, path_keyword=None,
|
||||
return emit_signal
|
||||
|
||||
return decorator
|
||||
+
|
||||
+
|
||||
+class property(object):
|
||||
+ """A decorator used to mark properties of a `dbus.service.Object`.
|
||||
+
|
||||
+ :Since: 1.3.0
|
||||
+ """
|
||||
+
|
||||
+ def __init__(self, dbus_interface, signature,
|
||||
+ property_name=None, emits_changed_signal=None,
|
||||
+ fget=None, fset=None, doc=None):
|
||||
+ """Initialize the decorator used to mark properties of a
|
||||
+ `dbus.service.Object`.
|
||||
+
|
||||
+ :Parameters:
|
||||
+ `dbus_interface` : str
|
||||
+ The D-Bus interface owning the property.
|
||||
+
|
||||
+ `signature` : str
|
||||
+ The signature of the property in the usual D-Bus
|
||||
+ notation. It must be a single complete type,
|
||||
+ i.e. something that can be be suitable to be placed
|
||||
+ in a variant.
|
||||
+
|
||||
+ `property_name` : str
|
||||
+ A name for the property. Defaults to the name of the getter or
|
||||
+ setter function.
|
||||
+
|
||||
+ `emits_changed_signal` : True, False, "invalidates", or None
|
||||
+ Tells for introspection if the object emits PropertiesChanged
|
||||
+ signal.
|
||||
+
|
||||
+ `fget` : func or None
|
||||
+ Getter function taking the instance from which to read the
|
||||
+ property.
|
||||
+
|
||||
+ `fset` : func or None
|
||||
+ Setter function taking the instance to which set the property
|
||||
+ and the property value.
|
||||
+
|
||||
+ `doc` : str
|
||||
+ Documentation string for the property. Defaults to documentation
|
||||
+ string of getter function.
|
||||
+ """
|
||||
+ validate_interface_name(dbus_interface)
|
||||
+ self._dbus_interface = dbus_interface
|
||||
+
|
||||
+ # Keep the given name for later assignment of setter
|
||||
+ self._init_property_name = property_name
|
||||
+ if property_name is None:
|
||||
+ if fget is not None:
|
||||
+ property_name = fget.__name__
|
||||
+ elif fset is not None:
|
||||
+ property_name = fset.__name__
|
||||
+ if property_name is not None and not isinstance(property_name, str):
|
||||
+ if not is_py2 or not isinstance(property_name, unicode):
|
||||
+ raise TypeError("Invalid property name: '%s'" % property_name)
|
||||
+ self.__name__ = property_name
|
||||
+
|
||||
+ self._init_doc = doc
|
||||
+ if doc is None and fget is not None:
|
||||
+ doc = getattr(fget, "__doc__", None)
|
||||
+ self.fget = fget
|
||||
+ self.fset = fset
|
||||
+ self.__doc__ = doc
|
||||
+
|
||||
+ if emits_changed_signal not in (None, True, False, 'invalidates'):
|
||||
+ raise ValueError("emits_changed_signal invalid value: '%s'" %
|
||||
+ emits_changed_signal)
|
||||
+ self._emits_changed_signal = emits_changed_signal
|
||||
+ if len(tuple(Signature(signature))) != 1:
|
||||
+ raise ValueError('signature must have only one item')
|
||||
+ self._dbus_signature = signature
|
||||
+
|
||||
+ def __get__(self, inst, type=None):
|
||||
+ if inst is None:
|
||||
+ return self
|
||||
+ if self.fget is None:
|
||||
+ raise AttributeError("unreadable attribute")
|
||||
+ return self.fget(inst)
|
||||
+
|
||||
+ def __set__(self, inst, value):
|
||||
+ if self.fset is None:
|
||||
+ raise AttributeError("can't set attribute")
|
||||
+ self.fset(inst, value)
|
||||
+
|
||||
+ def __call__(self, fget):
|
||||
+ return self.getter(fget)
|
||||
+
|
||||
+ def _copy(self, fget=None, fset=None):
|
||||
+ return property(dbus_interface=self._dbus_interface,
|
||||
+ signature=self._dbus_signature,
|
||||
+ property_name=self._init_property_name,
|
||||
+ emits_changed_signal=self._emits_changed_signal,
|
||||
+ fget=fget or self.fget, fset=fset or self.fset,
|
||||
+ doc=self._init_doc)
|
||||
+
|
||||
+ def getter(self, fget):
|
||||
+ return self._copy(fget=fget)
|
||||
+
|
||||
+ def setter(self, fset):
|
||||
+ return self._copy(fset=fset)
|
||||
diff --git a/dbus/exceptions.py b/dbus/exceptions.py
|
||||
index 0930425..23d5bb2 100644
|
||||
--- a/dbus/exceptions.py
|
||||
+++ b/dbus/exceptions.py
|
||||
@@ -118,6 +118,14 @@ class IntrospectionParserException(DBusException):
|
||||
def __init__(self, msg=''):
|
||||
DBusException.__init__(self, "Error parsing introspect data: %s"%msg)
|
||||
|
||||
+class UnknownInterfaceException(DBusException):
|
||||
+
|
||||
+ include_traceback = True
|
||||
+ _dbus_error_name = 'org.freedesktop.DBus.Error.UnknownInterface'
|
||||
+
|
||||
+ def __init__(self, interface):
|
||||
+ DBusException.__init__(self, "Unknown interface: %s" % interface)
|
||||
+
|
||||
class UnknownMethodException(DBusException):
|
||||
|
||||
include_traceback = True
|
||||
@@ -126,6 +134,22 @@ class UnknownMethodException(DBusException):
|
||||
def __init__(self, method):
|
||||
DBusException.__init__(self, "Unknown method: %s"%method)
|
||||
|
||||
+class UnknownPropertyException(DBusException):
|
||||
+
|
||||
+ include_traceback = True
|
||||
+ _dbus_error_name = 'org.freedesktop.DBus.Error.UnknownProperty'
|
||||
+
|
||||
+ def __init__(self, property):
|
||||
+ DBusException.__init__(self, "Unknown property: %s" % property)
|
||||
+
|
||||
+class PropertyReadOnlyException(DBusException):
|
||||
+
|
||||
+ include_traceback = True
|
||||
+ _dbus_error_name = 'org.freedesktop.DBus.Error.PropertyReadOnly'
|
||||
+
|
||||
+ def __init__(self, property):
|
||||
+ DBusException.__init__(self, "Property is read only: %s" % property)
|
||||
+
|
||||
class NameExistsException(DBusException):
|
||||
|
||||
include_traceback = True
|
||||
diff --git a/dbus/service.py b/dbus/service.py
|
||||
index 2953229..d6d54bc 100644
|
||||
--- a/dbus/service.py
|
||||
+++ b/dbus/service.py
|
||||
@@ -23,7 +23,7 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
# DEALINGS IN THE SOFTWARE.
|
||||
|
||||
-__all__ = ('BusName', 'Object', 'FallbackObject', 'method', 'signal')
|
||||
+__all__ = ('BusName', 'Object', 'FallbackObject', 'PropertiesInterface', 'method', 'property', 'signal')
|
||||
__docformat__ = 'restructuredtext'
|
||||
|
||||
import sys
|
||||
@@ -34,11 +34,14 @@ from collections import Sequence
|
||||
|
||||
import _dbus_bindings
|
||||
from dbus import (
|
||||
- INTROSPECTABLE_IFACE, ObjectPath, SessionBus, Signature, Struct,
|
||||
- validate_bus_name, validate_object_path)
|
||||
-from dbus.decorators import method, signal
|
||||
+ INTROSPECTABLE_IFACE, ObjectPath, PROPERTIES_IFACE, SessionBus, Signature,
|
||||
+ Struct, validate_bus_name, validate_object_path)
|
||||
+_builtin_property = property
|
||||
+from dbus.decorators import method, signal, property
|
||||
from dbus.exceptions import (
|
||||
- DBusException, NameExistsException, UnknownMethodException)
|
||||
+ DBusException, NameExistsException, UnknownInterfaceException,
|
||||
+ UnknownMethodException, UnknownPropertyException,
|
||||
+ PropertyReadOnlyException)
|
||||
from dbus.lowlevel import ErrorMessage, MethodReturnMessage, MethodCallMessage
|
||||
from dbus.proxies import LOCAL_PATH
|
||||
from dbus._compat import is_py2
|
||||
@@ -297,20 +300,25 @@ def _method_reply_error(connection, message, exception):
|
||||
|
||||
|
||||
class InterfaceType(type):
|
||||
- def __init__(cls, name, bases, dct):
|
||||
- # these attributes are shared between all instances of the Interface
|
||||
- # object, so this has to be a dictionary that maps class names to
|
||||
- # the per-class introspection/interface data
|
||||
- class_table = getattr(cls, '_dbus_class_table', {})
|
||||
- cls._dbus_class_table = class_table
|
||||
- interface_table = class_table[cls.__module__ + '.' + name] = {}
|
||||
+ def __new__(cls, name, bases, dct):
|
||||
+ # Properties require the PropertiesInterface base.
|
||||
+ for func in dct.values():
|
||||
+ if isinstance(func, property):
|
||||
+ for b in bases:
|
||||
+ if issubclass(b, PropertiesInterface):
|
||||
+ break
|
||||
+ else:
|
||||
+ bases += (PropertiesInterface,)
|
||||
+ break
|
||||
+
|
||||
+ interface_table = dct.setdefault('_dbus_interface_table', {})
|
||||
|
||||
# merge all the name -> method tables for all the interfaces
|
||||
# implemented by our base classes into our own
|
||||
for b in bases:
|
||||
- base_name = b.__module__ + '.' + b.__name__
|
||||
- if getattr(b, '_dbus_class_table', False):
|
||||
- for (interface, method_table) in class_table[base_name].items():
|
||||
+ base_interface_table = getattr(b, '_dbus_interface_table', False)
|
||||
+ if base_interface_table:
|
||||
+ for (interface, method_table) in base_interface_table.items():
|
||||
our_method_table = interface_table.setdefault(interface, {})
|
||||
our_method_table.update(method_table)
|
||||
|
||||
@@ -320,9 +328,9 @@ class InterfaceType(type):
|
||||
method_table = interface_table.setdefault(func._dbus_interface, {})
|
||||
method_table[func.__name__] = func
|
||||
|
||||
- super(InterfaceType, cls).__init__(name, bases, dct)
|
||||
+ return type.__new__(cls, name, bases, dct)
|
||||
|
||||
- # methods are different to signals, so we have two functions... :)
|
||||
+ # methods are different to signals and properties, so we have three functions... :)
|
||||
def _reflect_on_method(cls, func):
|
||||
args = func._dbus_args
|
||||
|
||||
@@ -370,11 +378,107 @@ class InterfaceType(type):
|
||||
|
||||
return reflection_data
|
||||
|
||||
+ def _reflect_on_property(cls, descriptor):
|
||||
+ signature = descriptor._dbus_signature
|
||||
+
|
||||
+ if descriptor.fget:
|
||||
+ if descriptor.fset:
|
||||
+ access = "readwrite"
|
||||
+ else:
|
||||
+ access = "read"
|
||||
+ elif descriptor.fset:
|
||||
+ access = "write"
|
||||
+ else:
|
||||
+ return ""
|
||||
+ reflection_data = ' <property access="%s" type="%s" name="%s"' % (access, signature, descriptor.__name__)
|
||||
+ if descriptor._emits_changed_signal is not None:
|
||||
+ value = {True: "true", False: "false", "invalidates": "invalidates"}[descriptor._emits_changed_signal]
|
||||
+ reflection_data += '>\n <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="%s"/>\n </property>\n' % (value,)
|
||||
+ else:
|
||||
+ reflection_data += ' />\n'
|
||||
+ return reflection_data
|
||||
+
|
||||
|
||||
# Define Interface as an instance of the metaclass InterfaceType, in a way
|
||||
# that is compatible across both Python 2 and Python 3.
|
||||
Interface = InterfaceType('Interface', (object,), {})
|
||||
|
||||
+class PropertiesInterface(Interface):
|
||||
+ """An object with properties must inherit from this interface.
|
||||
+
|
||||
+ This interface is added automatically to the class when the
|
||||
+ @\ `dbus.decorators.property` decorator is used.
|
||||
+
|
||||
+ :Since: 1.3.0
|
||||
+ """
|
||||
+
|
||||
+ def _get_decorator(self, interface_name, property_name):
|
||||
+ interfaces = self._dbus_interface_table
|
||||
+ if interface_name:
|
||||
+ interface = interfaces.get(interface_name)
|
||||
+ if interface is None:
|
||||
+ raise UnknownInterfaceException(interface_name)
|
||||
+ prop = interface.get(property_name)
|
||||
+ if prop is None or not isinstance(prop, property):
|
||||
+ raise UnknownPropertyException(property_name)
|
||||
+ return prop
|
||||
+ else:
|
||||
+ for interface in interfaces.itervalues():
|
||||
+ prop = interface.get(property_name)
|
||||
+ if prop and isinstance(prop, property):
|
||||
+ return prop
|
||||
+ raise UnknownPropertyException(property_name)
|
||||
+
|
||||
+ @method(PROPERTIES_IFACE, in_signature="ss", out_signature="v")
|
||||
+ def Get(self, interface_name, property_name):
|
||||
+ """Get the value of the property on named interface. interface_name
|
||||
+ may be empty, but if there are many properties with the same name the
|
||||
+ behaviour is undefined.
|
||||
+ """
|
||||
+ prop = self._get_decorator(interface_name, property_name)
|
||||
+ if not prop.fget:
|
||||
+ raise DBusException("Property '%s' is not readable" % property_name,
|
||||
+ name="org.freedesktop.DBus.Error.InvalidArgs")
|
||||
+ return prop.fget(self)
|
||||
+
|
||||
+ @method(PROPERTIES_IFACE, in_signature="ssv")
|
||||
+ def Set(self, interface_name, property_name, value):
|
||||
+ """Set value of property on named interface to value. interface_name
|
||||
+ may be empty, but if there are many properties with the same name the
|
||||
+ behaviour is undefined.
|
||||
+ """
|
||||
+ prop = self._get_decorator(interface_name, property_name)
|
||||
+ if not prop.fset:
|
||||
+ raise PropertyReadOnlyException(property_name)
|
||||
+ return prop.fset(self, value)
|
||||
+
|
||||
+ @method(PROPERTIES_IFACE, in_signature="s", out_signature="a{sv}")
|
||||
+ def GetAll(self, interface_name):
|
||||
+ """Return a dictionary of all property names and values. Returns only
|
||||
+ readable properties.
|
||||
+ """
|
||||
+ interfaces = self._dbus_interface_table
|
||||
+ if interface_name:
|
||||
+ iface = interfaces.get(interface_name)
|
||||
+ if iface is None:
|
||||
+ raise UnknownInterfaceException(interface_name)
|
||||
+ ifaces = [iface]
|
||||
+ else:
|
||||
+ ifaces = interfaces.values()
|
||||
+ properties = {}
|
||||
+ for iface in ifaces:
|
||||
+ for name, prop in iface.items():
|
||||
+ if not isinstance(prop, property):
|
||||
+ continue
|
||||
+ if not prop.fget or name in properties:
|
||||
+ continue
|
||||
+ properties[name] = prop.fget(self)
|
||||
+ return properties
|
||||
+
|
||||
+ @signal(PROPERTIES_IFACE, signature='sa{sv}as')
|
||||
+ def PropertiesChanged(self, interface_name, changed_properties,
|
||||
+ invalidated_properties):
|
||||
+ pass
|
||||
|
||||
#: A unique object used as the value of Object._object_path and
|
||||
#: Object._connection if it's actually in more than one place
|
||||
@@ -384,11 +488,12 @@ class Object(Interface):
|
||||
r"""A base class for exporting your own Objects across the Bus.
|
||||
|
||||
Just inherit from Object and mark exported methods with the
|
||||
- @\ `dbus.service.method` or @\ `dbus.service.signal` decorator.
|
||||
+ @\ `dbus.service.method`, @\ `dbus.service.signal` or
|
||||
+ @\ `dbus.service.property` decorator.
|
||||
|
||||
Example::
|
||||
|
||||
- class Example(dbus.service.object):
|
||||
+ class Example(dbus.service.Object):
|
||||
def __init__(self, object_path):
|
||||
dbus.service.Object.__init__(self, dbus.SessionBus(), path)
|
||||
self._last_input = None
|
||||
@@ -397,6 +502,8 @@ class Object(Interface):
|
||||
in_signature='v', out_signature='s')
|
||||
def StringifyVariant(self, var):
|
||||
self.LastInputChanged(var) # emits the signal
|
||||
+ # Emit the property changed signal
|
||||
+ self.PropertiesChanged('com.example.Sample', {'LastInput': var}, [])
|
||||
return str(var)
|
||||
|
||||
@dbus.service.signal(interface='com.example.Sample',
|
||||
@@ -410,6 +517,20 @@ class Object(Interface):
|
||||
in_signature='', out_signature='v')
|
||||
def GetLastInput(self):
|
||||
return self._last_input
|
||||
+
|
||||
+ @dbus.service.property(interface='com.example.Sample',
|
||||
+ signature='s')
|
||||
+ def LastInput(self):
|
||||
+ return self._last_input
|
||||
+
|
||||
+ @LastInput.setter
|
||||
+ def LastInput(self, value):
|
||||
+ self._last_input = value
|
||||
+ # By default a property is expected to send the
|
||||
+ # PropertiesChanged signal when value changes.
|
||||
+ self.PropertiesChanged('com.example.Sample',
|
||||
+ {'LastInput': var}, [])
|
||||
+
|
||||
"""
|
||||
|
||||
#: If True, this object can be made available at more than one object path.
|
||||
@@ -484,7 +605,7 @@ class Object(Interface):
|
||||
if conn is not None and object_path is not None:
|
||||
self.add_to_connection(conn, object_path)
|
||||
|
||||
- @property
|
||||
+ @_builtin_property
|
||||
def __dbus_object_path__(self):
|
||||
"""The object-path at which this object is available.
|
||||
Access raises AttributeError if there is no object path, or more than
|
||||
@@ -500,7 +621,7 @@ class Object(Interface):
|
||||
else:
|
||||
return self._object_path
|
||||
|
||||
- @property
|
||||
+ @_builtin_property
|
||||
def connection(self):
|
||||
"""The Connection on which this object is available.
|
||||
Access raises AttributeError if there is no Connection, or more than
|
||||
@@ -516,7 +637,7 @@ class Object(Interface):
|
||||
else:
|
||||
return self._connection
|
||||
|
||||
- @property
|
||||
+ @_builtin_property
|
||||
def locations(self):
|
||||
"""An iterable over tuples representing locations at which this
|
||||
object is available.
|
||||
@@ -762,7 +883,7 @@ class Object(Interface):
|
||||
reflection_data = _dbus_bindings.DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE
|
||||
reflection_data += '<node name="%s">\n' % object_path
|
||||
|
||||
- interfaces = self._dbus_class_table[self.__class__.__module__ + '.' + self.__class__.__name__]
|
||||
+ interfaces = self._dbus_interface_table
|
||||
for (name, funcs) in interfaces.items():
|
||||
reflection_data += ' <interface name="%s">\n' % (name)
|
||||
|
||||
@@ -771,6 +892,8 @@ class Object(Interface):
|
||||
reflection_data += self.__class__._reflect_on_method(func)
|
||||
elif getattr(func, '_dbus_is_signal', False):
|
||||
reflection_data += self.__class__._reflect_on_signal(func)
|
||||
+ elif isinstance(func, property):
|
||||
+ reflection_data += self.__class__._reflect_on_property(func)
|
||||
|
||||
reflection_data += ' </interface>\n'
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2014 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=pygobject
|
||||
PKG_VERSION:=2.28.6
|
||||
PKG_RELEASE:=1
|
||||
PKG_LICENSE:=LGPL
|
||||
|
||||
PKG_SOURCE:=PYGOBJECT_2_28_6.tar.xz
|
||||
PKG_SOURCE_SUBDIR:=PYGOBJECT_2_28_6
|
||||
PKG_SOURCE_URL:=https://git.gnome.org/browse/pygobject/snapshot/
|
||||
PKG_MD5SUM:=791c80656105a9e1704e8568b4eb05f9
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_BUILD_DEPENDS:=python
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
$(call include_mk, python-package.mk)
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-cairo=no \
|
||||
--with-cairo=no \
|
||||
--enable-introspection=no
|
||||
|
||||
TARGET_LDFLAGS += -Wl,-rpath-link=$(ICONV_PREFIX)/lib
|
||||
TARGET_LDFLAGS += -Wl,-rpath-link=$(INTL_PREFIX)/lib
|
||||
|
||||
define Package/python-gobject2
|
||||
SECTION:=language-python
|
||||
CATEGORY:=Languages
|
||||
SUBMENU:=Python
|
||||
TITLE:=python-gobject2
|
||||
MAINTAINER:=Denis Osvald <denis.osvald@sartura.hr>
|
||||
DEPENDS:=+python +glib2
|
||||
endef
|
||||
|
||||
define Package/python-gobject2/description
|
||||
Python bindings for GObject Introspection
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
|
||||
endef
|
||||
|
||||
define Package/python-gobject2/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
|
||||
#find $(1) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,python-gobject2))
|
||||
@@ -8,7 +8,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
PKG_NAME:=questd
|
||||
PKG_VERSION:=3.1.38
|
||||
|
||||
PKG_SOURCE_VERSION:=4e1e080fb8295d89c74abb93e08dcf2f9cc5abbf
|
||||
PKG_SOURCE_VERSION:=85785b97a1526114ae521beacb1b302c3cb914ab
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=http://public.inteno.se:/questd
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=samba3
|
||||
PKG_VERSION:=3.0.37
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_MD5SUM:=11ed2bfef4090bd5736b194b43f67289
|
||||
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
diff --git a/source/smbd/process.c b/source/smbd/process.c
|
||||
index e861e16..6499bc7 100644
|
||||
--- a/source/smbd/process.c
|
||||
+++ b/source/smbd/process.c
|
||||
@@ -1159,6 +1159,7 @@ int chain_reply(char *inbuf,char *outbuf,int size,int bufsize)
|
||||
{
|
||||
static char *orig_inbuf;
|
||||
static char *orig_outbuf;
|
||||
+ static int orig_size;
|
||||
int smb_com1, smb_com2 = CVAL(inbuf,smb_vwv0);
|
||||
unsigned smb_off2 = SVAL(inbuf,smb_vwv1);
|
||||
char *inbuf2, *outbuf2;
|
||||
@@ -1178,6 +1179,13 @@ int chain_reply(char *inbuf,char *outbuf,int size,int bufsize)
|
||||
/* this is the first part of the chain */
|
||||
orig_inbuf = inbuf;
|
||||
orig_outbuf = outbuf;
|
||||
+ orig_size = size;
|
||||
+ }
|
||||
+
|
||||
+ /* Validate smb_off2 */
|
||||
+ if ((smb_off2 < smb_wct - 4) || orig_size < (smb_off2 + 4 - smb_wct)) {
|
||||
+ exit_server_cleanly("Bad chained packet");
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1192,6 +1200,11 @@ int chain_reply(char *inbuf,char *outbuf,int size,int bufsize)
|
||||
SSVAL(outbuf,smb_vwv1,smb_offset(outbuf+outsize,outbuf));
|
||||
SCVAL(outbuf,smb_vwv0,smb_com2);
|
||||
|
||||
+ if (outsize <= smb_wct) {
|
||||
+ exit_server_cleanly("Bad chained packet");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
/* remember how much the caller added to the chain, only counting stuff
|
||||
after the parameter words */
|
||||
chain_size += outsize - smb_wct;
|
||||
@@ -1,82 +0,0 @@
|
||||
diff --git a/source/lib/util_sid.c b/source/lib/util_sid.c
|
||||
index 032be9a..2c5a0c7 100644
|
||||
--- a/source/lib/util_sid.c
|
||||
+++ b/source/lib/util_sid.c
|
||||
@@ -403,6 +403,9 @@ BOOL sid_parse(const char *inbuf, size_t len, DOM_SID *sid)
|
||||
|
||||
sid->sid_rev_num = CVAL(inbuf, 0);
|
||||
sid->num_auths = CVAL(inbuf, 1);
|
||||
+ if (sid->num_auths > MAXSUBAUTHS) {
|
||||
+ return false;
|
||||
+ }
|
||||
memcpy(sid->id_auth, inbuf+2, 6);
|
||||
if (len < 8 + sid->num_auths*4)
|
||||
return False;
|
||||
diff --git a/source/libads/ldap.c b/source/libads/ldap.c
|
||||
index 7479894..eebc0fd 100644
|
||||
--- a/source/libads/ldap.c
|
||||
+++ b/source/libads/ldap.c
|
||||
@@ -1771,7 +1771,9 @@ static void dump_sid(const char *field, struct berval **values)
|
||||
int i;
|
||||
for (i=0; values[i]; i++) {
|
||||
DOM_SID sid;
|
||||
- sid_parse(values[i]->bv_val, values[i]->bv_len, &sid);
|
||||
+ if (!sid_parse(values[i]->bv_val, values[i]->bv_len, &sid)) {
|
||||
+ return;
|
||||
+ }
|
||||
printf("%s: %s\n", field, sid_string_static(&sid));
|
||||
}
|
||||
}
|
||||
diff --git a/source/libsmb/cliquota.c b/source/libsmb/cliquota.c
|
||||
index 2a47ae2..5721b67 100644
|
||||
--- a/source/libsmb/cliquota.c
|
||||
+++ b/source/libsmb/cliquota.c
|
||||
@@ -117,7 +117,9 @@ static BOOL parse_user_quota_record(const char *rdata, unsigned int rdata_count,
|
||||
}
|
||||
#endif /* LARGE_SMB_OFF_T */
|
||||
|
||||
- sid_parse(rdata+40,sid_len,&qt.sid);
|
||||
+ if (!sid_parse(rdata+40,sid_len,&qt.sid)) {
|
||||
+ return False;
|
||||
+ }
|
||||
|
||||
qt.qtype = SMB_USER_QUOTA_TYPE;
|
||||
|
||||
diff --git a/source/smbd/nttrans.c b/source/smbd/nttrans.c
|
||||
index 2b9d5da..60bab7e 100644
|
||||
--- a/source/smbd/nttrans.c
|
||||
+++ b/source/smbd/nttrans.c
|
||||
@@ -2424,7 +2424,10 @@ static int call_nt_transact_ioctl(connection_struct *conn, char *inbuf, char *ou
|
||||
/* unknown 4 bytes: this is not the length of the sid :-( */
|
||||
/*unknown = IVAL(pdata,0);*/
|
||||
|
||||
- sid_parse(pdata+4,sid_len,&sid);
|
||||
+ if (!sid_parse(pdata+4,sid_len,&sid)) {
|
||||
+ return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
|
||||
+ }
|
||||
+
|
||||
DEBUGADD(10,("for SID: %s\n",sid_string_static(&sid)));
|
||||
|
||||
if (!sid_to_uid(&sid, &uid)) {
|
||||
@@ -2662,7 +2665,9 @@ static int call_nt_transact_get_user_quota(connection_struct *conn, char *inbuf,
|
||||
break;
|
||||
}
|
||||
|
||||
- sid_parse(pdata+8,sid_len,&sid);
|
||||
+ if (!sid_parse(pdata+8,sid_len,&sid)) {
|
||||
+ return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
|
||||
+ }
|
||||
|
||||
if (vfs_get_ntquota(fsp, SMB_USER_QUOTA_TYPE, &sid, &qt)!=0) {
|
||||
ZERO_STRUCT(qt);
|
||||
@@ -2828,7 +2833,9 @@ static int call_nt_transact_set_user_quota(connection_struct *conn, char *inbuf,
|
||||
}
|
||||
#endif /* LARGE_SMB_OFF_T */
|
||||
|
||||
- sid_parse(pdata+40,sid_len,&sid);
|
||||
+ if (!sid_parse(pdata+40,sid_len,&sid)) {
|
||||
+ return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
|
||||
+ }
|
||||
DEBUGADD(8,("SID: %s\n",sid_string_static(&sid)));
|
||||
|
||||
/* 44 unknown bytes left... */
|
||||
@@ -1,59 +0,0 @@
|
||||
From e11637c2c89c2d38963311416c34a4767b19e175 Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Metzmacher <metze@samba.org>
|
||||
Date: Sat, 17 Mar 2012 01:22:27 +0100
|
||||
Subject: [PATCH] s3:librpc/gen_ndr: fix array checks (bug #8815 / CVE-2012-1182)
|
||||
|
||||
An Anonymous researcher working with HP's Zero Day Initiative program
|
||||
has found this and notified us.
|
||||
|
||||
metze
|
||||
---
|
||||
source/librpc/gen_ndr/ndr_wkssvc.c | 12 ++++++------
|
||||
1 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/source/librpc/gen_ndr/ndr_wkssvc.c b/source/librpc/gen_ndr/ndr_wkssvc.c
|
||||
index 2af3587..07cf1a1 100644
|
||||
--- a/source/librpc/gen_ndr/ndr_wkssvc.c
|
||||
+++ b/source/librpc/gen_ndr/ndr_wkssvc.c
|
||||
@@ -1385,10 +1385,10 @@ NTSTATUS ndr_pull_USER_INFO_0_CONTAINER(struct ndr_pull *ndr, int ndr_flags, str
|
||||
NDR_PULL_ALLOC_N(ndr, r->user0, ndr_get_array_size(ndr, &r->user0));
|
||||
_mem_save_user0_1 = NDR_PULL_GET_MEM_CTX(ndr);
|
||||
NDR_PULL_SET_MEM_CTX(ndr, r->user0, 0);
|
||||
- for (cntr_user0_1 = 0; cntr_user0_1 < r->entries_read; cntr_user0_1++) {
|
||||
+ for (cntr_user0_1 = 0; cntr_user0_1 < ndr_get_array_size(ndr, &r->user0); cntr_user0_1++) {
|
||||
NDR_CHECK(ndr_pull_USER_INFO_0(ndr, NDR_SCALARS, &r->user0[cntr_user0_1]));
|
||||
}
|
||||
- for (cntr_user0_1 = 0; cntr_user0_1 < r->entries_read; cntr_user0_1++) {
|
||||
+ for (cntr_user0_1 = 0; cntr_user0_1 < ndr_get_array_size(ndr, &r->user0); cntr_user0_1++) {
|
||||
NDR_CHECK(ndr_pull_USER_INFO_0(ndr, NDR_BUFFERS, &r->user0[cntr_user0_1]));
|
||||
}
|
||||
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user0_1, 0);
|
||||
@@ -1631,10 +1631,10 @@ NTSTATUS ndr_pull_USER_INFO_1_CONTAINER(struct ndr_pull *ndr, int ndr_flags, str
|
||||
NDR_PULL_ALLOC_N(ndr, r->user1, ndr_get_array_size(ndr, &r->user1));
|
||||
_mem_save_user1_1 = NDR_PULL_GET_MEM_CTX(ndr);
|
||||
NDR_PULL_SET_MEM_CTX(ndr, r->user1, 0);
|
||||
- for (cntr_user1_1 = 0; cntr_user1_1 < r->entries_read; cntr_user1_1++) {
|
||||
+ for (cntr_user1_1 = 0; cntr_user1_1 < ndr_get_array_size(ndr, &r->user1); cntr_user1_1++) {
|
||||
NDR_CHECK(ndr_pull_USER_INFO_1(ndr, NDR_SCALARS, &r->user1[cntr_user1_1]));
|
||||
}
|
||||
- for (cntr_user1_1 = 0; cntr_user1_1 < r->entries_read; cntr_user1_1++) {
|
||||
+ for (cntr_user1_1 = 0; cntr_user1_1 < ndr_get_array_size(ndr, &r->user1); cntr_user1_1++) {
|
||||
NDR_CHECK(ndr_pull_USER_INFO_1(ndr, NDR_BUFFERS, &r->user1[cntr_user1_1]));
|
||||
}
|
||||
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user1_1, 0);
|
||||
@@ -1953,10 +1953,10 @@ NTSTATUS ndr_pull_wkssvc_NetWkstaTransportCtr0(struct ndr_pull *ndr, int ndr_fla
|
||||
NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
|
||||
_mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
|
||||
NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
|
||||
- for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
|
||||
+ for (cntr_array_1 = 0; cntr_array_1 < ndr_get_array_size(ndr, &r->array); cntr_array_1++) {
|
||||
NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
|
||||
}
|
||||
- for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
|
||||
+ for (cntr_array_1 = 0; cntr_array_1 < ndr_get_array_size(ndr, &r->array); cntr_array_1++) {
|
||||
NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
|
||||
}
|
||||
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
|
||||
--
|
||||
1.7.4.1
|
||||
|
||||
@@ -16,7 +16,7 @@ define Package/voice-client
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=voice-client
|
||||
DEPENDS:=+asterisk18-mod
|
||||
DEPENDS:=+asterisk13
|
||||
endef
|
||||
|
||||
define Package/voice-client/description
|
||||
|
||||
Reference in New Issue
Block a user