oweals/rpcd.git
9 years agoiwinfo: add phyname procedure
Jo-Philipp Wich [Wed, 11 Feb 2015 13:04:08 +0000 (14:04 +0100)]
iwinfo: add phyname procedure

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agosession: fix method signatures for create, list and destroy
Jo-Philipp Wich [Mon, 9 Feb 2015 11:51:44 +0000 (12:51 +0100)]
session: fix method signatures for create, list and destroy

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
10 years agoiwinfo: add support for requesting assoc info for a specific mac address
Felix Fietkau [Sat, 29 Nov 2014 18:43:00 +0000 (19:43 +0100)]
iwinfo: add support for requesting assoc info for a specific mac address

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
10 years agoiwinfo: add 802.11ac hw mode
Felix Fietkau [Mon, 20 Oct 2014 13:49:24 +0000 (15:49 +0200)]
iwinfo: add 802.11ac hw mode

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
10 years agoiwinfo: use UBUS_METHOD_NOARG
Felix Fietkau [Sat, 4 Oct 2014 17:55:58 +0000 (19:55 +0200)]
iwinfo: use UBUS_METHOD_NOARG

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
10 years agoplugin.h: explicitly include json.h
Felix Fietkau [Sat, 4 Oct 2014 17:54:58 +0000 (19:54 +0200)]
plugin.h: explicitly include json.h

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
10 years agoplugin: fix parsing libexec plugin output
Jo-Philipp Wich [Thu, 3 Jul 2014 21:39:21 +0000 (23:39 +0200)]
plugin: fix parsing libexec plugin output

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
10 years agosession: add missing include
Felix Fietkau [Sun, 29 Jun 2014 21:22:50 +0000 (23:22 +0200)]
session: add missing include

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
10 years agouci: rework variable usage
Luka Perkov [Thu, 29 May 2014 10:57:35 +0000 (12:57 +0200)]
uci: rework variable usage

Signed-off-by: Luka Perkov <luka@openwrt.org>
10 years agofix segmentation fault when plugins are loaded
Luka Perkov [Wed, 29 Jan 2014 11:21:59 +0000 (11:21 +0000)]
fix segmentation fault when plugins are loaded

Function rpc_plugin_register_library() is modifying the struct's contents in
list_add() call. That said, the rpc_plugin struct should not be defined as
const. This caused segmentation fault when built on up-to-date Arch Linux.

Signed-off-by: Luka Perkov <luka@openwrt.org>
10 years agofile: when writing a file make sure it's contents are stored
Luka Perkov [Wed, 29 Jan 2014 11:21:58 +0000 (11:21 +0000)]
file: when writing a file make sure it's contents are stored

Fixes problems with ubi(fs).

Signed-off-by: Luka Perkov <luka@openwrt.org>
10 years agofile: create a file on write if it does not exist
Luka Perkov [Wed, 29 Jan 2014 11:21:57 +0000 (11:21 +0000)]
file: create a file on write if it does not exist

Signed-off-by: Luka Perkov <luka@openwrt.org>
10 years agofix whitespaces
Luka Perkov [Wed, 29 Jan 2014 11:21:56 +0000 (11:21 +0000)]
fix whitespaces

Signed-off-by: Luka Perkov <luka@openwrt.org>
10 years agosession: make object and function arguments of session.access optional, dump effectiv...
Jo-Philipp Wich [Sun, 19 Jan 2014 19:45:25 +0000 (19:45 +0000)]
session: make object and function arguments of session.access optional, dump effective acls in this case

10 years agouci: fix same buffer reuse introduced by previous commit
Jo-Philipp Wich [Sun, 12 Jan 2014 17:43:48 +0000 (17:43 +0000)]
uci: fix same buffer reuse introduced by previous commit

10 years agodebug
Jo-Philipp Wich [Sun, 12 Jan 2014 17:33:46 +0000 (17:33 +0000)]
debug

10 years agouci: grant access to confirm and rollback methods only to initiating session
Jo-Philipp Wich [Sun, 12 Jan 2014 17:23:27 +0000 (17:23 +0000)]
uci: grant access to confirm and rollback methods only to initiating session

Previously any session with access permissions for the corresponding method
was able to confirm or rollback commits initiated by another session.

Change those methods to only grant access to the initiating session.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
10 years agouci: introduce confirm method to cancel pending rollbacks without side effects
Jo-Philipp Wich [Sun, 12 Jan 2014 17:02:43 +0000 (17:02 +0000)]
uci: introduce confirm method to cancel pending rollbacks without side effects

Calling commit with rollback=false to cancel a pending rollback timer can
potentially trigger another commit if no rollback is actually pending.

This introduces a new method "confirm" which cancels the rollback timer
without any other possible side effects.

While being at it, change the return code when trying to commit during
a pending rollback or when trying to rollback without a pending timeout to
UBUS_STATUS_NO_DATA. This is needed to be able to differentiate between a
denied request and an inappropriate state.

Also change the error return code for glob() failures to the more
appropriate UBUS_STATUS_NOT_FOUND.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
10 years agoExtend copyright
Jo-Philipp Wich [Sun, 12 Jan 2014 12:48:58 +0000 (12:48 +0000)]
Extend copyright

10 years agouci: rename uci.apply "commit" attribute to "roolback" and invert its logic
Jo-Philipp Wich [Sun, 12 Jan 2014 12:45:11 +0000 (12:45 +0000)]
uci: rename uci.apply "commit" attribute to "roolback" and invert its logic

10 years agoconfig.change triggers should only run if the config is valid
John Crispin [Wed, 18 Dec 2013 12:59:16 +0000 (13:59 +0100)]
config.change triggers should only run if the config is valid

Signed-off-by: John Crispin <blogic@openwrt.org>
10 years agofix inverted apply_running check
John Crispin [Wed, 18 Dec 2013 12:56:54 +0000 (13:56 +0100)]
fix inverted apply_running check

Signed-off-by: John Crispin <blogic@openwrt.org>
11 years agouci: make config argument of changes call optional to allow listing all changes in...
Jo-Philipp Wich [Sat, 23 Nov 2013 20:31:39 +0000 (20:31 +0000)]
uci: make config argument of changes call optional to allow listing all changes in all files

11 years agouci: add state call to retrieve uci state variables
Jo-Philipp Wich [Sat, 23 Nov 2013 19:30:29 +0000 (19:30 +0000)]
uci: add state call to retrieve uci state variables

11 years agosession: fix file descriptor leak in rpc_blob_from_file()
Jo-Philipp Wich [Sat, 26 Oct 2013 14:16:29 +0000 (14:16 +0000)]
session: fix file descriptor leak in rpc_blob_from_file()

11 years agorpcd: CMake: fix out of tree builds
Alexander Couzens [Thu, 10 Oct 2013 04:30:31 +0000 (06:30 +0200)]
rpcd: CMake: fix out of tree builds

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
11 years agouci: clear ptr.value in rpc_uci_merge_set(), this fixes missing delete deltas if...
Jo-Philipp Wich [Sun, 29 Sep 2013 13:11:37 +0000 (13:11 +0000)]
uci: clear ptr.value in rpc_uci_merge_set(), this fixes missing delete deltas if multiple options are merged

11 years agosession: change "sid" attribute to "ubus_rpc_session", this ensures that exposed...
Jo-Philipp Wich [Fri, 13 Sep 2013 12:52:35 +0000 (14:52 +0200)]
session: change "sid" attribute to "ubus_rpc_session", this ensures that exposed session calls are confined to the calling session context

11 years agoplugin: use blobmsg_type() instead of blob_id()
Jo-Philipp Wich [Thu, 12 Sep 2013 11:36:49 +0000 (13:36 +0200)]
plugin: use blobmsg_type() instead of blob_id()

11 years agosession.c: use blobmsg_type() instead of blob_id()
Jo-Philipp Wich [Thu, 12 Sep 2013 11:31:21 +0000 (13:31 +0200)]
session.c: use blobmsg_type() instead of blob_id()

11 years agosession: support negative group expressions
Jo-Philipp Wich [Thu, 12 Sep 2013 11:10:30 +0000 (13:10 +0200)]
session: support negative group expressions

This change allows excluding specific groups after a wildcard expression.
The following example would grant read access to any acl group except the
group named "example".

  list read '*'
  list read '!example'

11 years agosession: restore ACL dumping for session get and session list calls
Jo-Philipp Wich [Thu, 12 Sep 2013 10:13:05 +0000 (12:13 +0200)]
session: restore ACL dumping for session get and session list calls

11 years agosession: fix enum mismatch in rpc_handle_get() and rpc_handle_set()
Jo-Philipp Wich [Thu, 12 Sep 2013 09:51:58 +0000 (11:51 +0200)]
session: fix enum mismatch in rpc_handle_get() and rpc_handle_set()

11 years agosession: remove unused ctx argument from rpc_session_grant() and rpc_session_destroy()
Jo-Philipp Wich [Thu, 12 Sep 2013 09:50:33 +0000 (11:50 +0200)]
session: remove unused ctx argument from rpc_session_grant() and rpc_session_destroy()

11 years agosession: do not dump and restore session ACLs but recalculate them when restoring...
Jo-Philipp Wich [Thu, 12 Sep 2013 09:45:59 +0000 (11:45 +0200)]
session: do not dump and restore session ACLs but recalculate them when restoring the session

11 years agosession: disallow destroying the null session
Jo-Philipp Wich [Thu, 12 Sep 2013 08:35:55 +0000 (10:35 +0200)]
session: disallow destroying the null session

11 years agouci: properly deal with uci_load() failures
Jo-Philipp Wich [Wed, 11 Sep 2013 11:16:27 +0000 (13:16 +0200)]
uci: properly deal with uci_load() failures

11 years agosession: fix argument order of crypt() and prevent segfault if /etc/config/rpcd does...
Jo-Philipp Wich [Tue, 10 Sep 2013 18:12:39 +0000 (20:12 +0200)]
session: fix argument order of crypt() and prevent segfault if /etc/config/rpcd does not exist

11 years agosession: use correct policy for rpc_handle_login()
Jo-Philipp Wich [Tue, 10 Sep 2013 18:01:05 +0000 (20:01 +0200)]
session: use correct policy for rpc_handle_login()

11 years agosession: setup a persistent NULL section and implement login procedure
Jo-Philipp Wich [Tue, 10 Sep 2013 17:41:29 +0000 (19:41 +0200)]
session: setup a persistent NULL section and implement login procedure

11 years agoDrop LuCI2 backend, it will move to its own repository
Jo-Philipp Wich [Mon, 9 Sep 2013 14:32:53 +0000 (16:32 +0200)]
Drop LuCI2 backend, it will move to its own repository

11 years agoadd config transaction support
John Crispin [Thu, 5 Sep 2013 19:55:51 +0000 (21:55 +0200)]
add config transaction support

Signed-off-by: John Crispin <blogic@openwrt.org>
11 years agomake uci commit calls trigger config.change events
John Crispin [Thu, 5 Sep 2013 19:55:50 +0000 (21:55 +0200)]
make uci commit calls trigger config.change events

Signed-off-by: John Crispin <blogic@openwrt.org>
11 years agorename rpc_uci_purge_savedir to rpc_uci_purge_dir
John Crispin [Thu, 5 Sep 2013 19:55:49 +0000 (21:55 +0200)]
rename rpc_uci_purge_savedir to rpc_uci_purge_dir

Signed-off-by: John Crispin <blogic@openwrt.org>
11 years agoFix rpcd includes in plugin.h
Jo-Philipp Wich [Thu, 5 Sep 2013 15:00:23 +0000 (17:00 +0200)]
Fix rpcd includes in plugin.h

11 years agoSet umask to 0077 on daemon startup to prevent libuci from making world-readable...
Jo-Philipp Wich [Thu, 5 Sep 2013 14:14:30 +0000 (16:14 +0200)]
Set umask to 0077 on daemon startup to prevent libuci from making world-readable directories

11 years agoUse common /var/run/rpcd base directory to store runtime information
Jo-Philipp Wich [Thu, 5 Sep 2013 13:14:00 +0000 (15:14 +0200)]
Use common /var/run/rpcd base directory to store runtime information

11 years agomain: only purge uci savedirs if not reloading
Jo-Philipp Wich [Thu, 5 Sep 2013 12:26:14 +0000 (14:26 +0200)]
main: only purge uci savedirs if not reloading

11 years agouci: expose rpc_uci_purge_savedirs() helper
Jo-Philipp Wich [Thu, 5 Sep 2013 12:25:51 +0000 (14:25 +0200)]
uci: expose rpc_uci_purge_savedirs() helper

11 years agomain: store session data to disk on receipt of SIGUSR1 or SIGHUP. On HUP terminate...
Jo-Philipp Wich [Wed, 4 Sep 2013 15:09:51 +0000 (17:09 +0200)]
main: store session data to disk on receipt of SIGUSR1 or SIGHUP. On HUP terminate self and re-exec

11 years agosession: add support for saving and restoring session data to disk
Jo-Philipp Wich [Wed, 4 Sep 2013 13:18:14 +0000 (15:18 +0200)]
session: add support for saving and restoring session data to disk

11 years agoMove includes into subdirectory
Jo-Philipp Wich [Wed, 4 Sep 2013 10:46:11 +0000 (12:46 +0200)]
Move includes into subdirectory

11 years agouci: use per-session save directory and register session destroy callback to purge...
Jo-Philipp Wich [Tue, 3 Sep 2013 10:42:54 +0000 (12:42 +0200)]
uci: use per-session save directory and register session destroy callback to purge leftover deltas

11 years agoluci2: change ops->access to ops->session_access to accomodate for changed plugin api
Jo-Philipp Wich [Tue, 3 Sep 2013 10:25:14 +0000 (12:25 +0200)]
luci2: change ops->access to ops->session_access to accomodate for changed plugin api

11 years agoplugin: expose rpc_session_create_cb() and rpc_session_destroy_cb() in plugin ops...
Jo-Philipp Wich [Tue, 3 Sep 2013 10:23:45 +0000 (12:23 +0200)]
plugin: expose rpc_session_create_cb() and rpc_session_destroy_cb() in plugin ops; rename access to session_access

11 years agosession: introduce api to register session create and destroy callbacks
Jo-Philipp Wich [Tue, 3 Sep 2013 10:21:09 +0000 (12:21 +0200)]
session: introduce api to register session create and destroy callbacks

11 years agoFold plugin specific headers files into the plugins .c file
Jo-Philipp Wich [Mon, 2 Sep 2013 15:29:06 +0000 (17:29 +0200)]
Fold plugin specific headers files into the plugins .c file

11 years agoRename from "luci-rpcd" to "rpcd"
Jo-Philipp Wich [Mon, 2 Sep 2013 15:09:57 +0000 (17:09 +0200)]
Rename from "luci-rpcd" to "rpcd"

11 years agoAdd CMake definitions for plugins
Jo-Philipp Wich [Mon, 2 Sep 2013 13:14:33 +0000 (15:14 +0200)]
Add CMake definitions for plugins

11 years agoluci2: convert to plugin library
Jo-Philipp Wich [Mon, 2 Sep 2013 12:52:49 +0000 (14:52 +0200)]
luci2: convert to plugin library

11 years agofile: convert to plugin library
Jo-Philipp Wich [Mon, 2 Sep 2013 12:52:37 +0000 (14:52 +0200)]
file: convert to plugin library

11 years agoiwinfo: convert to plugin library
Jo-Philipp Wich [Mon, 2 Sep 2013 12:52:22 +0000 (14:52 +0200)]
iwinfo: convert to plugin library

11 years agoIntroduce shared object plugin api
Jo-Philipp Wich [Mon, 2 Sep 2013 12:52:12 +0000 (14:52 +0200)]
Introduce shared object plugin api

11 years agoRegister dummy stderr callback when ivoking plugins calls to avoid filling the ustrea...
Jo-Philipp Wich [Sun, 1 Sep 2013 20:42:17 +0000 (22:42 +0200)]
Register dummy stderr callback when ivoking plugins calls to avoid filling the ustream with unread data.

11 years agoLink json-c
Jo-Philipp Wich [Sun, 1 Sep 2013 20:12:19 +0000 (22:12 +0200)]
Link json-c

11 years agoRework plugin support to use incremental json parsing and rpc_exec() framework for...
Jo-Philipp Wich [Sun, 1 Sep 2013 20:05:38 +0000 (22:05 +0200)]
Rework plugin support to use incremental json parsing and rpc_exec() framework for invocation

11 years agoluci2: change rpc_exec() callsites to accomodate for extra stdin_cb argument, change...
Jo-Philipp Wich [Sun, 1 Sep 2013 18:02:01 +0000 (20:02 +0200)]
luci2: change rpc_exec() callsites to accomodate for extra stdin_cb argument, change finish callbacks to emit proper return code

11 years agoExtend rpc_exec() to allow feeding childs stdin via callbacks, allow finish callback...
Jo-Philipp Wich [Sun, 1 Sep 2013 17:58:10 +0000 (19:58 +0200)]
Extend rpc_exec() to allow feeding childs stdin via callbacks, allow finish callback to override the ubus return code

11 years agoAdd initial plugin api support
Jo-Philipp Wich [Fri, 30 Aug 2013 16:31:15 +0000 (18:31 +0200)]
Add initial plugin api support

11 years agoluci2: change luci2.ui.menu call to return acl levels for each menu item
Jo-Philipp Wich [Fri, 16 Aug 2013 14:29:55 +0000 (16:29 +0200)]
luci2: change luci2.ui.menu call to return acl levels for each menu item

11 years agoluci2: add luci2.ui namespace
Jo-Philipp Wich [Tue, 13 Aug 2013 11:44:53 +0000 (13:44 +0200)]
luci2: add luci2.ui namespace

11 years agouci: refactor revert code to avoid illegal pointer access
Jo-Philipp Wich [Mon, 12 Aug 2013 12:49:02 +0000 (14:49 +0200)]
uci: refactor revert code to avoid illegal pointer access

11 years agouci: implement config level ACLs
Jo-Philipp Wich [Mon, 12 Aug 2013 11:53:09 +0000 (13:53 +0200)]
uci: implement config level ACLs

11 years agosession: expose rpc_session_access() function for testing session ACLs in other rpcd...
Jo-Philipp Wich [Mon, 12 Aug 2013 11:51:51 +0000 (13:51 +0200)]
session: expose rpc_session_access() function for testing session ACLs in other rpcd subsystems

11 years agosession: fix acl dumping if last object of previous scope is equal to first object...
Jo-Philipp Wich [Sat, 10 Aug 2013 19:56:06 +0000 (21:56 +0200)]
session: fix acl dumping if last object of previous scope is equal to first object of next one

11 years agosessions: add scopes for acls, default to "ubus" scope
Jo-Philipp Wich [Thu, 8 Aug 2013 16:53:59 +0000 (18:53 +0200)]
sessions: add scopes for acls, default to "ubus" scope

11 years agoluci2: fix incorrect buffer length in luci2.opkg config_set call
Jo-Philipp Wich [Mon, 5 Aug 2013 11:19:38 +0000 (13:19 +0200)]
luci2: fix incorrect buffer length in luci2.opkg config_set call

11 years agoluci2: add backup_list, backup_config_get and backup_config_set calls
Jo-Philipp Wich [Mon, 5 Aug 2013 11:16:25 +0000 (13:16 +0200)]
luci2: add backup_list, backup_config_get and backup_config_set calls

11 years agoluci2: add reboot call
Jo-Philipp Wich [Wed, 31 Jul 2013 17:47:35 +0000 (19:47 +0200)]
luci2: add reboot call

11 years agoluci2: add reset_test and reset_start calls
Jo-Philipp Wich [Wed, 31 Jul 2013 17:39:50 +0000 (19:39 +0200)]
luci2: add reset_test and reset_start calls

11 years agoluci2: add backup_restore and backup_clean calls, rename upgrade_abort to upgrade_clean
Jo-Philipp Wich [Wed, 31 Jul 2013 13:57:37 +0000 (15:57 +0200)]
luci2: add backup_restore and backup_clean calls, rename upgrade_abort to upgrade_clean

11 years agoluci2: add upgrade_test, upgrade_start and upgrade_abort calls
Jo-Philipp Wich [Tue, 30 Jul 2013 17:18:04 +0000 (19:18 +0200)]
luci2: add upgrade_test, upgrade_start and upgrade_abort calls

11 years agoluci2: use shared rpc_data_policy for opkg config_set call
Jo-Philipp Wich [Tue, 16 Jul 2013 17:07:58 +0000 (19:07 +0200)]
luci2: use shared rpc_data_policy for opkg config_set call

11 years agoluci2: add led_list and usb_list calls
Jo-Philipp Wich [Tue, 16 Jul 2013 16:31:11 +0000 (18:31 +0200)]
luci2: add led_list and usb_list calls

11 years agoluci2: add crontab_get and crontab_set calls, rename rpc_rclocal_policy to rpc_data_p...
Jo-Philipp Wich [Mon, 15 Jul 2013 14:42:34 +0000 (16:42 +0200)]
luci2: add crontab_get and crontab_set calls, rename rpc_rclocal_policy to rpc_data_policy

11 years agoIncrease exec command timeout to 30 seconds
Jo-Philipp Wich [Mon, 15 Jul 2013 14:03:37 +0000 (16:03 +0200)]
Increase exec command timeout to 30 seconds

11 years agoluci2: add rclocal_get and rclocal_set calls
Jo-Philipp Wich [Thu, 11 Jul 2013 10:56:24 +0000 (12:56 +0200)]
luci2: add rclocal_get and rclocal_set calls

11 years agoluci2: add diskfree call
Jo-Philipp Wich [Fri, 5 Jul 2013 11:37:28 +0000 (13:37 +0200)]
luci2: add diskfree call

11 years agoluci2: add opkg namespace
Jo-Philipp Wich [Thu, 4 Jul 2013 11:16:21 +0000 (13:16 +0200)]
luci2: add opkg namespace

11 years agoAdd rpc_exec() utility function
Jo-Philipp Wich [Thu, 4 Jul 2013 10:58:26 +0000 (12:58 +0200)]
Add rpc_exec() utility function

11 years agoluci2: implement password_set call
Jo-Philipp Wich [Mon, 1 Jul 2013 16:07:11 +0000 (18:07 +0200)]
luci2: implement password_set call

11 years agoluci2: implement sshkeys_get and sshkeys_set calls
Jo-Philipp Wich [Mon, 1 Jul 2013 15:28:30 +0000 (17:28 +0200)]
luci2: implement sshkeys_get and sshkeys_set calls

11 years agoluci2: make parsing START and STOP from init scripts more robust
Jo-Philipp Wich [Thu, 27 Jun 2013 17:01:06 +0000 (19:01 +0200)]
luci2: make parsing START and STOP from init scripts more robust

11 years agoluci2: implement init_list and init_action calls
Jo-Philipp Wich [Thu, 27 Jun 2013 16:42:53 +0000 (18:42 +0200)]
luci2: implement init_list and init_action calls

11 years agouci: expose section ordering index when dumping complete packages
Jo-Philipp Wich [Wed, 19 Jun 2013 09:33:17 +0000 (11:33 +0200)]
uci: expose section ordering index when dumping complete packages

11 years agouci: add delete method
Jo-Philipp Wich [Tue, 18 Jun 2013 12:45:57 +0000 (14:45 +0200)]
uci: add delete method

11 years agoluci2: implement process_signal call
Jo-Philipp Wich [Wed, 12 Jun 2013 14:44:15 +0000 (16:44 +0200)]
luci2: implement process_signal call

11 years agoluci2: implement process_list call
Jo-Philipp Wich [Wed, 12 Jun 2013 13:13:50 +0000 (15:13 +0200)]
luci2: implement process_list call

11 years agoiwinfo: expose phyname attribute
Jo-Philipp Wich [Sun, 9 Jun 2013 14:43:35 +0000 (16:43 +0200)]
iwinfo: expose phyname attribute

11 years agoAdd luci2 namespace to offer various backend methods required by the ui
Jo-Philipp Wich [Sat, 8 Jun 2013 15:56:02 +0000 (17:56 +0200)]
Add luci2 namespace to offer various backend methods required by the ui