Compare commits
21 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8fa2c2cc9b | ||
|
|
9672054974 |
||
|
|
abfd3092b0 |
||
|
|
4958d0ad6c | ||
|
|
9d42e6db82 |
||
|
|
73b9ec83af | ||
|
|
19cbc75753 | ||
|
|
1d36c0aa8a |
||
|
|
341db09c08 | ||
|
|
a13756fa70 | ||
|
|
7ee38f7aa9 |
||
|
|
1fa903c0a2 |
||
|
|
fb04d1e884 | ||
|
|
334bcd1bc1 | ||
|
|
54b7dd307a | ||
|
|
ceffbde032 | ||
|
|
cf1515997a | ||
|
|
47afcf4839 | ||
|
|
dea4847e6c | ||
|
|
92152538e2 | ||
|
|
1d9bc5552b |
26 changed files with 506 additions and 349 deletions
1
.fmf/version
Normal file
1
.fmf/version
Normal file
|
|
@ -0,0 +1 @@
|
|||
1
|
||||
8
.gitignore
vendored
8
.gitignore
vendored
|
|
@ -1,6 +1,2 @@
|
|||
dictd-1.11.0.tar.gz
|
||||
libmaa-1.1.0.tar.gz
|
||||
/libmaa-1.3.0.tar.gz
|
||||
/dictd-1.12.0.tar.gz
|
||||
/dictd-1.12.1.tar.gz
|
||||
/libmaa-1.3.2.tar.gz
|
||||
*.tar.gz
|
||||
*.src.rpm
|
||||
|
|
|
|||
117
0001-Fix-C99-compatibility-issues-in-lexer-parser-integra.patch
Normal file
117
0001-Fix-C99-compatibility-issues-in-lexer-parser-integra.patch
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
From 3f72d457cc49bd52106c8bd7779d867ca7a57e0d Mon Sep 17 00:00:00 2001
|
||||
From: Florian Weimer <fweimer@redhat.com>
|
||||
Date: Thu, 11 Jan 2024 08:53:25 -0700
|
||||
Subject: [PATCH] Fix C99 compatibility issues in lexer/parser integration
|
||||
|
||||
Consolidate all lexer/parser declarations in lexparse.h and include
|
||||
this file in both the generated lexers and parsers and the code that
|
||||
invokes them.
|
||||
|
||||
This avoids implicit function declarations and build failures with
|
||||
future compilers.
|
||||
|
||||
Submitted upstream: <https://sourceforge.net/p/dict/mailman/message/37772919/>
|
||||
|
||||
Related to:
|
||||
<https://fedoraproject.org/wiki/Changes/PortingToModernC>
|
||||
<https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
|
||||
---
|
||||
clientparse.y | 1 +
|
||||
clientscan.l | 4 +---
|
||||
lexparse.h | 8 ++++++++
|
||||
parse.c | 4 +---
|
||||
servparse.y | 1 +
|
||||
servscan.l | 4 +---
|
||||
6 files changed, 13 insertions(+), 9 deletions(-)
|
||||
create mode 100644 lexparse.h
|
||||
|
||||
diff --git a/clientparse.y b/clientparse.y
|
||||
index f4162e6..073c85a 100644
|
||||
--- a/clientparse.y
|
||||
+++ b/clientparse.y
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
%{
|
||||
#include "dict.h"
|
||||
+#include "lexparse.h"
|
||||
#define YYDEBUG 1
|
||||
#define YYERROR_VERBOSE
|
||||
|
||||
diff --git a/clientscan.l b/clientscan.l
|
||||
index d47b5b8..dbcc8f6 100644
|
||||
--- a/clientscan.l
|
||||
+++ b/clientscan.l
|
||||
@@ -24,9 +24,7 @@
|
||||
|
||||
#include "dict.h"
|
||||
#include "clientparse.h"
|
||||
-extern int yylex( void );
|
||||
-extern int yydebug;
|
||||
-extern void yyerror( const char *message );
|
||||
+#include "lexparse.h"
|
||||
#define RETURN(val) do { \
|
||||
yylval.token.src = src_get( yyleng ); \
|
||||
return val; \
|
||||
diff --git a/lexparse.h b/lexparse.h
|
||||
new file mode 100644
|
||||
index 0000000..d7b1955
|
||||
--- /dev/null
|
||||
+++ b/lexparse.h
|
||||
@@ -0,0 +1,8 @@
|
||||
+/* Shared prototypes for lexers and parsers. */
|
||||
+
|
||||
+extern int yylex( void );
|
||||
+extern int yydebug;
|
||||
+extern void yyerror( const char *message );
|
||||
+extern int yydebug;
|
||||
+extern FILE *yyin;
|
||||
+extern int yyparse( void );
|
||||
diff --git a/parse.c b/parse.c
|
||||
index 1cdaf91..47c2ebc 100644
|
||||
--- a/parse.c
|
||||
+++ b/parse.c
|
||||
@@ -24,13 +24,11 @@
|
||||
#include "dictP.h"
|
||||
#include "maa.h"
|
||||
#include "parse.h"
|
||||
+#include "lexparse.h"
|
||||
|
||||
static int _prs_debug_flag = 0;
|
||||
static const char *_prs_cpp_options = NULL;
|
||||
|
||||
-extern int yydebug;
|
||||
-extern FILE *yyin;
|
||||
-extern int yyparse( void );
|
||||
|
||||
/* \doc |prs_set_debug| specifies the value of |yyerror| that |prs_file|
|
||||
will use. */
|
||||
diff --git a/servparse.y b/servparse.y
|
||||
index 4d4e0bc..ae7fb39 100644
|
||||
--- a/servparse.y
|
||||
+++ b/servparse.y
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "index.h"
|
||||
#include "data.h"
|
||||
#include "maa.h"
|
||||
+#include "lexparse.h"
|
||||
|
||||
#define YYDEBUG 1
|
||||
#define YYERROR_VERBOSE
|
||||
diff --git a/servscan.l b/servscan.l
|
||||
index 2001605..2460ea4 100644
|
||||
--- a/servscan.l
|
||||
+++ b/servscan.l
|
||||
@@ -22,9 +22,7 @@
|
||||
%{
|
||||
#include "dictd.h"
|
||||
#include "servparse.h"
|
||||
-extern int yylex( void );
|
||||
-extern int yydebug;
|
||||
-extern void yyerror( const char *message );
|
||||
+#include "lexparse.h"
|
||||
static void include_file( void );
|
||||
static void include_complete( void );
|
||||
YY_BUFFER_STATE orig_buffer = NULL;
|
||||
--
|
||||
2.43.0
|
||||
|
||||
96
0001-remove-use-of-deprecated-inet_aton-and-inet_ntoa.patch
Normal file
96
0001-remove-use-of-deprecated-inet_aton-and-inet_ntoa.patch
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
From 941a0027855ae2d55b6672a692a750a33a0d3260 Mon Sep 17 00:00:00 2001
|
||||
From: Carlos Rodriguez-Fernandez <carlosrodrifernandez@gmail.com>
|
||||
Date: Mon, 11 Mar 2024 20:20:39 -0700
|
||||
Subject: [PATCH] remove use of deprecated inet_aton and inet_ntoa
|
||||
|
||||
---
|
||||
daemon.c | 43 +++++++++++++++++++++++++++++++------------
|
||||
1 file changed, 31 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/daemon.c b/daemon.c
|
||||
index 449caca..4d9f078 100644
|
||||
--- a/daemon.c
|
||||
+++ b/daemon.c
|
||||
@@ -90,6 +90,8 @@ static struct {
|
||||
};
|
||||
#define COMMANDS (sizeof(commandInfo)/sizeof(commandInfo[0]))
|
||||
|
||||
+#define ADDR_LEN 64
|
||||
+
|
||||
static command_t lookup_command( int argc, const char **argv )
|
||||
{
|
||||
size_t i;
|
||||
@@ -199,7 +201,7 @@ static int daemon_check_mask(const char *spec, const char *ip)
|
||||
{
|
||||
char *tmp = alloca(strlen(spec) + 1);
|
||||
char *pt;
|
||||
- char tstring[64], mstring[64];
|
||||
+ char tstring[ADDR_LEN], mstring[ADDR_LEN];
|
||||
struct in_addr target, mask;
|
||||
int bits;
|
||||
unsigned long bitmask;
|
||||
@@ -216,11 +218,18 @@ static int daemon_check_mask(const char *spec, const char *ip)
|
||||
return DICT_DENY;
|
||||
}
|
||||
|
||||
- inet_aton(ip, &target);
|
||||
- inet_aton(tmp, &mask);
|
||||
+
|
||||
+ if (inet_pton(AF_INET, ip, &target) < 1) {
|
||||
+ log_info( ":E: Unable to parse '%s' as an IPv4 address\n", ip);
|
||||
+ return DICT_DENY;
|
||||
+ }
|
||||
+ if (inet_pton(AF_INET, tmp, &mask) < 1) {
|
||||
+ log_info( ":E: Unable to parse '%s' as an IPv4 address\n", tmp);
|
||||
+ return DICT_DENY;
|
||||
+ }
|
||||
bits = strtol(pt, NULL, 10);
|
||||
- strcpy(tstring, inet_ntoa(target));
|
||||
- strcpy(mstring, inet_ntoa(mask));
|
||||
+ inet_ntop(AF_INET, &target, tstring, ADDR_LEN);
|
||||
+ inet_ntop(AF_INET, &mask, mstring, ADDR_LEN);
|
||||
if (bits < 0 || bits > 32) {
|
||||
log_info( ":E: Bit count (%d) out of range, denying access to %s\n",
|
||||
bits, ip);
|
||||
@@ -240,7 +249,7 @@ static int daemon_check_range(const char *spec, const char *ip)
|
||||
{
|
||||
char *tmp = alloca(strlen(spec) + 1);
|
||||
char *pt;
|
||||
- char tstring[64], minstring[64], maxstring[64];
|
||||
+ char tstring[ADDR_LEN], minstring[ADDR_LEN], maxstring[ADDR_LEN];
|
||||
struct in_addr target, min, max;
|
||||
|
||||
strcpy(tmp, spec);
|
||||
@@ -258,13 +267,23 @@ static int daemon_check_range(const char *spec, const char *ip)
|
||||
log_info( ":E: Misformed range %s, denying access to %s\n", spec, ip);
|
||||
return DICT_DENY;
|
||||
}
|
||||
+
|
||||
+ if (inet_pton(AF_INET, ip, &target) < 1) {
|
||||
+ log_info( ":E: Unable to parse '%s' as an IPv4 address\n", ip);
|
||||
+ return DICT_DENY;
|
||||
+ }
|
||||
+ if (inet_pton(AF_INET, tmp, &min) < 1) {
|
||||
+ log_info( ":E: Unable to parse '%s' as an IPv4 address\n", tmp);
|
||||
+ return DICT_DENY;
|
||||
+ }
|
||||
+ if (inet_pton(AF_INET, pt, &max) < 1) {
|
||||
+ log_info( ":E: Unable to parse '%s' as an IPv4 address\n", pt);
|
||||
+ return DICT_DENY;
|
||||
+ }
|
||||
|
||||
- inet_aton(ip, &target);
|
||||
- inet_aton(tmp, &min);
|
||||
- inet_aton(pt, &max);
|
||||
- strcpy(tstring, inet_ntoa(target));
|
||||
- strcpy(minstring, inet_ntoa(min));
|
||||
- strcpy(maxstring, inet_ntoa(max));
|
||||
+ inet_ntop(AF_INET, &target, tstring, ADDR_LEN);
|
||||
+ inet_ntop(AF_INET, &min, minstring, ADDR_LEN);
|
||||
+ inet_ntop(AF_INET, &max, maxstring, ADDR_LEN);
|
||||
if (ntohl(target.s_addr) >= ntohl(min.s_addr)
|
||||
&& ntohl(target.s_addr) <= ntohl(max.s_addr)) {
|
||||
PRINTF(DBG_AUTH,("%s in range from %s to %s\n",
|
||||
--
|
||||
2.44.0
|
||||
|
||||
1
dict.conf
Normal file
1
dict.conf
Normal file
|
|
@ -0,0 +1 @@
|
|||
server dict.org
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
diff -up dictd-1.12.0/libmaa/pr.c.unusedvar dictd-1.12.0/libmaa/pr.c
|
||||
--- dictd-1.12.0/libmaa/pr.c.unusedvar 2011-07-04 13:40:12.130732584 +0200
|
||||
+++ dictd-1.12.0/libmaa/pr.c 2011-07-04 13:40:33.479732586 +0200
|
||||
@@ -386,7 +386,7 @@ int pr_filter( const char *command,
|
||||
const char *inBuffer, int inLen,
|
||||
char *outBuffer, int outMaxLen )
|
||||
{
|
||||
- int pid;
|
||||
+ __attribute__((__unused__)) int pid;
|
||||
int in, out;
|
||||
|
||||
pid = pr_open( command, PR_CREATE_STDIN | PR_CREATE_STDOUT,
|
||||
diff -up dictd-1.12.0/libmaa/string.c.unusedvar dictd-1.12.0/libmaa/string.c
|
||||
--- dictd-1.12.0/libmaa/string.c.unusedvar 2008-12-07 15:58:11.000000000 +0100
|
||||
+++ dictd-1.12.0/libmaa/string.c 2011-07-04 13:39:40.787732580 +0200
|
||||
@@ -111,7 +111,7 @@ int str_pool_iterate(
|
||||
hsh_HashTable hash = p -> hash;
|
||||
hsh_Position hash_pos;
|
||||
void *key;
|
||||
- void *datum;
|
||||
+ __attribute__((__unused__)) void *datum;
|
||||
|
||||
/* printf ("inside str_pool_iterate\n"); */
|
||||
|
||||
@@ -140,7 +140,7 @@ int str_pool_iterate_arg(
|
||||
hsh_HashTable hash = p -> hash;
|
||||
hsh_Position hash_pos;
|
||||
void *key;
|
||||
- void *datum;
|
||||
+ __attribute__((__unused__)) void *datum;
|
||||
|
||||
HSH_ITERATE (hash, hash_pos, key, datum){
|
||||
if ((*iterator) (key, arg)){
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
diff -up dictd-1.12.1/libmaa/log.c.size dictd-1.12.1/libmaa/log.c
|
||||
--- dictd-1.12.1/libmaa/log.c.size 2018-02-13 15:13:53.441469899 +0100
|
||||
+++ dictd-1.12.1/libmaa/log.c 2018-02-13 15:18:35.743558067 +0100
|
||||
@@ -297,7 +297,7 @@ static void _log_base_va(
|
||||
{
|
||||
va_list ap_copy;
|
||||
time_t t;
|
||||
- static char buf [4096] = "";
|
||||
+ static char buf [4608] = "";
|
||||
static char buf_main [4096] = "";
|
||||
static char buf_preamble [256] = "";
|
||||
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
diff -purN dictd-1.12.1/dictd.c dictd-1.12.1_new/dictd.c
|
||||
--- dictd-1.12.1/dictd.c 2011-01-09 17:53:27.000000000 +0100
|
||||
+++ dictd-1.12.1_new/dictd.c 2014-02-25 16:12:49.752301674 +0100
|
||||
@@ -329,6 +329,7 @@ static void xsigprocmask (int how, const
|
||||
}
|
||||
}
|
||||
|
||||
+/*
|
||||
static void block_signals (void)
|
||||
{
|
||||
sigset_t set;
|
||||
@@ -350,6 +351,7 @@ static void unblock_signals (void)
|
||||
|
||||
xsigprocmask (SIG_UNBLOCK, &set, NULL);
|
||||
}
|
||||
+*/
|
||||
|
||||
static void handler( int sig )
|
||||
{
|
||||
@@ -1264,21 +1266,22 @@ static void release_root_privileges( voi
|
||||
* -- Bob Hilliard
|
||||
*/
|
||||
{
|
||||
+ int unused __attribute__((unused));
|
||||
if (geteuid() == 0) {
|
||||
struct passwd *pwd;
|
||||
|
||||
if ((pwd = getpwnam("dictd"))) {
|
||||
- setgid(pwd->pw_gid);
|
||||
+ unused = setgid(pwd->pw_gid);
|
||||
initgroups("dictd",pwd->pw_gid);
|
||||
- setuid(pwd->pw_uid);
|
||||
+ unused = setuid(pwd->pw_uid);
|
||||
} else if ((pwd = getpwnam("nobody"))) {
|
||||
- setgid(pwd->pw_gid);
|
||||
+ unused = setgid(pwd->pw_gid);
|
||||
initgroups("nobody",pwd->pw_gid);
|
||||
- setuid(pwd->pw_uid);
|
||||
+ unused = setuid(pwd->pw_uid);
|
||||
} else {
|
||||
- setgid(GID_NOGROUP);
|
||||
+ unused = setgid(GID_NOGROUP);
|
||||
initgroups("nobody", GID_NOGROUP);
|
||||
- setuid(UID_NOBODY);
|
||||
+ unused = setuid(UID_NOBODY);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
close (1);
|
||||
close (2);
|
||||
|
||||
- dup (fd);
|
||||
- dup (fd);
|
||||
- dup (fd);
|
||||
+ unused = dup (fd);
|
||||
+ unused = dup (fd);
|
||||
+ unused = dup (fd);
|
||||
}
|
||||
|
||||
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 = "???";
|
||||
|
||||
@@ -1696,7 +1701,7 @@ int main (int argc, char **argv, char **
|
||||
|
||||
if (detach){
|
||||
/* become a daemon */
|
||||
- daemon (0, 1);
|
||||
+ unused = daemon (0, 1);
|
||||
reopen_012 ();
|
||||
|
||||
/* after fork from daemon(3) */
|
||||
9
dictd.conf
Normal file
9
dictd.conf
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
global {
|
||||
}
|
||||
|
||||
# Add database definitions here...
|
||||
|
||||
# We stop the search here
|
||||
database_exit
|
||||
|
||||
# Add hidden database definitions here...
|
||||
100
dictd.init
100
dictd.init
|
|
@ -1,100 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# chkconfig: - 91 9
|
||||
# description: Starts and stops the dict server
|
||||
# processname: dictd
|
||||
# config: /etc/dictd.conf
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: dictd
|
||||
# Required-Start:
|
||||
# Required-Stop:
|
||||
# Default-Start:
|
||||
# Default-Stop: 0 1 2 4 6
|
||||
# Short-Description: start|stop|restart|try-restart|status|force-reload dictd
|
||||
# Description: control dictionary server which allows clients access to
|
||||
# dictionary definitions from a set of natural language dictionary databases
|
||||
### END INIT INFO
|
||||
|
||||
# Source function library.
|
||||
. /etc/rc.d/init.d/functions
|
||||
|
||||
|
||||
DICTD=/usr/sbin/dictd
|
||||
DICTD_FLAGS=
|
||||
LOCKFILE=/var/lock/subsys/dictd
|
||||
prog=dictd
|
||||
|
||||
[ -e /etc/sysconfig/dictd ] && . /etc/sysconfig/dictd
|
||||
|
||||
function start
|
||||
{
|
||||
unset RETVAL
|
||||
if [ -x $DICTD ]; then
|
||||
echo -n $"Starting $prog: "
|
||||
if [ -s /etc/dictd.conf ]; then
|
||||
daemon $DICTD $DICTD_FLAGS
|
||||
echo
|
||||
else
|
||||
echo -n $"no dictionaries installed"
|
||||
echo_failure
|
||||
echo
|
||||
RETVAL=6
|
||||
fi
|
||||
else
|
||||
echo "$0: cannot find $DICTD or it's not executable"
|
||||
RETVAL=1
|
||||
fi
|
||||
|
||||
RETVAL=${RETVAL:-$?}
|
||||
[ $RETVAL -eq 0 ] && touch $LOCKFILE
|
||||
}
|
||||
|
||||
function stop
|
||||
{
|
||||
echo -n $"Shutting down $prog: "
|
||||
killproc $prog
|
||||
RETVAL=$?
|
||||
echo
|
||||
rm -f $LOCKFILE
|
||||
}
|
||||
|
||||
function restart
|
||||
{
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
# See how we were called.
|
||||
case "$1" in
|
||||
start) start
|
||||
;;
|
||||
stop) stop
|
||||
;;
|
||||
restart | force-reload) restart
|
||||
;;
|
||||
reload)
|
||||
killproc $prog -HUP
|
||||
RETVAL=$?
|
||||
;;
|
||||
force-reload)
|
||||
killproc $prog -USR1
|
||||
killproc $prog -HUP
|
||||
RETVAL=$?
|
||||
;;
|
||||
try-restart | condrestart )
|
||||
RETVAL=0
|
||||
test -f $LOCKFILE && restart
|
||||
;;
|
||||
status)
|
||||
status dictd
|
||||
RETVAL=$?
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|restart|try-restart|condrestart|reload|force-reload|status}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit $RETVAL
|
||||
|
||||
2
dictd.rpmlintrc
Normal file
2
dictd.rpmlintrc
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
addFilter('.*incorrect-fsf-address.*')
|
||||
addFilter('.*zero-length.*')
|
||||
231
dictd.spec
231
dictd.spec
|
|
@ -1,40 +1,38 @@
|
|||
%if 0%{?rhel} > 6 || 0%{?fedora} >= 16
|
||||
%bcond_with fedora
|
||||
%bcond_without systemd
|
||||
%else
|
||||
%bcond_without fedora
|
||||
%bcond_with systemd
|
||||
%endif
|
||||
%global _hardened_build 1
|
||||
# Do no change username -- hardcoded in dictd.c
|
||||
%global username dictd
|
||||
%global homedir %{_datadir}/dict/dictd
|
||||
%global selinux_variants mls targeted
|
||||
%define libmaaVersion 1.3.2
|
||||
|
||||
Summary: DICT protocol (RFC 2229) server and command-line client
|
||||
Name: dictd
|
||||
Version: 1.12.1
|
||||
Release: 27%{?dist}
|
||||
License: GPL+ and zlib and MIT
|
||||
Source0: http://downloads.sourceforge.net/dict/%{name}-%{version}.tar.gz
|
||||
Version: 1.13.3
|
||||
Release: 2%{?dist}
|
||||
License: GPL-2.0-only AND GPL-2.0-or-later AND GPL-1.0-or-later AND GPL-3.0-or-later AND MIT AND BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
|
||||
Source0: https://github.com/cheusov/dictd/archive/%{version}/%{name}-%{version}.tar.gz
|
||||
Source1: dictd.service
|
||||
Source2: libmaa-%{libmaaVersion}.tar.gz
|
||||
Source3: dictd2.te
|
||||
Source4: dictd.init
|
||||
Patch0: dictd-1.12.1-unused-return.patch
|
||||
Patch1: dictd-1.12.1-maa-bufsize.patch
|
||||
Source2: dictd2.te
|
||||
Source3: dictd.conf
|
||||
Source4: dict.conf
|
||||
Patch0: 0001-Fix-C99-compatibility-issues-in-lexer-parser-integra.patch
|
||||
Patch1: 0001-remove-use-of-deprecated-inet_aton-and-inet_ntoa.patch
|
||||
URL: http://www.dict.org/
|
||||
|
||||
BuildRequires: flex bison libtool libtool-ltdl-devel byacc
|
||||
BuildRequires: libdbi-devel, zlib-devel, gawk, gcc
|
||||
%if %{with systemd}
|
||||
BuildRequires: systemd
|
||||
%endif
|
||||
BuildRequires: checkpolicy, selinux-policy-devel
|
||||
BuildRequires: make
|
||||
# , /usr/share/selinux/devel/policyhelp
|
||||
Requires(pre): shadow-utils
|
||||
BuildRequires: flex
|
||||
BuildRequires: flex-devel
|
||||
Buildrequires: autoconf
|
||||
BuildRequires: bison
|
||||
BuildRequires: libtool
|
||||
BuildRequires: libtool-ltdl-devel
|
||||
BuildRequires: libmaa-devel
|
||||
BuildRequires: byacc
|
||||
BuildRequires: libdbi-devel
|
||||
BuildRequires: zlib-devel
|
||||
BuildRequires: gawk
|
||||
BuildRequires: gcc
|
||||
BuildRequires: pkgconfig(systemd)
|
||||
BuildRequires: checkpolicy, selinux-policy-devel
|
||||
|
||||
|
||||
%description
|
||||
Command-line client for the DICT protocol. The Dictionary Server
|
||||
|
|
@ -44,15 +42,9 @@ language dictionary databases.
|
|||
|
||||
%package server
|
||||
Summary: Server for the Dictionary Server Protocol (DICT)
|
||||
%if %{with systemd}
|
||||
Requires(post): systemd
|
||||
Requires(preun): systemd
|
||||
Requires(postun): systemd
|
||||
%else
|
||||
Requires(post): chkconfig
|
||||
Requires(preun): chkconfig
|
||||
Requires(postun): initscripts
|
||||
%endif
|
||||
%if "%{_selinux_policy_version}" != ""
|
||||
Requires: selinux-policy >= %{_selinux_policy_version}
|
||||
%endif
|
||||
|
|
@ -64,62 +56,38 @@ ftp://ftp.dict.org/pub/dict/pre/
|
|||
More information can be found in the INSTALL file in this package.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
tar xzf %{SOURCE2}
|
||||
mv libmaa-%{libmaaVersion} libmaa
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%autosetup -p1
|
||||
|
||||
autoreconf -fiv
|
||||
mkdir SELinux
|
||||
cp -p %{SOURCE3} SELinux
|
||||
cp -p %{SOURCE2} SELinux
|
||||
|
||||
# Create a sysusers.d config file
|
||||
cat >dictd.sysusers.conf <<EOF
|
||||
u dictd - 'dictd dictionary server' %{homedir} -
|
||||
EOF
|
||||
|
||||
%build
|
||||
export CFLAGS="$RPM_OPT_FLAGS -fPIC"
|
||||
export LDFLAGS="%{?__global_ldflags}" CPPFLAGS="$RPM_OPT_FLAGS -fPIC"
|
||||
pushd libmaa
|
||||
# Required for aarch64 support:
|
||||
%configure
|
||||
make %{?_smp_mflags}
|
||||
popd
|
||||
|
||||
cd SELinux
|
||||
pushd SELinux
|
||||
for selinuxvariant in %{selinux_variants}
|
||||
do
|
||||
make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile
|
||||
mv dictd2.pp dictd2.pp.${selinuxvariant}
|
||||
make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile clean
|
||||
done
|
||||
cd -
|
||||
popd
|
||||
|
||||
export LDFLAGS="%{?__global_ldflags} -Llibmaa/.libs" CPPFLAGS="-Ilibmaa $RPM_OPT_FLAGS -fPIC"
|
||||
%configure --enable-dictorg --disable-plugin
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
make install DESTDIR=$RPM_BUILD_ROOT
|
||||
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
|
||||
mkdir -p $RPM_BUILD_ROOT%{homedir}
|
||||
%if %{with systemd}
|
||||
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
|
||||
install -m 755 %{SOURCE1} $RPM_BUILD_ROOT/%{_unitdir}/dictd.service
|
||||
%else
|
||||
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
|
||||
install -m 755 %{SOURCE4} $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d/dictd
|
||||
%endif
|
||||
|
||||
cat <<EOF > $RPM_BUILD_ROOT/%{_sysconfdir}/dictd.conf
|
||||
global {
|
||||
#syslog
|
||||
#syslog_facility daemon
|
||||
}
|
||||
|
||||
# Add database definitions here...
|
||||
|
||||
# We stop the search here
|
||||
database_exit
|
||||
|
||||
# Add hidden database definitions here...
|
||||
|
||||
EOF
|
||||
%make_install
|
||||
mkdir -p %{buildroot}%{homedir}
|
||||
mkdir -p %{buildroot}%{_unitdir}
|
||||
install -m 755 %{SOURCE1} %{buildroot}%{_unitdir}/dictd.service
|
||||
mkdir -p %{buildroot}%{_sysconfdir}
|
||||
install -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/dictd.conf
|
||||
install -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/dict.conf
|
||||
|
||||
for selinuxvariant in %{selinux_variants}
|
||||
do
|
||||
|
|
@ -128,69 +96,112 @@ do
|
|||
%{buildroot}%{_datadir}/selinux/${selinuxvariant}/dictd2.pp
|
||||
done
|
||||
|
||||
install -m0644 -D dictd.sysusers.conf %{buildroot}%{_sysusersdir}/dictd.conf
|
||||
|
||||
|
||||
%post server
|
||||
%if %{with systemd}
|
||||
%systemd_post dictd.service
|
||||
%else
|
||||
if [ $1 = 1 ]; then
|
||||
/sbin/chkconfig --add dictd
|
||||
fi
|
||||
%endif
|
||||
|
||||
%preun server
|
||||
%if %{with systemd}
|
||||
%systemd_preun dictd.service
|
||||
%else
|
||||
if [ $1 = 0 ]; then
|
||||
# Stop the service (otherwise userdel will fail)
|
||||
/etc/rc.d/init.d/dictd stop &>/dev/null || :
|
||||
/sbin/chkconfig --del dictd
|
||||
fi
|
||||
%endif
|
||||
|
||||
%postun server
|
||||
%if %{with systemd}
|
||||
%systemd_postun_with_restart dictd.service
|
||||
%else
|
||||
if [ $1 -ge 1 ] ; then
|
||||
/sbin/service dictd condrestart > /dev/null 2>&1 || :
|
||||
fi
|
||||
%endif
|
||||
|
||||
%pre
|
||||
getent group %{username} >/dev/null || groupadd -r %{username}
|
||||
getent passwd %{username} >/dev/null || \
|
||||
useradd -r -g %{username} -d %{homedir} -s /sbin/nologin \
|
||||
-c "dictd dictionary server" %{username}
|
||||
exit 0
|
||||
|
||||
%files
|
||||
%doc ANNOUNCE COPYING ChangeLog README doc/rfc2229.txt doc/security.doc
|
||||
%doc ANNOUNCE COPYING README doc/rfc2229.txt doc/security.doc
|
||||
%doc examples/dict1.conf
|
||||
%{_bindir}/dict
|
||||
%{_mandir}/man1/dict.1*
|
||||
|
||||
%config(noreplace) %{_sysconfdir}/dict.conf
|
||||
|
||||
%files server
|
||||
%doc ANNOUNCE COPYING INSTALL ChangeLog README doc/rfc2229.txt doc/security.doc
|
||||
%doc ANNOUNCE COPYING INSTALL README doc/rfc2229.txt doc/security.doc
|
||||
%doc examples/dictd*
|
||||
%exclude %{_mandir}/man1/dict.1*
|
||||
%exclude %{_bindir}/dict
|
||||
%{_bindir}/*
|
||||
%{_sbindir}/*
|
||||
%{_mandir}/man?/*
|
||||
%if %{with systemd}
|
||||
%{_bindir}/dict_lookup
|
||||
%{_bindir}/dictfmt
|
||||
%{_bindir}/dictfmt_index2suffix
|
||||
%{_bindir}/dictfmt_index2word
|
||||
%{_bindir}/dictl
|
||||
%{_bindir}/dictunformat
|
||||
%{_bindir}/dictzip
|
||||
%{_bindir}/colorit
|
||||
%{_sbindir}/dictd
|
||||
%{_mandir}/man1/colorit.1*
|
||||
%{_mandir}/man1/dict_lookup.1*
|
||||
%{_mandir}/man1/dictfmt.1*
|
||||
%{_mandir}/man1/dictfmt_index2suffix.1*
|
||||
%{_mandir}/man1/dictfmt_index2word.1*
|
||||
%{_mandir}/man1/dictl.1*
|
||||
%{_mandir}/man1/dictunformat.1*
|
||||
%{_mandir}/man1/dictzip.1*
|
||||
%{_mandir}/man8/dictd.8*
|
||||
%attr(0644,root,root) %{_unitdir}/dictd.service
|
||||
%else
|
||||
%{_sysconfdir}/rc.d/init.d/*
|
||||
%endif
|
||||
%{_sysusersdir}/dictd.conf
|
||||
%{homedir}
|
||||
%config(noreplace) %{_sysconfdir}/dictd.conf
|
||||
%doc SELinux
|
||||
%{_datadir}/selinux/*/dictd2.pp
|
||||
|
||||
%changelog
|
||||
* Wed Jul 23 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.13.3-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
|
||||
|
||||
* Thu Apr 17 2025 Carlos Rodriguez-Fernandez <carlosrodrifernandez@gmail.com> - 1.13.3-1
|
||||
- Update to 1.13.3
|
||||
|
||||
* Tue Feb 11 2025 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.13.1-7
|
||||
- Add sysusers.d config file to allow rpm to create users/groups automatically
|
||||
|
||||
* Wed Jan 29 2025 Carlos Rodriguez-Fernandez <carlosrodrifernandez@gmail.com> - 1.13.1-6
|
||||
- Set default client configuration to use dict.org
|
||||
|
||||
* Thu Jan 16 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.13.1-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
|
||||
|
||||
* Wed Jul 17 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.13.1-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
|
||||
|
||||
* Mon Mar 11 2024 Carlos Rodriguez-Fernandez <carlosrodrifernandez@gmail.com> 1.13.1-3
|
||||
- Remove use of deprecated functions
|
||||
|
||||
* Sun Mar 10 2024 Miroslav Suchy <msuchy@redhat.com> 1.13.1-2
|
||||
- Correct typo in license name
|
||||
|
||||
* Sat Mar 02 2024 Carlos Rodriguez-Fernandez <carlosrodrifernandez@gmail.com> - 1.13.1-1
|
||||
- Update to version 1.13.1
|
||||
|
||||
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.1-36
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.1-35
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.1-34
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
||||
|
||||
* Thu Feb 02 2023 Florian Weimer <fweimer@redhat.com> - 1.12.1-33
|
||||
- Fix C99 compatibility issues in lexer/parser integration
|
||||
|
||||
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.1-32
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||
|
||||
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.1-31
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||
|
||||
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.1-30
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.1-29
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||
|
||||
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.12.1-28
|
||||
- Rebuilt for updated systemd-rpm-macros
|
||||
See https://pagure.io/fesco/issue/2583.
|
||||
|
||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.1-27
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
|
|
|
|||
19
gating.yaml
Normal file
19
gating.yaml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
--- !Policy
|
||||
product_versions:
|
||||
- fedora-*
|
||||
decision_context: bodhi_update_push_testing
|
||||
subject_type: koji_build
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.rpminspect.static-analysis}
|
||||
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.installability.functional}
|
||||
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- fedora-*
|
||||
decision_context: bodhi_update_push_stable
|
||||
subject_type: koji_build
|
||||
rules:
|
||||
# - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.rpmdeplint.functional} # known issue rhbz#2268949
|
||||
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.rpminspect.static-analysis}
|
||||
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.installability.functional}
|
||||
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
|
||||
5
plans/main.fmf
Normal file
5
plans/main.fmf
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
summary: Basic smoke test
|
||||
discover:
|
||||
how: fmf
|
||||
execute:
|
||||
how: tmt
|
||||
3
sources
3
sources
|
|
@ -1,2 +1 @@
|
|||
62696491174c22079f664830d07c0623 dictd-1.12.1.tar.gz
|
||||
01dab2cde2e0a322653e45bfa63537ee libmaa-1.3.2.tar.gz
|
||||
SHA512 (dictd-1.13.3.tar.gz) = fb118a7594566a8e4e3fdff9bf79c37ed29f1f2eb3a9f380ba7c57740839b723537a0ed8864c0b425774b564f78ae50624756c3ca3a372a971002bcaca7fb934
|
||||
|
|
|
|||
1
tests/core/data/dict.conf
Normal file
1
tests/core/data/dict.conf
Normal file
|
|
@ -0,0 +1 @@
|
|||
server localhost
|
||||
11
tests/core/data/dictd.conf
Normal file
11
tests/core/data/dictd.conf
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
global {
|
||||
#syslog
|
||||
#syslog_facility daemon
|
||||
}
|
||||
|
||||
database hello { data "/usr/share/dict/dictd/hello.dict"
|
||||
index "/usr/share/dict/dictd/hello.index" }
|
||||
|
||||
database_exit
|
||||
|
||||
# Add hidden database definitions here...
|
||||
25
tests/core/data/hello.dict
Normal file
25
tests/core/data/hello.dict
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
|
||||
The original data is available from:
|
||||
unknown
|
||||
|
||||
The original data was distributed with the notice shown below. No
|
||||
additional restrictions are claimed. Please redistribute this changed
|
||||
version under the same conditions and restriction that apply to the
|
||||
original version.
|
||||
|
||||
Привет
|
||||
hello1
|
||||
Прывітанне
|
||||
hello2
|
||||
Привіт
|
||||
hello4
|
||||
Hello
|
||||
hello3
|
||||
haló
|
||||
hello5
|
||||
dobrý den
|
||||
hello6
|
||||
unknown
|
||||
00-database-short
|
||||
unknown
|
||||
abdehlnoróýавеинпртыі
|
||||
11
tests/core/data/hello.index
Normal file
11
tests/core/data/hello.index
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
00databasealphabet G9 j
|
||||
00databaseinfo B ET
|
||||
00databaseshort Ge f
|
||||
00databaseurl GW I
|
||||
00databaseutf8 A B
|
||||
dobrý den GB V
|
||||
haló Fx Q
|
||||
hello Fh Q
|
||||
привет EU X
|
||||
привіт FK X
|
||||
прывітанне Er f
|
||||
1
tests/core/main.fmf
Normal file
1
tests/core/main.fmf
Normal file
|
|
@ -0,0 +1 @@
|
|||
summary: dict and dictd smoke test
|
||||
35
tests/core/test.sh
Executable file
35
tests/core/test.sh
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlRun "cp ./data/hello.dict /usr/share/dict/dictd/" 0 "Copying hello dict"
|
||||
rlRun "cp ./data/hello.index /usr/share/dict/dictd/" 0 "Copying hello index"
|
||||
rlFileBackup --missing-ok "/etc/dictd.conf"
|
||||
rlFileBackup --missing-ok "/etc/dict.conf"
|
||||
rlRun "cp ./data/dictd.conf /etc/dictd.conf" 0 "Setting up hello db"
|
||||
rlRun "cp ./data/dict.conf /etc/dict.conf" 0 "Setting up client"
|
||||
rlServiceStop "dictd.service"
|
||||
rlServiceStart "dictd.service"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun -s "dict -I" 0 "Validate connectivity to local server"
|
||||
rlAssertGrep "dictd" "$rlRun_LOG"
|
||||
rlAssertGrep "up" "$rlRun_LOG"
|
||||
rlAssertGrep "hello" "$rlRun_LOG"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun -s "dict haló" 0 "Search haló"
|
||||
rlAssertGrep "hello5" "$rlRun_LOG"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "rm -f /usr/share/dict/dictd/hello.*"
|
||||
rlFileRestore "/etc/dictd.conf"
|
||||
rlFileRestore "/etc/dict.conf"
|
||||
rlServiceRestore "dictd.service"
|
||||
rlPhaseEnd
|
||||
rlJournalEnd
|
||||
3
tests/main.fmf
Normal file
3
tests/main.fmf
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
summary: dict and dictd smoke test
|
||||
test: ./test.sh
|
||||
framework: beakerlib
|
||||
2
tests/manpages/main.fmf
Normal file
2
tests/manpages/main.fmf
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
summary: verify manpages
|
||||
require: [man-db]
|
||||
23
tests/manpages/test.sh
Executable file
23
tests/manpages/test.sh
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
expected_manpages=(
|
||||
'dict(1)'
|
||||
'dictd(8)'
|
||||
'dictzip(1)'
|
||||
'colorit(1)'
|
||||
'dict_lookup(1)'
|
||||
'dictfmt(1)'
|
||||
'dictfmt_index2suffix(1)'
|
||||
'dictfmt_index2word(1)'
|
||||
'dictl(1)'
|
||||
'dictunformat(1)'
|
||||
)
|
||||
|
||||
rlJournalStart
|
||||
for page in "${expected_manpages[@]}"; do
|
||||
rlPhaseStartTest "test ${page}"
|
||||
rlRun "man --pager=cat '${page}'"
|
||||
rlPhaseEnd
|
||||
done
|
||||
rlJournalEnd
|
||||
2
tests/selinux/main.fmf
Normal file
2
tests/selinux/main.fmf
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
summary: verify selinux configuration
|
||||
require: [audit]
|
||||
18
tests/selinux/test.sh
Executable file
18
tests/selinux/test.sh
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlServiceStop "dictd.service"
|
||||
rlServiceStart "dictd.service"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun "ausearch -m AVC -c dictd" 1 "Should find no audit for dictd"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlServiceRestore "dictd.service"
|
||||
rlPhaseEnd
|
||||
rlJournalEnd
|
||||
Loading…
Add table
Add a link
Reference in a new issue