SHA256
1
0
forked from pool/squidGuard

7 Commits

4 changed files with 123 additions and 1 deletions

68
config_exit.patch Normal file
View File

@@ -0,0 +1,68 @@
Fix configure failure in configure due to undefined `exit`
Index: maintain_squidguard-upstream-1.6.0/configure.ac
===================================================================
--- maintain_squidguard-upstream-1.6.0.orig/configure.ac
+++ maintain_squidguard-upstream-1.6.0/configure.ac
@@ -237,7 +237,7 @@ if test "$with_ldap" = "yes"; then
{
LDAP *p;
p = ldap_init("localhost", LDAP_PORT);
- exit(0);
+ return 0;
}
]])],,[
echo
@@ -271,7 +271,7 @@ if test "$with_mysql" != "no"; then
fi
AC_MSG_CHECKING(for mysql)
- MYSQLLINE=" | USERQUERY WORD WORD WORD WORD { sgSourceUserQuery(\$2,\$3,\$4,\$5); }"
+ MYSQLLINE=" | USERQUERY WORD { sgSourceUserQuery(\$2); }"
for i in $mysql_directory; do
if test -r $i/include/mysql/mysql.h; then
@@ -355,8 +355,8 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#endif
ver = major + ((float) minor / 1000);
if (ver >= 2.006)
- exit (0);
- exit (1);
+ return 0;
+ return 1;
}
]])],
[db_ok_version=yes],
@@ -390,8 +390,8 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#endif
ver = major + ((float) minor / 1000);
if (ver > 2.007 && ver < 3.002)
- exit (1);
- exit (0);
+ return 1;
+ return 0;
}
]])],
[db_ok_version=yes],
@@ -426,8 +426,8 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#endif
ver = major + ((float) minor / 1000);
if (ver >= 3.002)
- exit (0);
- exit (1);
+ return 0;
+ return 1;
}
]])],
[dbg2_ok_version=yes],
@@ -454,8 +454,8 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#endif
ver = major + ((float) minor / 1000);
if (ver >= 4.002)
- exit (0);
- exit (1);
+ return 0;
+ return 1;
}
]])],
[dbg3_ok_version=yes],

View File

@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Nov 7 12:27:41 UTC 2024 - Adam Majer <adam.majer@suse.de>
- config_exit.patch: fix build failure due to undefined exit() in
configure.ac scripts
- types.patch: fix types in mysql types
-------------------------------------------------------------------
Wed Apr 28 12:51:38 UTC 2021 - Ferdinand Thiessen <rpm@fthiessen.de>

View File

@@ -1,7 +1,7 @@
#
# spec file for package squidGuard
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -37,6 +37,8 @@ Source3: blocked.gif
Patch0: squidGuard-mysql.patch
Patch1: squidGuard-config.patch
Patch2: default_config_pathfixes.patch
Patch3: config_exit.patch
Patch4: types.patch
BuildRequires: bison
BuildRequires: db-devel
BuildRequires: flex
@@ -137,7 +139,10 @@ cp ANNOUNCE CHANGELOG FAQ README* %{buildroot}/%{_defaultdocdir}/%{name}/
%config(noreplace) %attr(660, squid, squid) %{_localstatedir}/lib/squidGuard/db/blacklist/*
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%{_sbindir}/*
%dir /srv/www
%dir /srv/www/htdocs
%dir %{imgdir}
%dir %{cgidir}
%{cgidir}/*
%{imgdir}/*

42
types.patch Normal file
View File

@@ -0,0 +1,42 @@
Fix type
Index: maintain_squidguard-upstream-1.6.0/src/sg.y.in
===================================================================
--- maintain_squidguard-upstream-1.6.0.orig/src/sg.y.in
+++ maintain_squidguard-upstream-1.6.0/src/sg.y.in
@@ -46,6 +46,8 @@ static int date_switch = 0;
int numSource = 0;
+void sgSourceUserQuery(char *query);
+
void rfc1738_unescape(char *);
void
rfc1738_unescape(char *s)
@@ -720,7 +722,7 @@ void sgSourceUserQuery(query)
char *dbhome = NULL, *f;
MYSQL *conn;
MYSQL_RES *res;
- MYSQL_ROW *row;
+ MYSQL_ROW row;
char line[MAX_BUF];
char *my_query, *my_user, *my_pass, *my_db;
char *str=";";
@@ -2195,11 +2197,12 @@ void sgTimeSetAcl()
for(rew = Rewrite; rew != NULL; rew = rew->next){
if(rew->time != NULL){
rew->active = rew->time->active;
- if(rew->within == OUTSIDE)
- if(rew->active)
- rew->active = 0;
- else
- rew->active = 1;
+ if(rew->within == OUTSIDE) {
+ if(rew->active)
+ rew->active = 0;
+ else
+ rew->active = 1;
+ }
}
}
}