s3:smbstatus: go to cmdline_messaging_context_free
commit0bc115f75704c9dbad86117fd40b023920f31986
authorJones Syue <jonessyue@qnap.com>
Wed, 11 Jan 2023 08:59:42 +0000 (11 16:59 +0800)
committerJule Anger <janger@samba.org>
Fri, 13 Jan 2023 11:56:59 +0000 (13 11:56 +0000)
treeee0f7308c1218a78498bb37c05b636c29d7bee7a
parent69f6517f93b59cdd447751b1ac9f293d1342655e
s3:smbstatus: go to cmdline_messaging_context_free

If the locking.tdb is not found,
(for example, fresh new installed samba server is not running yet)
smbstatus utility would exit earlier,
and lock files are left behind in the directory 'msg.sock' and 'msg.lock'.
Consider that a script to run smbstatus utility in a loop,
this might result in used space slowly growing-up on the underlying filesystem.
Since the samba server is not running yet,
there is no cleanupd daemon could delete these files to reclaim space.

Supposed to use 'ret = 0; goto done;' instead of exit(0),
this would go through the cmdline_messaging_context_free() which deletes
the lock files in the directory msg.sock and msg.lock before smbstatus
utility is exiting.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15282

Signed-off-by: Jones Syue <jonessyue@qnap.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Jan 11 17:08:10 UTC 2023 on sn-devel-184

(cherry picked from commit de5d31f452b2445bd92b1746efb05aa096716af8)

Autobuild-User(v4-17-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-17-test): Fri Jan 13 11:56:59 UTC 2023 on sn-devel-184
source3/utils/status.c