cifsd: update to git (2019-08-19)

* update to git (2019-08-19)
* use new "kill_server" sysfs option on stop
* ensure reload_service() works correctly
* add inherit owner, force create mode, force directory mode UCI options
* add patches for mips target (vfree, vmalloc)

Signed-off-by: Andy Walsh <andy.walsh44+github@gmail.com>
This commit is contained in:
Andy Walsh
2019-08-08 10:57:57 +02:00
parent 89457abf7d
commit 086937052b
6 changed files with 176 additions and 20 deletions
+4 -4
View File
@@ -1,13 +1,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=cifsd-tools
PKG_RELEASE:=2
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/cifsd-team/cifsd-tools.git
PKG_SOURCE_DATE:=2019-07-05
PKG_SOURCE_VERSION:=539fa21a8dd427a8ca2dc13c9a5a1c975be96d3c
PKG_MIRROR_HASH:=8c1b22d9926112a7e8ec94a3f731639a3789bef1aeb447f0bd7c41a1884e4dc5
PKG_SOURCE_DATE:=2019-08-19
PKG_SOURCE_VERSION:=bbeab27f0a1695f711fb84d9cd29a83f818ef90e
PKG_MIRROR_HASH:=f8bef545400aa8c0db6ba0fffdf0c0a2f201603503728f140df133aff3a39cbb
PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
PKG_LICENSE:=GPL-2.0-or-later
+31 -5
View File
@@ -60,6 +60,9 @@ smb_add_share()
local read_list
local hide_dot_files
local veto_files
local inherit_owner
local force_create_mode
local force_directory_mode
config_get name $1 name
config_get path $1 path
@@ -76,6 +79,9 @@ smb_add_share()
config_get read_list $1 read_list
config_get_bool hide_dot_files $1 hide_dot_files 0
config_get veto_files $1 veto_files
config_get inherit_owner $1 inherit_owner
config_get force_create_mode $1 force_create_mode
config_get force_directory_mode $1 force_directory_mode
[ -z "$name" ] || [ -z "$path" ] && return
@@ -92,11 +98,14 @@ smb_add_share()
[ -n "$create_mask" ] && printf "\tcreate mask = %s\n" "$create_mask"
[ -n "$dir_mask" ] && printf "\tdirectory mask = %s\n" "$dir_mask"
[ -n "$force_create_mode" ] && printf "\tforce create mode = %s\n" "$force_create_mode"
[ -n "$force_directory_mode" ] && printf "\tforce directory mode = %s\n" "$force_directory_mode"
[ -n "$browseable" ] && printf "\tbrowseable = %s\n" "$browseable"
[ -n "$read_only" ] && printf "\tread only = %s\n" "$read_only"
[ -n "$writeable" ] && printf "\twriteable = %s\n" "$writeable"
[ -n "$guest_ok" ] && printf "\tguest ok = %s\n" "$guest_ok"
[ -n "$inherit_owner" ] && printf "\tinherit owner = %s\n" "$inherit_owner"
[ -n "$write_list" ] && printf "\twrite list = %s\n" "$write_list"
[ -n "$read_list" ] && printf "\tread list = %s\n" "$read_list"
@@ -139,11 +148,6 @@ start_service()
exit 1
fi
[ -f /tmp/cifsd.lock ] && rm /tmp/cifsd.lock
# try remove again before start
[ -e /sys/module/cifsd ] && rmmod cifsd > /dev/null 2>&1
modprobe cifsd 2> /dev/null
if [ ! -e /sys/module/cifsd ]; then
logger -t 'cifsd' "modprobe of cifsd module failed, can\'t start cifsd!"
@@ -155,3 +159,25 @@ start_service()
procd_set_param command /usr/sbin/cifsd --n
procd_close_instance
}
stop_service()
{
logger -t 'cifsd' "Stopping CIFSD userspace service."
killall cifsd > /dev/null 2>&1
sleep 1
[ -e /sys/class/cifsd-control/kill_server ] && echo hard > /sys/class/cifsd-control/kill_server
sleep 2
[ -e /sys/module/cifsd ] && rmmod cifsd > /dev/null 2>&1
# With open smb connections rmmod takes longer
if [ -e /sys/module/cifsd ]; then
sleep 5
rmmod cifsd > /dev/null 2>&1
fi
[ -f /tmp/cifsd.lock ] && rm /tmp/cifsd.lock
}
reload_service() {
stop_service "$@"
sleep 1
start_service "$@"
}
+16 -8
View File
@@ -135,7 +135,20 @@
; Veto the Apple specific files that a NetAtalk server
; creates.
; veto files = /.AppleDouble/.bin/.AppleDesktop/Network Trash Folder/
;
; - inherit owner
; The ownership for new files and directories should be controlled
; by the ownership of the parent directory.
; Valid options are yes or no.
; - inherit smack
; This parameter can be used to ensure that if smack label exist
; on parent directories.
; Valid options are yes or no.
; - force create mode
; This parameter specifies a set of UNIX mode bit permissions
; that will always be set on a file created by cifsd.
; - force directory mode
; This parameter specifies a set of UNIX mode bit permissions
; that will always be set on a directory created by cifsd.
;
; Rules to update this file:
; - Every [share] definition should start on new line
@@ -148,13 +161,8 @@
;******************************************************************************
[global]
server string = CIFSD on OpenWrt
netbios name = CIFSD
map to guest = Bad User
[share]
[homes]
comment = content server share
path = /mnt
guest ok = yes
create mask = 0777
directory mask = 0777
path = /tmp