[Pkg-samba-maint] [Git][samba-team/samba][master] 5 commits: d/rules: for test build copy, omit debian/ too

Michael Tokarev (@mjt) gitlab at salsa.debian.org
Tue Apr 26 21:46:56 BST 2022



Michael Tokarev pushed to branch master at Debian Samba Team / samba


Commits:
67bbb6f2 by Michael Tokarev at 2022-04-24T22:51:13+03:00
d/rules: for test build copy, omit debian/ too

- - - - -
cf7011c4 by Michael Tokarev at 2022-04-26T16:29:12+03:00
move-msg.sock-from-var-lib-samba-to-run-samba.patch

- - - - -
bf56d10b by Michael Tokarev at 2022-04-26T16:29:12+03:00
debian/samba.postinst: remove the now-unused /var/lib/samba/private/msg.sock/ (moved to /run/samba/)

- - - - -
19b745c1 by Michael Tokarev at 2022-04-26T16:29:12+03:00
testparm-do-not-fail-if-pid-dir-does-not-exist.patch

- - - - -
a98095a8 by Michael Tokarev at 2022-04-26T17:22:20+03:00
stop pre-creating /run/samba directory

It is not needed anymore once testparam is fixed.
Daemons create it on demand.

- - - - -


6 changed files:

- + debian/patches/move-msg.sock-from-var-lib-samba-to-run-samba.patch
- debian/patches/series
- + debian/patches/testparm-do-not-fail-if-pid-dir-does-not-exist.patch
- debian/rules
- debian/samba-common-bin.install
- debian/samba.postinst


Changes:

=====================================
debian/patches/move-msg.sock-from-var-lib-samba-to-run-samba.patch
=====================================
@@ -0,0 +1,55 @@
+From: Michael Tokarev <mjt at tls.msk.ru>
+Date: Tue, 26 Apr 2022 16:11:48 +0300
+Subject: move msg.sock from /var/lib/samba to /run/samba
+
+This moves a socket directory from /var/lib/samba to /run/samba.
+
+https://lists.samba.org/archive/samba-technical/2022-April/137322.html
+
+diff --git a/source3/lib/messages.c b/source3/lib/messages.c
+index 8641a9dad56..bf866e65e44 100644
+--- a/source3/lib/messages.c
++++ b/source3/lib/messages.c
+@@ -461,11 +461,6 @@ static int messaging_context_destructor(struct messaging_context *ctx)
+ 	return 0;
+ }
+ 
+-static const char *private_path(const char *name)
+-{
+-	return talloc_asprintf(talloc_tos(), "%s/%s", lp_private_dir(), name);
+-}
+-
+ static NTSTATUS messaging_init_internal(TALLOC_CTX *mem_ctx,
+ 					struct tevent_context *ev,
+ 					struct messaging_context **pmsg_ctx)
+@@ -500,7 +495,7 @@ static NTSTATUS messaging_init_internal(TALLOC_CTX *mem_ctx,
+ 		return NT_STATUS_ACCESS_DENIED;
+ 	}
+ 
+-	priv_path = private_path("msg.sock");
++	priv_path = lock_path(talloc_tos(), "msg.sock");
+ 	if (priv_path == NULL) {
+ 		return NT_STATUS_NO_MEMORY;
+ 	}
+@@ -663,7 +658,7 @@ NTSTATUS messaging_reinit(struct messaging_context *msg_ctx)
+ 		msg_ctx->per_process_talloc_ctx,
+ 		msg_ctx->event_ctx,
+ 		&msg_ctx->id.unique_id,
+-		private_path("msg.sock"),
++		lock_path(talloc_tos(), "msg.sock"),
+ 		lck_path,
+ 		messaging_recv_cb,
+ 		msg_ctx,
+diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c
+index a00c35be0d5..da641bc06aa 100644
+--- a/source4/lib/messaging/messaging.c
++++ b/source4/lib/messaging/messaging.c
+@@ -500,7 +500,7 @@ struct imessaging_context *imessaging_init(TALLOC_CTX *mem_ctx,
+ 		goto fail;
+ 	}
+ 
+-	msg->sock_dir = lpcfg_private_path(msg, lp_ctx, "msg.sock");
++	msg->sock_dir = lpcfg_lock_path(msg, lp_ctx, "msg.sock");
+ 	if (msg->sock_dir == NULL) {
+ 		goto fail;
+ 	}


=====================================
debian/patches/series
=====================================
@@ -16,3 +16,5 @@ waf-add-support-for-GNU-kFreeBSD.patch
 ctdb_etcd_lock-path.patch
 silence-waf-uselib_local.diff
 disable-setuid-confchecks.patch
+move-msg.sock-from-var-lib-samba-to-run-samba.patch
+testparm-do-not-fail-if-pid-dir-does-not-exist.patch


=====================================
debian/patches/testparm-do-not-fail-if-pid-dir-does-not-exist.patch
=====================================
@@ -0,0 +1,23 @@
+From: Michael Tokarev <mjt at tls.msk.ru>
+Date: Tue, 26 Apr 2022 16:14:38 +0300
+Subject: testparam: do not fail if /run/samba does not exist
+
+https://lists.samba.org/archive/samba-technical/2022-April/137320.html
+
+We now can remove the tempfiles creation of /run/samba
+
+diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c
+index 2d717f19756..6d6e462d084 100644
+--- a/source3/utils/testparm.c
++++ b/source3/utils/testparm.c
+@@ -283,9 +283,8 @@ static int do_global_checks(void)
+ 	}
+ 
+ 	if (!directory_exist_stat(lp_pid_directory(), &st)) {
+-		fprintf(stderr, "ERROR: pid directory %s does not exist\n\n",
++		fprintf(stderr, "WARNING: pid directory %s does not exist\n\n",
+ 		       lp_pid_directory());
+-		ret = 1;
+ 	}
+ 
+ 	if (lp_passdb_expand_explicit()) {


=====================================
debian/rules
=====================================
@@ -145,7 +145,7 @@ build: build-arch build-indep
 
 testbuild/copied.stamp:
 	rm -rf testbuild; mkdir testbuild
-	cp -a -l $$(ls -1 | egrep -v '^(bin|testbuild)$$') testbuild/
+	cp -a -l $$(ls -1 | egrep -v '^(bin|testbuild|debian)$$') testbuild/
 # cleanup some files just in case, do not interfere with production build
 	find testbuild -name __pycache__ -exec rm -rf {} +
 	rm -f testbuild/compile_commands.json
@@ -213,7 +213,6 @@ endif
 	# Harmless on systems without systemd-tmpfiles, and other consumers exist
 	# such as OpenRC's opentmpfiles
 	mkdir -p debian/tmp/usr/lib/tmpfiles.d
-	echo "d /run/samba 0755 root root -" > debian/tmp/usr/lib/tmpfiles.d/samba.conf
 	echo "d /run/ctdb 0755 root root -" > debian/tmp/usr/lib/tmpfiles.d/ctdb.conf
 
 	# install-and-rename docs for ctdb (also arch-specific)


=====================================
debian/samba-common-bin.install
=====================================
@@ -5,7 +5,6 @@ usr/bin/samba-regedit
 usr/bin/samba-tool
 usr/bin/smbpasswd
 usr/bin/testparm
-usr/lib/tmpfiles.d/samba.conf
 usr/sbin/samba_kcc
 usr/share/apport/package-hooks/source_samba.py
 usr/share/man/man1/dbwrap_tool.1


=====================================
debian/samba.postinst
=====================================
@@ -91,4 +91,13 @@ fi
 
 #DEBHELPER#
 
+# remove msg.sock/ directory (moved to /run/samba/)
+dir=/var/lib/samba/private/msg.sock
+if [ -d $dir -a configure = "$1" ] &&
+   dpkg --compare-versions "$2" lt-nl 2:4.16.0+dfsg-7~
+then
+    rm -f $dir/*
+    rmdir $dir
+fi
+
 exit 0



View it on GitLab: https://salsa.debian.org/samba-team/samba/-/compare/c1f462a49c2c4b5224be55f4f8b4f0ea1ea7e0f3...a98095a81aef06aa4fb301918b3d0e46c71a29c0

-- 
View it on GitLab: https://salsa.debian.org/samba-team/samba/-/compare/c1f462a49c2c4b5224be55f4f8b4f0ea1ea7e0f3...a98095a81aef06aa4fb301918b3d0e46c71a29c0
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-samba-maint/attachments/20220426/5be1361f/attachment-0001.htm>


More information about the Pkg-samba-maint mailing list