Update to version 1.13.3+git.1731775346.2b21553

* Update version to 1.13.3
* dictd: fix buffer overflow in first/last search strategies    Thanks a lot to Matěj Cepl <mcepl@cepl.eu> for the report!
* Remove config.{sub,guess}
* Update version to 1.13.2
* Rename configure.in to configure.ac
* dictP.h: remove #include <sys/time.h>
* configure.in: fix obsolete code
* Fix compilation issues with gcc-14
* Update configure script and the like (autoconf-2.72)
This commit is contained in:
Matej Cepl 2025-03-01 14:15:13 +01:00
parent 86541fa524
commit 7eb5a821d5
Signed by: mcepl
GPG Key ID: 79205802880BC9D8
8 changed files with 82 additions and 53 deletions

View File

@ -2,7 +2,7 @@
<service name="obs_scm" mode="manual"> <service name="obs_scm" mode="manual">
<param name="scm">git</param> <param name="scm">git</param>
<param name="url">https://github.com/cheusov/dictd.git</param> <param name="url">https://github.com/cheusov/dictd.git</param>
<param name="versionprefix">1.13.1+git</param> <param name="versionprefix">1.13.3+git</param>
<param name="revision">dictd-1.13</param> <param name="revision">dictd-1.13</param>
<param name="changesgenerate">enable</param> <param name="changesgenerate">enable</param>
<param name="changesauthor">mcepl@cepl.eu</param> <param name="changesauthor">mcepl@cepl.eu</param>

View File

@ -1,4 +1,4 @@
<servicedata> <servicedata>
<service name="tar_scm"> <service name="tar_scm">
<param name="url">https://github.com/cheusov/dictd.git</param> <param name="url">https://github.com/cheusov/dictd.git</param>
<param name="changesrevision">cccab00fe9eea071f35474c0f7d1c95daa5eeb22</param></service></servicedata> <param name="changesrevision">2b21553c6e0c5257f83dd846237ea70a01be3f8a</param></service></servicedata>

View File

@ -1,6 +1,12 @@
--- a/dictd.c ---
+++ b/dictd.c dictd.c | 40 ++++++++++++++++++++++++++--------------
@@ -332,6 +332,7 @@ static void xsigprocmask (int how, const 1 file changed, 26 insertions(+), 14 deletions(-)
Index: dictd-1.13.3+git.1731775346.2b21553/dictd.c
===================================================================
--- dictd-1.13.3+git.1731775346.2b21553.orig/dictd.c 2024-11-16 17:42:26.000000000 +0100
+++ dictd-1.13.3+git.1731775346.2b21553/dictd.c 2025-03-01 14:27:19.487380130 +0100
@@ -332,6 +332,7 @@
} }
} }
@ -8,7 +14,7 @@
static void block_signals (void) static void block_signals (void)
{ {
sigset_t set; sigset_t set;
@@ -353,6 +354,7 @@ static void unblock_signals (void) @@ -353,6 +354,7 @@
xsigprocmask (SIG_UNBLOCK, &set, NULL); xsigprocmask (SIG_UNBLOCK, &set, NULL);
} }
@ -16,70 +22,65 @@
static void handler( int sig ) static void handler( int sig )
{ {
@@ -1266,21 +1268,22 @@ static void release_root_privileges( voi @@ -1270,19 +1272,25 @@
* -- Bob Hilliard
*/
{
+ int unused __attribute__((unused));
if (geteuid() == 0) {
struct passwd *pwd; struct passwd *pwd;
if ((pwd = getpwnam("dictd"))) { if ((pwd = getpwnam("dictd"))) {
- setgid(pwd->pw_gid); - setgid(pwd->pw_gid);
+ unused = setgid(pwd->pw_gid); - initgroups("dictd",pwd->pw_gid);
initgroups("dictd",pwd->pw_gid);
- setuid(pwd->pw_uid); - setuid(pwd->pw_uid);
+ unused = setuid(pwd->pw_uid); + if (setgid(pwd->pw_gid))
+ err_fatal_errno(NULL, ":E: setgid(%u) failed\n", (unsigned)pwd->pw_gid);
+ initgroups("dictd",pwd->pw_gid);
+ if (setuid(pwd->pw_uid))
+ err_fatal_errno(NULL, ":E: setuid(%u) failed\n", (unsigned)pwd->pw_uid);
} else if ((pwd = getpwnam("nobody"))) { } else if ((pwd = getpwnam("nobody"))) {
- setgid(pwd->pw_gid); - setgid(pwd->pw_gid);
+ unused = setgid(pwd->pw_gid); - initgroups("nobody",pwd->pw_gid);
initgroups("nobody",pwd->pw_gid);
- setuid(pwd->pw_uid); - setuid(pwd->pw_uid);
+ unused = setuid(pwd->pw_uid); + if (setgid(pwd->pw_gid))
+ err_fatal_errno(NULL, ":E: setgid(%u) failed\n", (unsigned)pwd->pw_gid);
+ initgroups("nobody",pwd->pw_gid);
+ if (setuid(pwd->pw_uid))
+ err_fatal_errno(NULL, ":E: setuid(%u) failed\n", (unsigned)pwd->pw_uid);
} else { } else {
- setgid(GID_NOGROUP); - setgid(GID_NOGROUP);
+ unused = setgid(GID_NOGROUP); - initgroups("nobody", GID_NOGROUP);
initgroups("nobody", GID_NOGROUP);
- setuid(UID_NOBODY); - setuid(UID_NOBODY);
+ unused = setuid(UID_NOBODY); + if (setgid(GID_NOGROUP))
+ err_fatal_errno(NULL, ":E: setgid(%u) failed\n", (unsigned)pwd->pw_gid);
+ initgroups("nobody", GID_NOGROUP);
+ if (setuid(UID_NOBODY))
+ err_fatal_errno(NULL, ":E: setuid(%u) failed\n", (unsigned)pwd->pw_uid);
} }
- }
+ }
} }
}
@@ -1464,6 +1467,7 @@ static void pid_file_write ()
static void reopen_012 (void)
{
int fd = open ("/dev/null", O_RDWR);
+ int unused __attribute__((unused));
if (fd == -1)
err_fatal_errno (__func__, ":E: can't open /dev/null");
@@ -1471,9 +1475,9 @@ static void reopen_012 (void) /* Perform sanity checks that are often problems for people trying to
@@ -1471,9 +1479,12 @@
close (1); close (1);
close (2); close (2);
- dup (fd); - dup (fd);
- dup (fd); - dup (fd);
- dup (fd); - dup (fd);
+ unused = dup (fd); + if (dup(fd) == -1)
+ unused = dup (fd); + err_fatal_errno(NULL, ":E: dup(2) failed\n");
+ unused = dup (fd); + if (dup(fd) == -1)
+ err_fatal_errno(NULL, ":E: dup(2) failed\n");
+ if (dup(fd) == -1)
+ err_fatal_errno(NULL, ":E: dup(2) failed\n");
} }
int main (int argc, char **argv, char **envp) int main (int argc, char **argv, char **envp)
@@ -1489,6 +1493,7 @@ int main (int argc, char **argv, char ** @@ -1707,7 +1718,8 @@
int i;
int errno_accept = 0;
+ int unused __attribute__((unused));
const char * default_strategy_arg = "???";
@@ -1707,7 +1712,7 @@ int main (int argc, char **argv, char **
if (detach){ if (detach){
/* become a daemon */ /* become a daemon */
- daemon (0, 1); - daemon (0, 1);
+ unused = daemon (0, 1); + if (daemon(0, 1))
+ err_fatal_errno(NULL, ":E: daemon(3) failed\n");
reopen_012 (); reopen_012 ();
/* after fork from daemon(3) */ /* after fork from daemon(3) */

BIN
dictd-1.13.3+git.1731775346.2b21553.obscpio (Stored with Git LFS) Normal file

Binary file not shown.

BIN
dictd-1.13.3.tar.gz (Stored with Git LFS)

Binary file not shown.

View File

@ -1,3 +1,17 @@
-------------------------------------------------------------------
Sat Mar 01 13:18:02 UTC 2025 - mcepl@cepl.eu
- Update to version 1.13.3+git.1731775346.2b21553:
* Update version to 1.13.3
* dictd: fix buffer overflow in first/last search strategies Thanks a lot to Matěj Cepl <mcepl@cepl.eu> for the report!
* Remove config.{sub,guess}
* Update version to 1.13.2
* Rename configure.in to configure.ac
* dictP.h: remove #include <sys/time.h>
* configure.in: fix obsolete code
* Fix compilation issues with gcc-14
* Update configure script and the like (autoconf-2.72)
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Jan 29 17:14:30 UTC 2025 - Matej Cepl <mcepl@cepl.eu> Wed Jan 29 17:14:30 UTC 2025 - Matej Cepl <mcepl@cepl.eu>

View File

@ -1,4 +1,4 @@
name: dictd name: dictd
version: 1.13.1+git.1730572217.cccab00 version: 1.13.3+git.1731775346.2b21553
mtime: 1730572217 mtime: 1731775346
commit: cccab00fe9eea071f35474c0f7d1c95daa5eeb22 commit: 2b21553c6e0c5257f83dd846237ea70a01be3f8a

View File

@ -17,19 +17,20 @@
Name: dictd Name: dictd
Version: 1.13.3 Version: 1.13.3+git.1731775346.2b21553
Release: 0 Release: 0
Summary: DICT protocol (RFC 2229) server and command-line client Summary: DICT protocol (RFC 2229) server and command-line client
License: BSD-3-Clause AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND MIT AND SUSE-Public-Domain License: BSD-3-Clause AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND MIT AND SUSE-Public-Domain
Group: Productivity/Office/Dictionary Group: Productivity/Office/Dictionary
URL: https://github.com/cheusov/dictd URL: https://github.com/cheusov/dictd
# Source0: https://github.com/cheusov/dictd/archive/%%{version}.tar.gz#/dictd-%%{version}.tar.gz # Source0: https://sourceforge.net/projects/dict/files/dictd/dictd-%{version}/dictd-%{version}.tar.gz
Source0: https://sourceforge.net/projects/dict/files/dictd/dictd-%{version}/dictd-%{version}.tar.gz Source0: dictd-%{version}.tar.gz
Source1: colorit.conf Source1: colorit.conf
Source2: dictd.service Source2: dictd.service
Source99: dictd-rpmlintrc Source99: dictd-rpmlintrc
Patch0: dictd-1.12.1-unused-return.patch Patch0: dictd-1.12.1-unused-return.patch
# BuildRequires: mk-configure # BuildRequires: mk-configure
BuildRequires: autoconf
BuildRequires: bison BuildRequires: bison
BuildRequires: flex BuildRequires: flex
BuildRequires: gawk BuildRequires: gawk
@ -72,6 +73,12 @@ This package contains development files for the dictd package.
%prep %prep
%autosetup -p1 %autosetup -p1
rm -f config.cache
autoheader -f
autoconf -f
ls -l config*
install %{_datadir}/autoconf/build-aux/config.guess %{_datadir}/autoconf/build-aux/config.sub .
%build %build
export LDFLAGS="%{?__global_ldflags}" CPPFLAGS="%{optflags} -fPIC" export LDFLAGS="%{?__global_ldflags}" CPPFLAGS="%{optflags} -fPIC"
# export USE_PLUGIN=1 # export USE_PLUGIN=1
@ -84,7 +91,14 @@ export LDFLAGS="%{?__global_ldflags}" CPPFLAGS="%{optflags} -fPIC"
# mkc_compiler_settings # mkc_compiler_settings
# mkcmake all # mkcmake all
export LEXLIB="-fl" export LEXLIB="-fl"
%configure --enable-dictorg --with-plugin-dbi ./configure --host=%{_host} --build=%{_build} --program-prefix=%{?_program_prefix} \
--prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \
--bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} \
--datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} --libexecdir=%{_libexecdir} \
--localstatedir=%{_localstatedir} --sharedstatedir=%{_sharedstatedir} \
--mandir=%{_mandir} --infodir=%{_infodir} \
--with-plugin-dbi
# %%configure --with-plugin-dbi
# --disable-plugin # --disable-plugin
%make_build %make_build