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)
committerJule Anger <janger@samba.org>
Tue, 19 Dec 2023 10:43:21 +0000 (10:43 +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

(cherry picked from commit d23d6145bf08c4765479951237e697c4b2b11aa2)

Autobuild-User(v4-19-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-19-test): Tue Dec 19 10:43:21 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 398208fb3fa77250b4eb931094d5c39cbcfab978..91bf1b9e447b66ade94cd9de3dcba192f5b8bf43 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 8bb6ee888036ddb8bc5e869d9b830d027ee04aac..02beb0a0c88eeffdec2de54bc66db0e30ed4f701 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 bf6797514e35dd50568db66de32ab7dcd3b38f1e..8eed81d8f2e9ef7481e05a33b0dafe8b8da31b93 100644 (file)
@@ -564,6 +564,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 1db1672685189fdafea95e2e0cfb0d4e3feb9458..49ad382f8c55d4640816decd3903ba463527e979 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 9e64fa62d0c2ddcb027ee3d744a9237f75a4b98a..394c58436ab89584b6cedffb92f2684ad2d23317 100644 (file)
@@ -2840,10 +2840,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 cde0e7bcd5933e1f6da5f218ba47d8f9768e1109..56cba5a88f73126f839e48a6400a2334212630ad 100644 (file)
@@ -1124,10 +1124,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 cdd6d4319cbde3d40c5989eba2d321ef53313511..04ba6778c1cbc7f04a04cb80fb0df3925aaeeb7e 100644 (file)
@@ -1438,9 +1438,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 5410da1b50f03ec89ce9a5dfcdc2c32df5d6694e..092fa4bf796fa5542714816d794032a5bdcbe3f7 100644 (file)
@@ -939,8 +939,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 8832b97ed02d8acf825e74e9ab218de3324b0f4d..e7abf1a24925a8794509be0391e2c91af3cf1333 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 e1ad646fae286970f35f4904171f358e62945b81..84314447533cd35cfa5cd487b4de51a2dd6b5dc6 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 ||