diff mbox series

[OpenWrt-Devel] samba36: log error if getting device info failed

Message ID 20191230065453.3067-1-zajec5@gmail.com
State Accepted
Delegated to: Rafał Miłecki
Headers show
Series [OpenWrt-Devel] samba36: log error if getting device info failed | expand

Commit Message

Rafał Miłecki Dec. 30, 2019, 6:54 a.m. UTC
From: Rafał Miłecki <rafal@milecki.pl>

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 package/network/services/samba36/Makefile            |  2 +-
 package/network/services/samba36/files/samba.hotplug | 12 +++++++++---
 2 files changed, 10 insertions(+), 4 deletions(-)

Comments

Adrian Schmutzler Dec. 30, 2019, 3:10 p.m. UTC | #1
Hi,

> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org]
> On Behalf Of Rafal Milecki
> Sent: Montag, 30. Dezember 2019 07:55
> To: openwrt-devel@lists.openwrt.org
> Cc: Rafał Miłecki <rafal@milecki.pl>
> Subject: [OpenWrt-Devel] [PATCH] samba36: log error if getting device info
> failed
> 

are you aware of https://github.com/openwrt/openwrt/pull/2368 or is this
just meant for backporting?

Best

Adrian
Rafał Miłecki March 21, 2020, 9:37 p.m. UTC | #2
On Mon, 30 Dec 2019 at 16:10, <mail@adrianschmutzler.de> wrote:
> > -----Original Message-----
> > From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org]
> > On Behalf Of Rafal Milecki
> > Sent: Montag, 30. Dezember 2019 07:55
> > To: openwrt-devel@lists.openwrt.org
> > Cc: Rafał Miłecki <rafal@milecki.pl>
> > Subject: [OpenWrt-Devel] [PATCH] samba36: log error if getting device info
> > failed
> >
>
> are you aware of https://github.com/openwrt/openwrt/pull/2368 or is this
> just meant for backporting?

Hey, I wasn't aware of that, thanks, FWIW I pushed my patch, let's see
how dropping samba36 goes on.
Rosen Penev March 21, 2020, 9:52 p.m. UTC | #3
On Sat, Mar 21, 2020 at 2:37 PM Rafał Miłecki <zajec5@gmail.com> wrote:
>
> On Mon, 30 Dec 2019 at 16:10, <mail@adrianschmutzler.de> wrote:
> > > -----Original Message-----
> > > From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org]
> > > On Behalf Of Rafal Milecki
> > > Sent: Montag, 30. Dezember 2019 07:55
> > > To: openwrt-devel@lists.openwrt.org
> > > Cc: Rafał Miłecki <rafal@milecki.pl>
> > > Subject: [OpenWrt-Devel] [PATCH] samba36: log error if getting device info
> > > failed
> > >
> >
> > are you aware of https://github.com/openwrt/openwrt/pull/2368 or is this
> > just meant for backporting?
>
> Hey, I wasn't aware of that, thanks, FWIW I pushed my patch, let's see
> how dropping samba36 goes on.
I first need to rebase that patch.

ksmbd also needs to be updated as several SMBv1 bugs were fixed
(nobody should be using v1 but it's still used).
>
> --
> Rafał
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
diff mbox series

Patch

diff --git a/package/network/services/samba36/Makefile b/package/network/services/samba36/Makefile
index a4392f62c5..161f6b45aa 100644
--- a/package/network/services/samba36/Makefile
+++ b/package/network/services/samba36/Makefile
@@ -9,7 +9,7 @@  include $(TOPDIR)/rules.mk
 
 PKG_NAME:=samba
 PKG_VERSION:=3.6.25
-PKG_RELEASE:=14
+PKG_RELEASE:=15
 
 PKG_SOURCE_URL:=https://download.samba.org/pub/samba \
 		https://download.samba.org/pub/samba/stable
diff --git a/package/network/services/samba36/files/samba.hotplug b/package/network/services/samba36/files/samba.hotplug
index e1ae64e655..abb4346af0 100644
--- a/package/network/services/samba36/files/samba.hotplug
+++ b/package/network/services/samba36/files/samba.hotplug
@@ -6,7 +6,7 @@  device_get_vars() {
 	json_init
 	json_load "$(ubus call block info)"
 
-	json_select devices
+	json_select devices || return 1
 
 	json_get_keys keys
 	for key in $keys
@@ -18,13 +18,16 @@  device_get_vars() {
 			shift
 			json_get_vars $@
 			json_select ..
-			break
+			json_select ..
+			return 0
 		}
 
 		json_select ..
 	done
 
 	json_select ..
+
+	return 2
 }
 
 [ -f /var/run/config/samba ] || {
@@ -32,7 +35,10 @@  device_get_vars() {
 }
 
 [ "$ACTION" = "add" ] && {
-	device_get_vars $DEVICE label mount
+	device_get_vars $DEVICE label mount || {
+		logger -t samba-hotplug "Failed to get $DEVICE info"
+		exit 1
+	}
 	[ -n "$mount" ] && {
 		uci -c /var/run/config batch <<-EOF
 			set samba.$DEVICE="sambashare"