VERSION: move COPYRIGHT_STARTUP_MESSAGE as SAMBA_COPYRIGHT_STRING into version.h
authorStefan Metzmacher <metze@samba.org>
Thu, 14 Dec 2023 10:35:19 +0000 (11:35 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 15 Dec 2023 10:44:42 +0000 (10:44 +0000)
We also prodive a samba_copyright_string() helper similar to
samba_version_string().

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Dec 15 10:44:42 UTC 2023 on atb-devel-224

16 files changed:
VERSION
buildtools/wafsamba/samba_patterns.py
buildtools/wafsamba/samba_version.py
lib/param/param.h
lib/util/copyright.h [deleted file]
source3/include/includes.h
source3/include/proto.h
source3/lib/version.c
source3/nmbd/nmbd.c
source3/rpc_server/rpc_host.c
source3/rpc_server/rpc_worker.c
source3/smbd/server.c
source3/winbindd/winbindd.c
source3/wscript_build
source4/include/includes.h
source4/samba/server.c

diff --git a/VERSION b/VERSION
index f0170b01ce1fff4762a3425148cdb4c33bb2f884..620024528ad9036b5a8ea65a20dae4afc1804133 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -13,6 +13,8 @@
 #                                                      #
 ########################################################
 
+SAMBA_COPYRIGHT_STRING="Copyright Andrew Tridgell and the Samba Team 1992-2023"
+
 ########################################################
 # This are the main SAMBA version numbers              #
 #                                                      #
index a9c5fcc4b4cbbb2d87cb1806a91b5f05ee58123a..41296810e1313b7269aa3e83f50cfe6e8dd51be7 100644 (file)
@@ -15,7 +15,7 @@ def write_version_header(task):
     return 0
 
 
-def SAMBA_MKVERSION(bld, target, source='VERSION'):
+def SAMBA_MKVERSION(bld, target, source='VERSION buildtools/wafsamba/samba_version.py'):
     '''generate the version.h header for Samba'''
 
     # We only force waf to re-generate this file if we are installing,
index 54ae62f38bd346acfe73d8f3d18d45db3740de55..31103e0f8c4cd8819e67201ecb44aaa1021f59a9 100644 (file)
@@ -174,6 +174,7 @@ also accepted as dictionary entries here
 
     def __str__(self):
         string="/* Autogenerated by waf */\n" +\
+                "#define SAMBA_COPYRIGHT_STRING \"%s\"\n" % self.SAMBA_COPYRIGHT_STRING +\
                 "#define SAMBA_VERSION_MAJOR %u\n" % self.MAJOR +\
                 "#define SAMBA_VERSION_MINOR %u\n" % self.MINOR +\
                 "#define SAMBA_VERSION_RELEASE %u\n" % self.RELEASE
index 7ead57f6130a1075fc14354c3baf376d85a52649..aed48c1660cf81fe09e8410378796f0d176da31f 100644 (file)
@@ -276,6 +276,7 @@ int lpcfg_rpc_port_high(struct loadparm_context *lp_ctx);
 /* The following definitions come from lib/version.c  */
 
 const char *samba_version_string(void);
+const char *samba_copyright_string(void);
 
 
 #endif /* _PARAM_H */
diff --git a/lib/util/copyright.h b/lib/util/copyright.h
deleted file mode 100644 (file)
index a29f228..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-   Unix SMB/CIFS implementation.
-
-   Copyright (C) Björn Jacke 2023
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef __LIB_UTIL_COPYRIGHT_H__
-#define __LIB_UTIL_COPYRIGHT_H__
-
-/* logged when starting the various Samba daemons */
-#define COPYRIGHT_STARTUP_MESSAGE      "Copyright Andrew Tridgell and the Samba Team 1992-2023"
-
-#endif /* __LIB_UTIL_COPYRIGHT_H__ */
-
-
index 37d712084e4034e7950cf16a881f2af778a58262..1e7b79ba0a9b4ef9ba4bd4ec3fecc1b624b47362 100644 (file)
@@ -242,9 +242,6 @@ enum timestamp_set_resolution {
 typedef char fstring[FSTRING_LEN];
 #endif
 
-/* copyright define */
-#include "../lib/util/copyright.h"
-
 /* debug.h need to be included before samba_util.h for the macro SMB_ASSERT */
 #include "../lib/util/debug.h"
 
index 13152f7a10afdfa41c4ed2d20d9e2f6b8a28c7f7..3ed35054708b20433622dd307ac4492860fbf83a 100644 (file)
@@ -561,6 +561,7 @@ ssize_t full_path_tos(const char *dir, const char *name,
 /* The following definitions come from lib/version.c  */
 
 const char *samba_version_string(void);
+const char *samba_copyright_string(void);
 
 /* The following definitions come from lib/wins_srv.c  */
 
index e81f463586e296382be26b440c3fd8c7d35d6fc8..28fcd1b704bc5f87056a117ccc085ba0ec405ad8 100644 (file)
@@ -25,3 +25,8 @@ const char *samba_version_string(void)
 {
        return SAMBA_VERSION_STRING;
 }
+
+const char *samba_copyright_string(void)
+{
+       return SAMBA_COPYRIGHT_STRING;
+}
index 63a81a173261d310f253ee322486915e16fc99c3..4bdf4b255609f100fcf731787ed6d66d6dd3d2c9 100644 (file)
@@ -898,9 +898,9 @@ static bool open_sockets(bool isdaemon, int port)
 
        reopen_logs();
 
-       DBG_STARTUP_NOTICE("nmbd version %s started.\n"
-                       COPYRIGHT_STARTUP_MESSAGE "\n",
-               samba_version_string());
+       DBG_STARTUP_NOTICE("nmbd version %s started.\n%s\n",
+                          samba_version_string(),
+                          samba_copyright_string());
 
        if (lp_server_role() == ROLE_ACTIVE_DIRECTORY_DC
            && !lp_parm_bool(-1, "server role check", "inhibit", false)) {
index c3c4cb97e21689513fe4322087674002857e5e0d..1e891b4faaa386e7805b08c0f457de3c94a9bba7 100644 (file)
@@ -2902,10 +2902,10 @@ int main(int argc, const char *argv[])
 
        reopen_logs();
 
-       DBG_STARTUP_NOTICE("%s version %s started.\n"
-                       COPYRIGHT_STARTUP_MESSAGE "\n",
-                 progname,
-                 samba_version_string());
+       DBG_STARTUP_NOTICE("%s version %s started.\n%s\n",
+                          progname,
+                          samba_version_string(),
+                          samba_copyright_string());
 
        (void)winbind_off();
        ok = init_guest_session_info(frame);
index 691e0ec57f0b647efeef5679369f9cc68034e260..bf9671d3c156939328c2148776822e8d205c8e45 100644 (file)
@@ -1152,10 +1152,10 @@ int rpc_worker_main(
 
        reopen_logs();
 
-       DBG_STARTUP_NOTICE("%s version %s started.\n"
-                       COPYRIGHT_STARTUP_MESSAGE "\n",
-               progname,
-               samba_version_string());
+       DBG_STARTUP_NOTICE("%s version %s started.\n%s\n",
+                          progname,
+                          samba_version_string(),
+                          samba_copyright_string());
 
        msg_ctx = global_messaging_context();
        if (msg_ctx == NULL) {
index ddef5b6de168b3fa421b1fed30f64eaa7196f7fd..42abfa948e6bf2d8bc86b423620f3884956240e2 100644 (file)
@@ -1743,9 +1743,9 @@ extern void build_options(bool screen);
 
        reopen_logs();
 
-       DBG_STARTUP_NOTICE("smbd version %s started.\n"
-                       COPYRIGHT_STARTUP_MESSAGE "\n",
-               samba_version_string());
+       DBG_STARTUP_NOTICE("smbd version %s started.\n%s\n",
+                          samba_version_string(),
+                          samba_copyright_string());
 
        DEBUG(2,("uid=%d gid=%d euid=%d egid=%d\n",
                 (int)getuid(),(int)getgid(),(int)geteuid(),(int)getegid()));
index 608c77c291b028c0e618566f522ab4a65fa049cc..29a24a981c37b6146c3de3861cf2272f54cadd09 100644 (file)
@@ -1447,9 +1447,9 @@ int main(int argc, const char **argv)
 
        reopen_logs();
 
-       DBG_STARTUP_NOTICE("winbindd version %s started.\n"
-                       COPYRIGHT_STARTUP_MESSAGE "\n",
-               samba_version_string());
+       DBG_STARTUP_NOTICE("winbindd version %s started.\n%s\n",
+                          samba_version_string(),
+                          samba_copyright_string());
 
        /* After parsing the configuration file we setup the core path one more time
         * as the log file might have been set in the configuration and cores's
index d965da78c4c84afc263f75466511041d192c88ae..ff8de1eec0046116c71409126b206ef8692c84f0 100644 (file)
@@ -938,8 +938,7 @@ bld.SAMBA3_SUBSYSTEM('PASSCHANGE',
                          ''')
 
 bld.SAMBA3_SUBSYSTEM('SAMBA_VERSION',
-                    source='lib/version.c',
-                    deps='samba-util')
+                    source='lib/version.c')
 
 bld.SAMBA3_SUBSYSTEM('SLCACHE',
                     source='libsmb/samlogon_cache.c',
index f22483080dcc4b1b43e5b6c5ebf8d386cd742829..667f2b2e6a953317158ee2e78437209f1acff656 100644 (file)
@@ -57,9 +57,6 @@
 #endif
 #include "../lib/util/attr.h"
 
-/* copyright define */
-#include "../lib/util/copyright.h"
-
 /* debug.h need to be included before samba_util.h for the macro SMB_ASSERT */
 #include "../lib/util/debug.h"
 #include "../lib/util/samba_util.h"
index d2bd3a59708a7b145d11f3f7f0811e48dce662ac..011d9d086d897d39b847c9d7fd6dd2a8c83a9013 100644 (file)
@@ -630,10 +630,10 @@ static int binary_smbd_main(TALLOC_CTX *mem_ctx,
           so set our umask to 0 */
        umask(0);
 
-       DBG_STARTUP_NOTICE("%s version %s started.\n"
-                       COPYRIGHT_STARTUP_MESSAGE "\n",
-               binary_name,
-               SAMBA_VERSION_STRING);
+       DBG_STARTUP_NOTICE("%s version %s started.\n%s\n",
+                          binary_name,
+                          SAMBA_VERSION_STRING,
+                          SAMBA_COPYRIGHT_STRING);
 
        if (sizeof(uint16_t) < 2 ||
                        sizeof(uint32_t) < 4 ||