Compare commits
8 Commits
Author | SHA256 | Date | |
---|---|---|---|
9384f89c02
|
|||
86541fa524 | |||
bd69a03d7c
|
|||
305d37fb9d
|
|||
ef3876174f
|
|||
03d56e268f | |||
f2921cc646
|
|||
e0a55a2436
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
||||
.osc
|
||||
dictd*/
|
||||
|
16
_service
Normal file
16
_service
Normal file
@@ -0,0 +1,16 @@
|
||||
<services>
|
||||
<service name="obs_scm" mode="manual">
|
||||
<param name="scm">git</param>
|
||||
<param name="url">https://github.com/cheusov/dictd.git</param>
|
||||
<param name="versionprefix">1.13.3+git</param>
|
||||
<param name="revision">dictd-1.13</param>
|
||||
<param name="changesgenerate">enable</param>
|
||||
<param name="changesauthor">mcepl@cepl.eu</param>
|
||||
</service>
|
||||
<service name="tar" mode="buildtime"/>
|
||||
<service name="recompress" mode="buildtime">
|
||||
<param name="file">*.tar</param>
|
||||
<param name="compression">gz</param>
|
||||
</service>
|
||||
<service name="set_version" mode="manual"/>
|
||||
</services>
|
4
_servicedata
Normal file
4
_servicedata
Normal file
@@ -0,0 +1,4 @@
|
||||
<servicedata>
|
||||
<service name="tar_scm">
|
||||
<param name="url">https://github.com/cheusov/dictd.git</param>
|
||||
<param name="changesrevision">2b21553c6e0c5257f83dd846237ea70a01be3f8a</param></service></servicedata>
|
@@ -1,6 +1,12 @@
|
||||
--- a/dictd.c
|
||||
+++ b/dictd.c
|
||||
@@ -332,6 +332,7 @@ static void xsigprocmask (int how, const
|
||||
---
|
||||
dictd.c | 40 ++++++++++++++++++++++++++--------------
|
||||
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)
|
||||
{
|
||||
sigset_t set;
|
||||
@@ -353,6 +354,7 @@ static void unblock_signals (void)
|
||||
@@ -353,6 +354,7 @@
|
||||
|
||||
xsigprocmask (SIG_UNBLOCK, &set, NULL);
|
||||
}
|
||||
@@ -16,70 +22,65 @@
|
||||
|
||||
static void handler( int sig )
|
||||
{
|
||||
@@ -1266,21 +1268,22 @@ static void release_root_privileges( voi
|
||||
* -- Bob Hilliard
|
||||
*/
|
||||
{
|
||||
+ int unused __attribute__((unused));
|
||||
if (geteuid() == 0) {
|
||||
@@ -1270,19 +1272,25 @@
|
||||
struct passwd *pwd;
|
||||
|
||||
if ((pwd = getpwnam("dictd"))) {
|
||||
- setgid(pwd->pw_gid);
|
||||
+ unused = setgid(pwd->pw_gid);
|
||||
initgroups("dictd",pwd->pw_gid);
|
||||
- initgroups("dictd",pwd->pw_gid);
|
||||
- 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"))) {
|
||||
- setgid(pwd->pw_gid);
|
||||
+ unused = setgid(pwd->pw_gid);
|
||||
initgroups("nobody",pwd->pw_gid);
|
||||
- initgroups("nobody",pwd->pw_gid);
|
||||
- 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 {
|
||||
- setgid(GID_NOGROUP);
|
||||
+ unused = setgid(GID_NOGROUP);
|
||||
initgroups("nobody", GID_NOGROUP);
|
||||
- initgroups("nobody", GID_NOGROUP);
|
||||
- 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 (2);
|
||||
|
||||
- dup (fd);
|
||||
- dup (fd);
|
||||
- dup (fd);
|
||||
+ unused = dup (fd);
|
||||
+ unused = dup (fd);
|
||||
+ 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");
|
||||
+ if (dup(fd) == -1)
|
||||
+ err_fatal_errno(NULL, ":E: dup(2) failed\n");
|
||||
}
|
||||
|
||||
int main (int argc, char **argv, char **envp)
|
||||
@@ -1489,6 +1493,7 @@ int main (int argc, char **argv, char **
|
||||
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 **
|
||||
@@ -1707,7 +1718,8 @@
|
||||
|
||||
if (detach){
|
||||
/* become a daemon */
|
||||
- daemon (0, 1);
|
||||
+ unused = daemon (0, 1);
|
||||
+ if (daemon(0, 1))
|
||||
+ err_fatal_errno(NULL, ":E: daemon(3) failed\n");
|
||||
reopen_012 ();
|
||||
|
||||
/* after fork from daemon(3) */
|
||||
|
BIN
dictd-1.13.1.tar.gz
(Stored with Git LFS)
BIN
dictd-1.13.1.tar.gz
(Stored with Git LFS)
Binary file not shown.
BIN
dictd-1.13.3+git.1731775346.2b21553.obscpio
(Stored with Git LFS)
Normal file
BIN
dictd-1.13.3+git.1731775346.2b21553.obscpio
(Stored with Git LFS)
Normal file
Binary file not shown.
@@ -1,3 +1,60 @@
|
||||
-------------------------------------------------------------------
|
||||
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>
|
||||
|
||||
- Add default /etc/dict.conf so that dict client works by default
|
||||
as it used to (rh#2342818).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Nov 18 11:00:22 UTC 2024 - Matej Cepl <mcepl@cepl.eu>
|
||||
|
||||
- Update to 1.13.3:
|
||||
- dictd: fix buffer overflow in first/last search strategies
|
||||
(bsc#1233442).
|
||||
- Remove upstreamed index-buf-ovrflw.patch.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Nov 15 12:58:53 UTC 2024 - Matej Cepl <mcepl@cepl.eu>
|
||||
|
||||
- Update to 1.13.2:
|
||||
- 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)
|
||||
- Remove upstreamed patches:
|
||||
- gcc-14.patch
|
||||
- Add index-buf-ovrflw.patch to fix a buffer overflow in index.c
|
||||
(courtesy of the upstream author).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Nov 02 21:08:57 UTC 2024 - mcepl@cepl.eu
|
||||
|
||||
- Update to version 1.13.1+git.1730572217.cccab00:
|
||||
* dictd: listen to ipv6 and ipv4 by default
|
||||
* remove use of deprecated inet_aton and inet_ntoa
|
||||
* dictd: install dictd*.conf files to ${DATADIR}/examples/dictd by default
|
||||
* Fix problems with DICT_CONFIG_PATH and other defined came from Makefile
|
||||
* dict/Makefile: do not copy man page to ${BINDIR} :-)
|
||||
* dict/Makefile: formatting
|
||||
* dict: install samples dict.conf and dict2.conf to ${EGDIR}
|
||||
* Move examples/dict1.conf to dict/
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Mar 7 18:18:01 UTC 2024 - Matej Cepl <mcepl@cepl.eu>
|
||||
|
||||
|
@@ -1,5 +1,4 @@
|
||||
name: dictd
|
||||
version: 1.12.1.git.1520674574.9a2f53e
|
||||
mtime: 1520674574
|
||||
commit: 9a2f53ec26ec7eb1880437f1cafae6291634c98d
|
||||
|
||||
version: 1.13.3+git.1731775346.2b21553
|
||||
mtime: 1731775346
|
||||
commit: 2b21553c6e0c5257f83dd846237ea70a01be3f8a
|
||||
|
48
dictd.spec
48
dictd.spec
@@ -17,22 +17,25 @@
|
||||
|
||||
|
||||
Name: dictd
|
||||
Version: 1.13.1
|
||||
Version: 1.13.3+git.1731775346.2b21553
|
||||
Release: 0
|
||||
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
|
||||
Group: Productivity/Office/Dictionary
|
||||
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: dictd-%{version}.tar.gz
|
||||
Source1: colorit.conf
|
||||
Source2: dictd.service
|
||||
Source99: dictd-rpmlintrc
|
||||
Patch0: dictd-1.12.1-unused-return.patch
|
||||
# BuildRequires: mk-configure
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: bison
|
||||
BuildRequires: flex
|
||||
BuildRequires: gawk
|
||||
BuildRequires: gcc
|
||||
BuildRequires: judy-devel
|
||||
BuildRequires: libdbi-devel
|
||||
BuildRequires: libmaa-devel
|
||||
BuildRequires: libtool
|
||||
@@ -52,12 +55,6 @@ set up a custom dictionary. To look up, for example, the word "grunt",
|
||||
execute `dict grunt` at a command line. See the man pages of dict and
|
||||
dictd for details.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%autopatch -p1
|
||||
|
||||
autoreconf -fv
|
||||
|
||||
%package devel
|
||||
Summary: Development files for dictd
|
||||
Group: Development/Languages/C and C++
|
||||
@@ -73,14 +70,38 @@ dictd for details.
|
||||
|
||||
This package contains development files for the dictd package.
|
||||
|
||||
%prep
|
||||
%autosetup -p1
|
||||
|
||||
autoreconf -fi
|
||||
ls -l config*
|
||||
|
||||
%build
|
||||
export LDFLAGS="%{?__global_ldflags}" CPPFLAGS="%{optflags} -fPIC"
|
||||
%configure --enable-dictorg --with-plugin-dbi
|
||||
# export USE_PLUGIN=1
|
||||
# export PREFIX="%%{_prefix}"
|
||||
# export MANDIR="%%{_mandir}"
|
||||
# export SYSCONFDIR="%%{_sysconfdir}"
|
||||
# export CC="%%{__cc}"
|
||||
# export DESTDIR="%%{buildroot}"
|
||||
# export COPTS="%%{optflags} -fPIC"
|
||||
# mkc_compiler_settings
|
||||
# mkcmake all
|
||||
export LEXLIB="-fl"
|
||||
./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
|
||||
%make_build
|
||||
|
||||
%install
|
||||
%make_install
|
||||
# mkcmake install
|
||||
install -D -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/colorit.conf
|
||||
cat <<EOF >%{buildroot}/%{_sysconfdir}/dictd.conf
|
||||
global {
|
||||
@@ -97,6 +118,11 @@ database_exit
|
||||
|
||||
EOF
|
||||
|
||||
cat <<EOF >%{buildroot}/%{_sysconfdir}/dict.conf
|
||||
# This is an example, you should define your own servers
|
||||
server dict.org
|
||||
EOF
|
||||
|
||||
install -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/dictd.service
|
||||
|
||||
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcdictd
|
||||
@@ -110,6 +136,9 @@ if [ "x%{_libdir}" != "x%{_libexecdir}" ] ; then
|
||||
fi
|
||||
rm -fv %{buildroot}%{_libdir}/*.{la,a}
|
||||
|
||||
%check
|
||||
%make_build test
|
||||
|
||||
%pre
|
||||
%service_add_pre dictd.service
|
||||
|
||||
@@ -138,6 +167,7 @@ chmod 644 %{_localstatedir}/log/dictd
|
||||
%attr(0644,root,root) %{_unitdir}/dictd.service
|
||||
%config(noreplace) %{_sysconfdir}/colorit.conf
|
||||
%config(noreplace) %{_sysconfdir}/dictd.conf
|
||||
%config(noreplace) %{_sysconfdir}/dict.conf
|
||||
|
||||
%files devel
|
||||
%license COPYING
|
||||
|
Reference in New Issue
Block a user