Use the `cgi-io` scope to check for permission to execute the requested
command (`upload`, `backup`) and the `file` scope to check path
permissions.
The reasoning of this change is that `cgi-io` is usually used in
conjunction with `rpcd-mod-file` to transfer large file data out
of band and `rpcd-mod-file` already uses the `file` scope to manage
file path access permissions. After this change, both `rpc-mod-file`
and `cgi-io` can share the same path acl rules.
Write access to a path can be granted by using an ubus call in the
following form:
ubus call session grant '{
"ubus_rpc_session": "...",
"scope": "file",
"objects": [
[ "/var/lib/uploads/*", "write" ]
]
}'
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit c8a86c8c8e
)
44 lines
1 KiB
Makefile
44 lines
1 KiB
Makefile
#
|
|
# Copyright (C) 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:=cgi-io
|
|
PKG_RELEASE:=9
|
|
|
|
PKG_LICENSE:=GPL-2.0-or-later
|
|
|
|
PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
include $(INCLUDE_DIR)/cmake.mk
|
|
|
|
define Package/cgi-io
|
|
SECTION:=net
|
|
CATEGORY:=Network
|
|
SUBMENU:=Web Servers/Proxies
|
|
DEPENDS:=+libubox +libubus
|
|
TITLE:=CGI utility for handling up/downloading of files
|
|
endef
|
|
|
|
define Package/cgi-io/description
|
|
This package contains an cgi utility that is useful for up/downloading files
|
|
endef
|
|
|
|
define Build/Prepare
|
|
mkdir -p $(PKG_BUILD_DIR)
|
|
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
|
endef
|
|
|
|
define Package/cgi-io/install
|
|
$(INSTALL_DIR) $(1)/usr/libexec $(1)/www/cgi-bin/
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/cgi-io $(1)/usr/libexec
|
|
$(LN) ../../usr/libexec/cgi-io $(1)/www/cgi-bin/cgi-upload
|
|
$(LN) ../../usr/libexec/cgi-io $(1)/www/cgi-bin/cgi-backup
|
|
endef
|
|
|
|
$(eval $(call BuildPackage,cgi-io))
|