summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2022-11-29 17:53:36 +0000
committerRalf Habacker <ralf.habacker@freenet.de>2022-11-29 17:53:36 +0000
commit2f9d987c0a5dacbf647c4328737e0dda380048eb (patch)
treeca16b1303c4e9cdc0ed52e605541c854bffe5acb
parentb30c2c293d6c599adafca5b82cb7df6351ca2fa1 (diff)
parente3a365e7acb59d75f605fa90397a096a8423760f (diff)
downloaddbus-2f9d987c0a5dacbf647c4328737e0dda380048eb.tar.gz
Merge branch 'spdx' into 'master'
Add SPDX licensing information for the uncommon licenses (not AFL-2.1|GPL-2.0+ and not MIT) See merge request dbus/dbus!311
-rw-r--r--LICENSES/AFL-2.0.txt45
-rw-r--r--LICENSES/BSD-3-Clause.txt11
-rw-r--r--LICENSES/LicenseRef-CMakeScripts.txt (renamed from cmake/modules/COPYING-CMAKE-SCRIPTS)3
-rw-r--r--LICENSES/LicenseRef-GAP.txt7
-rw-r--r--LICENSES/LicenseRef-pycrypto-orig.txt3
-rw-r--r--LICENSES/TCL.txt9
-rw-r--r--Makefile.am6
-rw-r--r--cmake/modules/FindDocBookXSL.cmake1
-rw-r--r--cmake/modules/FindGLIB2.cmake3
-rw-r--r--cmake/modules/Win32Macros.cmake1
-rw-r--r--dbus/CMakeLists.txt1
-rw-r--r--dbus/Makefile.am1
-rw-r--r--dbus/dbus-arch-deps.h.in1
-rw-r--r--dbus/dbus-backtrace-win.c213
-rw-r--r--dbus/dbus-hash.c1
-rw-r--r--dbus/dbus-sha.c1
-rw-r--r--dbus/dbus-sysdeps-win.c204
-rw-r--r--dbus/meson.build1
-rw-r--r--dbus/versioninfo.rc.in1
-rw-r--r--doc/dbus-test-tool.1.xml.in3
-rw-r--r--test/internals/hash.c1
-rwxr-xr-xtools/cmake-format5
-rw-r--r--tools/dbus-cleanup-sockets.c1
-rw-r--r--tools/dbus-echo.c1
-rw-r--r--tools/dbus-monitor.c1
-rw-r--r--tools/dbus-print-message.c1
-rw-r--r--tools/dbus-print-message.h1
-rw-r--r--tools/dbus-send.c1
-rw-r--r--tools/dbus-spam.c1
-rw-r--r--tools/dbus-uuidgen.c1
-rw-r--r--tools/test-tool.c1
-rw-r--r--tools/test-tool.h1
-rw-r--r--tools/tool-common.c1
-rw-r--r--tools/tool-common.h1
34 files changed, 325 insertions, 209 deletions
diff --git a/LICENSES/AFL-2.0.txt b/LICENSES/AFL-2.0.txt
new file mode 100644
index 00000000..f3bd601b
--- /dev/null
+++ b/LICENSES/AFL-2.0.txt
@@ -0,0 +1,45 @@
+The Academic Free License
+v. 2.0
+
+This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following notice immediately following the copyright notice for the Original Work:
+
+ Licensed under the Academic Free License version 2.0
+
+1) Grant of Copyright License. Licensor hereby grants You a world-wide, royalty-free, non-exclusive, perpetual, sublicenseable license to do the following:
+
+ a) to reproduce the Original Work in copies;
+ b) to prepare derivative works ("Derivative Works") based upon the Original Work;
+ c) to distribute copies of the Original Work and Derivative Works to the public;
+ d) to perform the Original Work publicly; and
+ e) to display the Original Work publicly.
+
+2) Grant of Patent License. Licensor hereby grants You a world-wide, royalty-free, non-exclusive, perpetual, sublicenseable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, to make, use, sell and offer for sale the Original Work and Derivative Works.
+
+3) Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor hereby agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work, and by publishing the address of that information repository in a notice immediately following the copyright notice that applies to the Original Work.
+
+4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior written permission of the Licensor. Nothing in this License shall be deemed to grant any rights to trademarks, copyrights, patents, trade secrets or any other intellectual property of Licensor except as expressly stated herein. No patent license is granted to make, use, sell or offer to sell embodiments of any patent claims other than the licensed claims defined in Section 2. No right is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under different terms from this License any Original Work that Licensor otherwise would have a right to license.
+
+5) This section intentionally omitted.
+
+6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
+
+7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately proceeding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to Original Work is granted hereunder except under this disclaimer.
+
+8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to any person for any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to liability for death or personal injury resulting from Licensor's negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You.
+
+9) Acceptance and Termination. If You distribute copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. Nothing else but this License (or another written agreement between Licensor and You) grants You permission to create Derivative Works based upon the Original Work or to exercise any of the rights granted in Section 1 herein, and any attempt to do so except under the terms of this License (or another written agreement between Licensor and You) is expressly prohibited by U.S. copyright law, the equivalent laws of other countries, and by international treaty. Therefore, by exercising any of the rights granted to You in Section 1 herein, You indicate Your acceptance of this License and all of its terms and conditions.
+
+10) Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, for patent infringement (i) against Licensor with respect to a patent applicable to software or (ii) against any entity with respect to a patent applicable to the Original Work (but excluding combinations of the Original Work with other software or hardware).
+
+11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of the U.S. Copyright Act, 17 U.S.C. ¤ 101 et seq., the equivalent laws of other countries, and international treaty. This section shall survive the termination of this License.
+
+12) Attorneys Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
+
+13) Miscellaneous. This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
+
+14) Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+15) Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
+
+This license is Copyright (C) 2003 Lawrence E. Rosen. All rights reserved.
+Permission is hereby granted to copy and distribute this license without modification. This license may not be modified without the express written permission of its copyright owner.
diff --git a/LICENSES/BSD-3-Clause.txt b/LICENSES/BSD-3-Clause.txt
new file mode 100644
index 00000000..ea890afb
--- /dev/null
+++ b/LICENSES/BSD-3-Clause.txt
@@ -0,0 +1,11 @@
+Copyright (c) <year> <owner>.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/cmake/modules/COPYING-CMAKE-SCRIPTS b/LICENSES/LicenseRef-CMakeScripts.txt
index 53b6b71e..d039066d 100644
--- a/cmake/modules/COPYING-CMAKE-SCRIPTS
+++ b/LICENSES/LicenseRef-CMakeScripts.txt
@@ -20,3 +20,6 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+(This is a variation of the BSD-3-Clause license, with slightly different
+wording.)
diff --git a/LICENSES/LicenseRef-GAP.txt b/LICENSES/LicenseRef-GAP.txt
new file mode 100644
index 00000000..8007ecd5
--- /dev/null
+++ b/LICENSES/LicenseRef-GAP.txt
@@ -0,0 +1,7 @@
+This file is free software; as a special exception the author gives
+unlimited permission to copy and/or distribute it, with or without
+modifications, as long as this notice is preserved.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/LICENSES/LicenseRef-pycrypto-orig.txt b/LICENSES/LicenseRef-pycrypto-orig.txt
new file mode 100644
index 00000000..cb143211
--- /dev/null
+++ b/LICENSES/LicenseRef-pycrypto-orig.txt
@@ -0,0 +1,3 @@
+Distribute and use freely; there are no restrictions on further
+dissemination and usage except those imposed by the laws of your
+country of residence.
diff --git a/LICENSES/TCL.txt b/LICENSES/TCL.txt
new file mode 100644
index 00000000..4b9cdb48
--- /dev/null
+++ b/LICENSES/TCL.txt
@@ -0,0 +1,9 @@
+This software is copyrighted by the Regents of the University of California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState Corporation and other parties. The following terms apply to all files associated with the software unless explicitly disclaimed in individual files.
+
+The authors hereby grant permission to use, copy, modify, distribute, and license this software and its documentation for any purpose, provided that existing copyright notices are retained in all copies and that this notice is included verbatim in any distributions. No written agreement, license, or royalty fee is required for any of the authorized uses. Modifications to this software may be copyrighted by their authors and need not follow the licensing terms described here, provided that the new terms are clearly indicated on the first page of each file where they apply.
+
+IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+GOVERNMENT USE: If you are acquiring this software on behalf of the U.S. government, the Government shall have only "Restricted Rights" in the software and related documentation as defined in the Federal Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you are acquiring the software on behalf of the Department of Defense, the software shall be classified as "Commercial Computer Software" and the Government shall have only "Restricted Rights" as defined in Clause 252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the authors grant the U.S. Government and others acting in its behalf permission to use and distribute the software in accordance with the terms specified in this license.
diff --git a/Makefile.am b/Makefile.am
index 81f3c91e..f905fc7e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,10 +12,16 @@ EXTRA_DIST = \
CONTRIBUTING.md \
dbus-1.pc.in \
cleanup-man-pages.sh \
+ LICENSES/AFL-2.0.txt \
LICENSES/AFL-2.1.txt \
LICENSES/Apache-2.0.txt \
+ LICENSES/BSD-3-Clause.txt \
LICENSES/GPL-2.0-or-later.txt \
+ LICENSES/LicenseRef-CMakeScripts.txt \
+ LICENSES/LicenseRef-GAP.txt \
+ LICENSES/LicenseRef-pycrypto-orig.txt \
LICENSES/MIT.txt \
+ LICENSES/TCL.txt \
NEWS.pre-1-0 \
NEWS.pre-1-2 \
README.cmake \
diff --git a/cmake/modules/FindDocBookXSL.cmake b/cmake/modules/FindDocBookXSL.cmake
index 3d9e40c4..edb10c4e 100644
--- a/cmake/modules/FindDocBookXSL.cmake
+++ b/cmake/modules/FindDocBookXSL.cmake
@@ -6,6 +6,7 @@
# used to process DocBook XML
# Copyright (c) 2010, Luigi Toscano, <luigi.toscano@tiscali.it>
+# SPDX-License-Identifier: BSD-3-Clause
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
diff --git a/cmake/modules/FindGLIB2.cmake b/cmake/modules/FindGLIB2.cmake
index 0cadba5e..97d2bf21 100644
--- a/cmake/modules/FindGLIB2.cmake
+++ b/cmake/modules/FindGLIB2.cmake
@@ -7,9 +7,10 @@
# Copyright (c) 2008 Laurent Montel, <montel@kde.org>
# Copyright (c) 2013 Ralf Habacker, <ralf.habacker@freenet.de>
+# SPDX-License-Identifier: LicenseRef-CMakeScripts.txt
#
# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+# For details see LICENSES/LicenseRef-CMakeScripts.txt.
if(GLIB2_INCLUDE_DIR AND GLIB2_LIBRARIES)
diff --git a/cmake/modules/Win32Macros.cmake b/cmake/modules/Win32Macros.cmake
index c5054c67..4df8df51 100644
--- a/cmake/modules/Win32Macros.cmake
+++ b/cmake/modules/Win32Macros.cmake
@@ -2,6 +2,7 @@
# win32 macros
#
# Copyright (c) 2006-2007, Ralf Habacker
+# SPDX-License-Identifier: BSD-3-Clause
#
# Redistribution and use is allowed according to the terms of the BSD license.
#
diff --git a/dbus/CMakeLists.txt b/dbus/CMakeLists.txt
index 42442cce..cc192ef8 100644
--- a/dbus/CMakeLists.txt
+++ b/dbus/CMakeLists.txt
@@ -177,6 +177,7 @@ set(DBUS_UTIL_HEADERS
### platform specific settings
if(WIN32)
set(DBUS_SHARED_SOURCES ${DBUS_SHARED_SOURCES}
+ dbus-backtrace-win.c
dbus-file-win.c
dbus-init-win.cpp
dbus-sysdeps-win.c
diff --git a/dbus/Makefile.am b/dbus/Makefile.am
index 4c6633f3..fa628ded 100644
--- a/dbus/Makefile.am
+++ b/dbus/Makefile.am
@@ -75,6 +75,7 @@ endif
DBUS_SHARED_arch_sources = \
$(wince_source) \
+ dbus-backtrace-win.c \
dbus-file-win.c \
dbus-pipe-win.c \
dbus-sockets-win.h \
diff --git a/dbus/dbus-arch-deps.h.in b/dbus/dbus-arch-deps.h.in
index 7b6328bc..9dcb83cd 100644
--- a/dbus/dbus-arch-deps.h.in
+++ b/dbus/dbus-arch-deps.h.in
@@ -2,6 +2,7 @@
/* dbus-arch-deps.h Header with architecture/compiler specific information, installed to libdir
*
* Copyright (C) 2003 Red Hat, Inc.
+ * SPDX-License-Identifier: AFL-2.0 OR GPL-2.0-or-later
*
* Licensed under the Academic Free License version 2.0
*
diff --git a/dbus/dbus-backtrace-win.c b/dbus/dbus-backtrace-win.c
new file mode 100644
index 00000000..d9bc2dc4
--- /dev/null
+++ b/dbus/dbus-backtrace-win.c
@@ -0,0 +1,213 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/* dbus-backtrace-win.c Backtrace Generator
+ *
+ * Copyright 2004 Eric Poech
+ * Copyright 2004 Robert Shearman
+ * Copyright 2010 Patrick von Reth <patrick.vonreth@gmail.com>
+ * Copyright 2015 Ralf Habacker <ralf.habacker@freenet.de>
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <config.h>
+
+#include "dbus-internals.h"
+#include "dbus-sysdeps.h"
+
+#if !defined (DBUS_DISABLE_ASSERT) || defined(DBUS_ENABLE_EMBEDDED_TESTS)
+
+#if defined(_MSC_VER) || defined(DBUS_WINCE)
+# ifdef BACKTRACES
+# undef BACKTRACES
+# endif
+#else
+# define BACKTRACES
+#endif
+
+#ifdef BACKTRACES
+#include "dbus-sysdeps-win.h"
+
+#include <stdio.h>
+#include <windows.h>
+#include <imagehlp.h>
+
+#define DPRINTF(fmt, ...) fprintf (stderr, fmt, ##__VA_ARGS__)
+
+#ifdef _MSC_VER
+#define BOOL int
+
+#define __i386__
+#endif
+
+static void dump_backtrace_for_thread (HANDLE hThread)
+{
+ ADDRESS old_address;
+ STACKFRAME sf;
+ CONTEXT context;
+ DWORD dwImageType;
+ int i = 0;
+
+ SymSetOptions (SYMOPT_UNDNAME | SYMOPT_LOAD_LINES);
+ SymInitialize (GetCurrentProcess (), NULL, TRUE);
+
+
+ /* can't use this function for current thread as GetThreadContext
+ * doesn't support getting context from current thread */
+ if (hThread == GetCurrentThread())
+ return;
+
+ DPRINTF ("Backtrace:\n");
+
+ _DBUS_ZERO (old_address);
+ _DBUS_ZERO (context);
+ context.ContextFlags = CONTEXT_FULL;
+
+ SuspendThread (hThread);
+
+ if (!GetThreadContext (hThread, &context))
+ {
+ DPRINTF ("Couldn't get thread context (error %ld)\n", GetLastError ());
+ ResumeThread (hThread);
+ return;
+ }
+
+ _DBUS_ZERO (sf);
+
+#ifdef __i386__
+ dwImageType = IMAGE_FILE_MACHINE_I386;
+ sf.AddrFrame.Offset = context.Ebp;
+ sf.AddrFrame.Mode = AddrModeFlat;
+ sf.AddrPC.Offset = context.Eip;
+ sf.AddrPC.Mode = AddrModeFlat;
+#elif defined(_M_X64)
+ dwImageType = IMAGE_FILE_MACHINE_AMD64;
+ sf.AddrPC.Offset = context.Rip;
+ sf.AddrPC.Mode = AddrModeFlat;
+ sf.AddrFrame.Offset = context.Rsp;
+ sf.AddrFrame.Mode = AddrModeFlat;
+ sf.AddrStack.Offset = context.Rsp;
+ sf.AddrStack.Mode = AddrModeFlat;
+#elif defined(_M_IA64)
+ dwImageType = IMAGE_FILE_MACHINE_IA64;
+ sf.AddrPC.Offset = context.StIIP;
+ sf.AddrPC.Mode = AddrModeFlat;
+ sf.AddrFrame.Offset = context.IntSp;
+ sf.AddrFrame.Mode = AddrModeFlat;
+ sf.AddrBStore.Offset= context.RsBSP;
+ sf.AddrBStore.Mode = AddrModeFlat;
+ sf.AddrStack.Offset = context.IntSp;
+ sf.AddrStack.Mode = AddrModeFlat;
+#else
+# error You need to fill in the STACKFRAME structure for your architecture
+#endif
+
+ /*
+ backtrace format
+ <level> <address> <symbol>[+offset] [ '[' <file> ':' <line> ']' ] [ 'in' <module> ]
+ example:
+ 6 0xf75ade6b wine_switch_to_stack+0x2a [/usr/src/debug/wine-snapshot/libs/wine/port.c:59] in libwine.so.1
+ */
+ while (StackWalk (dwImageType, GetCurrentProcess (),
+ hThread, &sf, &context, NULL, SymFunctionTableAccess,
+ SymGetModuleBase, NULL))
+ {
+ char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(char)];
+ PSYMBOL_INFO pSymbol = (PSYMBOL_INFO)buffer;
+ DWORD64 displacement;
+ IMAGEHLP_LINE line;
+ DWORD dwDisplacement;
+ IMAGEHLP_MODULE moduleInfo;
+
+ /*
+ on Wine64 version 1.7.54, we get an infinite number of stack entries
+ pointing to the same stack frame (_start+0x29 in <wine-loader>)
+ see bug https://bugs.winehq.org/show_bug.cgi?id=39606
+ */
+#ifndef __i386__
+ if (old_address.Offset == sf.AddrPC.Offset)
+ {
+ break;
+ }
+#endif
+
+ pSymbol->SizeOfStruct = sizeof(SYMBOL_INFO);
+ pSymbol->MaxNameLen = MAX_SYM_NAME;
+
+ if (SymFromAddr (GetCurrentProcess (), sf.AddrPC.Offset, &displacement, pSymbol))
+ {
+ if (displacement)
+ DPRINTF ("%3d %s+0x%I64x", i++, pSymbol->Name, displacement);
+ else
+ DPRINTF ("%3d %s", i++, pSymbol->Name);
+ }
+ else
+ DPRINTF ("%3d 0x%Ix", i++, sf.AddrPC.Offset);
+
+ line.SizeOfStruct = sizeof(IMAGEHLP_LINE);
+ if (SymGetLineFromAddr (GetCurrentProcess (), sf.AddrPC.Offset, &dwDisplacement, &line))
+ {
+ DPRINTF (" [%s:%ld]", line.FileName, line.LineNumber);
+ }
+
+ moduleInfo.SizeOfStruct = sizeof(moduleInfo);
+ if (SymGetModuleInfo (GetCurrentProcess (), sf.AddrPC.Offset, &moduleInfo))
+ {
+ DPRINTF (" in %s", moduleInfo.ModuleName);
+ }
+ DPRINTF ("\n");
+ old_address = sf.AddrPC;
+ }
+ ResumeThread (hThread);
+}
+
+static DWORD WINAPI dump_thread_proc (LPVOID lpParameter)
+{
+ dump_backtrace_for_thread ((HANDLE) lpParameter);
+ return 0;
+}
+
+/* cannot get valid context from current thread, so we have to execute
+ * backtrace from another thread */
+static void
+dump_backtrace (void)
+{
+ HANDLE hCurrentThread;
+ HANDLE hThread;
+ DWORD dwThreadId;
+ DuplicateHandle (GetCurrentProcess (), GetCurrentThread (),
+ GetCurrentProcess (), &hCurrentThread,
+ 0, FALSE, DUPLICATE_SAME_ACCESS);
+ hThread = CreateThread (NULL, 0, dump_thread_proc, (LPVOID)hCurrentThread,
+ 0, &dwThreadId);
+ WaitForSingleObject (hThread, INFINITE);
+ CloseHandle (hThread);
+ CloseHandle (hCurrentThread);
+}
+#endif
+#endif /* asserts or tests enabled */
+
+#ifdef BACKTRACES
+void _dbus_print_backtrace (void)
+{
+ dump_backtrace ();
+}
+#else
+void _dbus_print_backtrace (void)
+{
+ _dbus_verbose (" D-Bus not compiled with backtrace support\n");
+}
+#endif
diff --git a/dbus/dbus-hash.c b/dbus/dbus-hash.c
index f04b0d11..2635a154 100644
--- a/dbus/dbus-hash.c
+++ b/dbus/dbus-hash.c
@@ -9,6 +9,7 @@
* Copyright 2010 Fridrich Štrba
* Copyright 2016 Ralf Habacker
* Copyright 2017 Endless Mobile, Inc.
+ * SPDX-License-Identifier: (AFL-2.1 OR GPL-2.0-or-later) AND TCL
*
* Hash table implementation based on generic/tclHash.c from the Tcl
* source code. The original Tcl license applies to portions of the
diff --git a/dbus/dbus-sha.c b/dbus/dbus-sha.c
index 6ff2f077..effce82c 100644
--- a/dbus/dbus-sha.c
+++ b/dbus/dbus-sha.c
@@ -3,6 +3,7 @@
*
* Copyright (C) 2003 Red Hat Inc.
* Copyright (C) 1995 A. M. Kuchling
+ * SPDX-License-Identifier: (AFL-2.1 OR GPL-2.0-or-later) AND LicenseRef-pycrypto-orig
*
* Licensed under the Academic Free License version 2.1
*
diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c
index df4a4ce3..3e6bdfd6 100644
--- a/dbus/dbus-sysdeps-win.c
+++ b/dbus/dbus-sysdeps-win.c
@@ -23,7 +23,6 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
*/
#include <config.h>
@@ -2663,209 +2662,6 @@ _dbus_delete_file (const DBusString *filename,
return TRUE;
}
-#if !defined (DBUS_DISABLE_ASSERT) || defined(DBUS_ENABLE_EMBEDDED_TESTS)
-
-#if defined(_MSC_VER) || defined(DBUS_WINCE)
-# ifdef BACKTRACES
-# undef BACKTRACES
-# endif
-#else
-# define BACKTRACES
-#endif
-
-#ifdef BACKTRACES
-/*
- * Backtrace Generator
- *
- * Copyright 2004 Eric Poech
- * Copyright 2004 Robert Shearman
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <winver.h>
-#include <imagehlp.h>
-#include <stdio.h>
-
-#define DPRINTF(fmt, ...) fprintf (stderr, fmt, ##__VA_ARGS__)
-
-#ifdef _MSC_VER
-#define BOOL int
-
-#define __i386__
-#endif
-
-static void dump_backtrace_for_thread (HANDLE hThread)
-{
- ADDRESS old_address;
- STACKFRAME sf;
- CONTEXT context;
- DWORD dwImageType;
- int i = 0;
-
- SymSetOptions (SYMOPT_UNDNAME | SYMOPT_LOAD_LINES);
- SymInitialize (GetCurrentProcess (), NULL, TRUE);
-
-
- /* can't use this function for current thread as GetThreadContext
- * doesn't support getting context from current thread */
- if (hThread == GetCurrentThread())
- return;
-
- DPRINTF ("Backtrace:\n");
-
- _DBUS_ZERO (old_address);
- _DBUS_ZERO (context);
- context.ContextFlags = CONTEXT_FULL;
-
- SuspendThread (hThread);
-
- if (!GetThreadContext (hThread, &context))
- {
- DPRINTF ("Couldn't get thread context (error %ld)\n", GetLastError ());
- ResumeThread (hThread);
- return;
- }
-
- _DBUS_ZERO (sf);
-
-#ifdef __i386__
- dwImageType = IMAGE_FILE_MACHINE_I386;
- sf.AddrFrame.Offset = context.Ebp;
- sf.AddrFrame.Mode = AddrModeFlat;
- sf.AddrPC.Offset = context.Eip;
- sf.AddrPC.Mode = AddrModeFlat;
-#elif defined(_M_X64)
- dwImageType = IMAGE_FILE_MACHINE_AMD64;
- sf.AddrPC.Offset = context.Rip;
- sf.AddrPC.Mode = AddrModeFlat;
- sf.AddrFrame.Offset = context.Rsp;
- sf.AddrFrame.Mode = AddrModeFlat;
- sf.AddrStack.Offset = context.Rsp;
- sf.AddrStack.Mode = AddrModeFlat;
-#elif defined(_M_IA64)
- dwImageType = IMAGE_FILE_MACHINE_IA64;
- sf.AddrPC.Offset = context.StIIP;
- sf.AddrPC.Mode = AddrModeFlat;
- sf.AddrFrame.Offset = context.IntSp;
- sf.AddrFrame.Mode = AddrModeFlat;
- sf.AddrBStore.Offset= context.RsBSP;
- sf.AddrBStore.Mode = AddrModeFlat;
- sf.AddrStack.Offset = context.IntSp;
- sf.AddrStack.Mode = AddrModeFlat;
-#else
-# error You need to fill in the STACKFRAME structure for your architecture
-#endif
-
- /*
- backtrace format
- <level> <address> <symbol>[+offset] [ '[' <file> ':' <line> ']' ] [ 'in' <module> ]
- example:
- 6 0xf75ade6b wine_switch_to_stack+0x2a [/usr/src/debug/wine-snapshot/libs/wine/port.c:59] in libwine.so.1
- */
- while (StackWalk (dwImageType, GetCurrentProcess (),
- hThread, &sf, &context, NULL, SymFunctionTableAccess,
- SymGetModuleBase, NULL))
- {
- char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(char)];
- PSYMBOL_INFO pSymbol = (PSYMBOL_INFO)buffer;
- DWORD64 displacement;
- IMAGEHLP_LINE line;
- DWORD dwDisplacement;
- IMAGEHLP_MODULE moduleInfo;
-
- /*
- on Wine64 version 1.7.54, we get an infinite number of stack entries
- pointing to the same stack frame (_start+0x29 in <wine-loader>)
- see bug https://bugs.winehq.org/show_bug.cgi?id=39606
- */
-#ifndef __i386__
- if (old_address.Offset == sf.AddrPC.Offset)
- {
- break;
- }
-#endif
-
- pSymbol->SizeOfStruct = sizeof(SYMBOL_INFO);
- pSymbol->MaxNameLen = MAX_SYM_NAME;
-
- if (SymFromAddr (GetCurrentProcess (), sf.AddrPC.Offset, &displacement, pSymbol))
- {
- if (displacement)
- DPRINTF ("%3d %s+0x%I64x", i++, pSymbol->Name, displacement);
- else
- DPRINTF ("%3d %s", i++, pSymbol->Name);
- }
- else
- DPRINTF ("%3d 0x%Ix", i++, sf.AddrPC.Offset);
-
- line.SizeOfStruct = sizeof(IMAGEHLP_LINE);
- if (SymGetLineFromAddr (GetCurrentProcess (), sf.AddrPC.Offset, &dwDisplacement, &line))
- {
- DPRINTF (" [%s:%ld]", line.FileName, line.LineNumber);
- }
-
- moduleInfo.SizeOfStruct = sizeof(moduleInfo);
- if (SymGetModuleInfo (GetCurrentProcess (), sf.AddrPC.Offset, &moduleInfo))
- {
- DPRINTF (" in %s", moduleInfo.ModuleName);
- }
- DPRINTF ("\n");
- old_address = sf.AddrPC;
- }
- ResumeThread (hThread);
-}
-
-static DWORD WINAPI dump_thread_proc (LPVOID lpParameter)
-{
- dump_backtrace_for_thread ((HANDLE) lpParameter);
- return 0;
-}
-
-/* cannot get valid context from current thread, so we have to execute
- * backtrace from another thread */
-static void
-dump_backtrace (void)
-{
- HANDLE hCurrentThread;
- HANDLE hThread;
- DWORD dwThreadId;
- DuplicateHandle (GetCurrentProcess (), GetCurrentThread (),
- GetCurrentProcess (), &hCurrentThread,
- 0, FALSE, DUPLICATE_SAME_ACCESS);
- hThread = CreateThread (NULL, 0, dump_thread_proc, (LPVOID)hCurrentThread,
- 0, &dwThreadId);
- WaitForSingleObject (hThread, INFINITE);
- CloseHandle (hThread);
- CloseHandle (hCurrentThread);
-}
-#endif
-#endif /* asserts or tests enabled */
-
-#ifdef BACKTRACES
-void _dbus_print_backtrace (void)
-{
- dump_backtrace ();
-}
-#else
-void _dbus_print_backtrace (void)
-{
- _dbus_verbose (" D-Bus not compiled with backtrace support\n");
-}
-#endif
-
static dbus_uint32_t fromAscii(char ascii)
{
if(ascii >= '0' && ascii <= '9')
diff --git a/dbus/meson.build b/dbus/meson.build
index a8b1a60e..5273eb83 100644
--- a/dbus/meson.build
+++ b/dbus/meson.build
@@ -116,6 +116,7 @@ if platform_windows
))
dbus_shared_sources += [
+ 'dbus-backtrace-win.c',
'dbus-file-win.c',
'dbus-pipe-win.c',
'dbus-sysdeps-thread-win.c',
diff --git a/dbus/versioninfo.rc.in b/dbus/versioninfo.rc.in
index 6c7301c8..0cee48ac 100644
--- a/dbus/versioninfo.rc.in
+++ b/dbus/versioninfo.rc.in
@@ -1,5 +1,6 @@
/* versioninfo.rc.in - for dbus
* Copyright (C) 2005 g10 Code GmbH
+ * SPDX-License-Identifier: LicenseRef-GAP
*
* This file is free software; as a special exception the author gives
* unlimited permission to copy and/or distribute it, with or without
diff --git a/doc/dbus-test-tool.1.xml.in b/doc/dbus-test-tool.1.xml.in
index 62dc5580..5a19a715 100644
--- a/doc/dbus-test-tool.1.xml.in
+++ b/doc/dbus-test-tool.1.xml.in
@@ -7,6 +7,9 @@
<holder>Collabora Ltd.</holder>
</copyright>
<legalnotice>
+ <!--
+ SPDX-License-Identifier: GPL-2.0-or-later
+ -->
<para>This man page is distributed under the same terms as
dbus-test-tool (GPL-2+). There is NO WARRANTY, to the extent
permitted by law.</para>
diff --git a/test/internals/hash.c b/test/internals/hash.c
index 192d82e3..ae4d829c 100644
--- a/test/internals/hash.c
+++ b/test/internals/hash.c
@@ -5,6 +5,7 @@
* Copyright 2002-2009 Red Hat, Inc.
* Copyright 2003 Joe Shaw
* Copyright 2011-2018 Collabora Ltd.
+ * SPDX-License-Identifier: (AFL-2.1 OR GPL-2.0-or-later) AND TCL
*
* Licensed under the Academic Free License version 2.1
*
diff --git a/tools/cmake-format b/tools/cmake-format
index 3495f0e4..e9c85722 100755
--- a/tools/cmake-format
+++ b/tools/cmake-format
@@ -4,10 +4,7 @@
#
# Copyright (c) 2019,2021 Ralf Habacker <ralf.habacker@freenet.de>
#
-# SPDX-License-Identifier: BSD
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-#
+# SPDX-License-Identifier: BSD-3-Clause
if test -z "$1"; then
echo "format cmake files by Ralf Habacker"
diff --git a/tools/dbus-cleanup-sockets.c b/tools/dbus-cleanup-sockets.c
index 356c18fd..f8e1cbcc 100644
--- a/tools/dbus-cleanup-sockets.c
+++ b/tools/dbus-cleanup-sockets.c
@@ -3,6 +3,7 @@
*
* Copyright (C) 2003 Red Hat, Inc.
* Copyright (C) 2002 Michael Meeks
+ * SPDX-License-Identifier: GPL-2.0-or-later
*
* Note that this file is NOT licensed under the Academic Free License,
* as it is based on linc-cleanup-sockets which is LGPL.
diff --git a/tools/dbus-echo.c b/tools/dbus-echo.c
index 917d983c..1e0f03c2 100644
--- a/tools/dbus-echo.c
+++ b/tools/dbus-echo.c
@@ -4,6 +4,7 @@
* Copyright © 2003 Philip Blundell <philb@gnu.org>
* Copyright © 2011 Nokia Corporation
* Copyright © 2014 Collabora Ltd.
+ * SPDX-License-Identifier: GPL-2.0-or-later
*
* 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
diff --git a/tools/dbus-monitor.c b/tools/dbus-monitor.c
index cd5d9ae8..7f6e5a11 100644
--- a/tools/dbus-monitor.c
+++ b/tools/dbus-monitor.c
@@ -2,6 +2,7 @@
/* dbus-monitor.c Utility program to monitor messages on the bus
*
* Copyright (C) 2003 Philip Blundell <philb@gnu.org>
+ * SPDX-License-Identifier: GPL-2.0-or-later
*
* 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
diff --git a/tools/dbus-print-message.c b/tools/dbus-print-message.c
index 22ee6824..bd78d0d9 100644
--- a/tools/dbus-print-message.c
+++ b/tools/dbus-print-message.c
@@ -3,6 +3,7 @@
*
* Copyright (C) 2003 Philip Blundell <philb@gnu.org>
* Copyright (C) 2003 Red Hat, Inc.
+ * SPDX-License-Identifier: GPL-2.0-or-later
*
* 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
diff --git a/tools/dbus-print-message.h b/tools/dbus-print-message.h
index d45bc79d..a9f9efff 100644
--- a/tools/dbus-print-message.h
+++ b/tools/dbus-print-message.h
@@ -3,6 +3,7 @@
*
* Copyright (C) 2003 Philip Blundell <philb@gnu.org>
* Copyright (C) 2003 Red Hat, Inc.
+ * SPDX-License-Identifier: GPL-2.0-or-later
*
* 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
diff --git a/tools/dbus-send.c b/tools/dbus-send.c
index 3063290f..64a8c2d3 100644
--- a/tools/dbus-send.c
+++ b/tools/dbus-send.c
@@ -2,6 +2,7 @@
/* dbus-send.c Utility program to send messages from the command line
*
* Copyright (C) 2003 Philip Blundell <philb@gnu.org>
+ * SPDX-License-Identifier: GPL-2.0-or-later
*
* 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
diff --git a/tools/dbus-spam.c b/tools/dbus-spam.c
index 192911cb..7c0a7168 100644
--- a/tools/dbus-spam.c
+++ b/tools/dbus-spam.c
@@ -4,6 +4,7 @@
* Copyright © 2003 Philip Blundell <philb@gnu.org>
* Copyright © 2011 Nokia Corporation
* Copyright © 2014 Collabora Ltd.
+ * SPDX-License-Identifier: GPL-2.0-or-later
*
* 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
diff --git a/tools/dbus-uuidgen.c b/tools/dbus-uuidgen.c
index 6d8d97a2..e20f48aa 100644
--- a/tools/dbus-uuidgen.c
+++ b/tools/dbus-uuidgen.c
@@ -2,6 +2,7 @@
/* dbus-uuidgen.c Utility program to create UUIDs
*
* Copyright (C) 2006 Red Hat, Inc.
+ * SPDX-License-Identifier: GPL-2.0-or-later
*
* 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
diff --git a/tools/test-tool.c b/tools/test-tool.c
index 149c10ab..47d0b4bf 100644
--- a/tools/test-tool.c
+++ b/tools/test-tool.c
@@ -4,6 +4,7 @@
* Copyright © 2003 Philip Blundell <philb@gnu.org>
* Copyright © 2011 Nokia Corporation
* Copyright © 2014 Collabora Ltd.
+ * SPDX-License-Identifier: GPL-2.0-or-later
*
* 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
diff --git a/tools/test-tool.h b/tools/test-tool.h
index 8143cd50..f42ed67b 100644
--- a/tools/test-tool.h
+++ b/tools/test-tool.h
@@ -4,6 +4,7 @@
* Copyright © 2003 Philip Blundell <philb@gnu.org>
* Copyright © 2011 Nokia Corporation
* Copyright © 2014 Collabora Ltd.
+ * SPDX-License-Identifier: GPL-2.0-or-later
*
* 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
diff --git a/tools/tool-common.c b/tools/tool-common.c
index 4fcfcb9f..aa923639 100644
--- a/tools/tool-common.c
+++ b/tools/tool-common.c
@@ -4,6 +4,7 @@
* Copyright © 2003 Philip Blundell <philb@gnu.org>
* Copyright © 2011 Nokia Corporation
* Copyright © 2014 Collabora Ltd.
+ * SPDX-License-Identifier: GPL-2.0-or-later
*
* 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
diff --git a/tools/tool-common.h b/tools/tool-common.h
index 12a3fd6c..813ffeae 100644
--- a/tools/tool-common.h
+++ b/tools/tool-common.h
@@ -4,6 +4,7 @@
* Copyright © 2003 Philip Blundell <philb@gnu.org>
* Copyright © 2011 Nokia Corporation
* Copyright © 2014 Collabora Ltd.
+ * SPDX-License-Identifier: GPL-2.0-or-later
*
* 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