Compare commits
11 Commits
af96b0bc8c
...
cd60b21aaf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd60b21aaf | ||
|
|
2748d0c533 | ||
|
|
96c050bbef | ||
|
|
3b8416fb91 | ||
|
|
ba86226c45 | ||
|
|
cdb2a7ec57 | ||
|
|
61ebcbdd89 | ||
|
|
e4228fc094 | ||
|
|
edcbe03beb | ||
|
|
48c714e3cf | ||
|
|
468ba713c7 |
188
0002-Fix-compiler-issue-when-not-in-security-mode.patch
Normal file
188
0002-Fix-compiler-issue-when-not-in-security-mode.patch
Normal file
@ -0,0 +1,188 @@
|
||||
From e918d67e4f33e6190f1f61d49c84d1204458348e Mon Sep 17 00:00:00 2001
|
||||
From: Lee Duncan <lduncan@suse.com>
|
||||
Date: Tue, 28 Jan 2020 11:49:55 -0800
|
||||
Subject: [PATCH 2/3] Fix compiler issue when not in security mode
|
||||
|
||||
---
|
||||
client.c | 20 +++++++++++++-------
|
||||
db-policy.c | 12 +++++++++---
|
||||
include/libisns/util.h | 1 +
|
||||
isnsadm.c | 2 +-
|
||||
security.c | 14 ++++++++------
|
||||
socket.c | 5 +++--
|
||||
6 files changed, 35 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/client.c b/client.c
|
||||
index 8487877..fda26be 100644
|
||||
--- a/client.c
|
||||
+++ b/client.c
|
||||
@@ -122,22 +122,17 @@ isns_client_get_local_address(const isns_client_t *clnt,
|
||||
/*
|
||||
* Create a security context
|
||||
*/
|
||||
+#ifdef WITH_SECURITY
|
||||
static isns_security_t *
|
||||
__create_security_context(const char *name, const char *auth_key,
|
||||
const char *server_key)
|
||||
{
|
||||
-#ifdef WITH_SECURITY
|
||||
isns_security_t *ctx;
|
||||
isns_principal_t *princ;
|
||||
-#endif /* WITH_SECURITY */
|
||||
|
||||
if (!isns_config.ic_security)
|
||||
return NULL;
|
||||
|
||||
-#ifndef WITH_SECURITY
|
||||
- isns_error("Cannot create security context: security disabled at build time\n");
|
||||
- return NULL;
|
||||
-#else /* WITH_SECURITY */
|
||||
ctx = isns_create_dsa_context();
|
||||
if (ctx == NULL)
|
||||
isns_fatal("Unable to create security context\n");
|
||||
@@ -174,8 +169,19 @@ __create_security_context(const char *name, const char *auth_key,
|
||||
}
|
||||
|
||||
return ctx;
|
||||
-#endif /* WITH_SECURITY */
|
||||
}
|
||||
+#else /* WITH_SECURITY */
|
||||
+static isns_security_t *
|
||||
+__create_security_context(__attribute__((unused))const char *name,
|
||||
+ __attribute__((unused))const char *auth_key,
|
||||
+ __attribute__((unused))const char *server_key)
|
||||
+{
|
||||
+ if (!isns_config.ic_security)
|
||||
+ return NULL;
|
||||
+ isns_error("Cannot create security context: security disabled at build time\n");
|
||||
+ return NULL;
|
||||
+}
|
||||
+#endif /* WITH_SECURITY */
|
||||
|
||||
/*
|
||||
* Create the default security context
|
||||
diff --git a/db-policy.c b/db-policy.c
|
||||
index b1c46e2..d4a0cba 100644
|
||||
--- a/db-policy.c
|
||||
+++ b/db-policy.c
|
||||
@@ -52,11 +52,11 @@ __isns_db_keystore_lookup(isns_db_keystore_t *store,
|
||||
/*
|
||||
* Load a DSA key from the DB store
|
||||
*/
|
||||
+#ifdef WITH_SECURITY
|
||||
static EVP_PKEY *
|
||||
__isns_db_keystore_find(isns_keystore_t *store_base,
|
||||
const char *name, size_t namelen)
|
||||
{
|
||||
-#ifdef WITH_SECURITY
|
||||
isns_db_keystore_t *store = (isns_db_keystore_t *) store_base;
|
||||
isns_object_t *obj;
|
||||
const void *key_data;
|
||||
@@ -71,10 +71,16 @@ __isns_db_keystore_find(isns_keystore_t *store_base,
|
||||
return NULL;
|
||||
|
||||
return isns_dsa_decode_public(key_data, key_size);
|
||||
-#else
|
||||
+}
|
||||
+#else /* WITH_SECURITY */
|
||||
+static EVP_PKEY *
|
||||
+__isns_db_keystore_find(__attribute__((unused))isns_keystore_t *store_base,
|
||||
+ __attribute__((unused))const char *name,
|
||||
+ __attribute__((unused))size_t namelen)
|
||||
+{
|
||||
return NULL;
|
||||
-#endif
|
||||
}
|
||||
+#endif /* WITH_SECURITY */
|
||||
|
||||
/*
|
||||
* Retrieve policy from database
|
||||
diff --git a/include/libisns/util.h b/include/libisns/util.h
|
||||
index 4174480..e5ed037 100644
|
||||
--- a/include/libisns/util.h
|
||||
+++ b/include/libisns/util.h
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <string.h> // for strdup
|
||||
#include <signal.h>
|
||||
#include <libisns/types.h>
|
||||
+#include <stdlib.h>
|
||||
|
||||
#define array_num_elements(a) (sizeof(a) / sizeof((a)[0]))
|
||||
|
||||
diff --git a/isnsadm.c b/isnsadm.c
|
||||
index 7a96007..94c705e 100644
|
||||
--- a/isnsadm.c
|
||||
+++ b/isnsadm.c
|
||||
@@ -1162,7 +1162,7 @@ generate_key_callback(void)
|
||||
}
|
||||
|
||||
isns_attr_t *
|
||||
-load_key_callback(const char *pathname)
|
||||
+load_key_callback(__attribute__((unused))const char *pathname)
|
||||
{
|
||||
isns_fatal("Authentication disabled in this build\n");
|
||||
return NULL;
|
||||
diff --git a/security.c b/security.c
|
||||
index 673a26e..68eb779 100644
|
||||
--- a/security.c
|
||||
+++ b/security.c
|
||||
@@ -408,32 +408,34 @@ isns_security_init(void)
|
||||
}
|
||||
|
||||
isns_keystore_t *
|
||||
-isns_create_keystore(const char *spec)
|
||||
+isns_create_keystore(__attribute__((unused))const char *spec)
|
||||
{
|
||||
isns_no_security();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
-isns_security_set_keystore(isns_security_t *ctx,
|
||||
- isns_keystore_t *ks)
|
||||
+isns_security_set_keystore(__attribute__((unused))isns_security_t *ctx,
|
||||
+ __attribute__((unused))isns_keystore_t *ks)
|
||||
{
|
||||
isns_no_security();
|
||||
}
|
||||
|
||||
void
|
||||
-isns_principal_free(isns_principal_t *peer)
|
||||
+isns_principal_free(__attribute__((unused))isns_principal_t *peer)
|
||||
{
|
||||
}
|
||||
|
||||
isns_principal_t *
|
||||
-isns_get_principal(isns_security_t *ctx, const char *spi, size_t spi_len)
|
||||
+isns_get_principal(__attribute__((unused))isns_security_t *ctx,
|
||||
+ __attribute__((unused))const char *spi,
|
||||
+ __attribute__((unused))size_t spi_len)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char *
|
||||
-isns_principal_name(const isns_principal_t *princ)
|
||||
+isns_principal_name(__attribute__((unused))const isns_principal_t *princ)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
diff --git a/socket.c b/socket.c
|
||||
index da9f5dc..a76d593 100644
|
||||
--- a/socket.c
|
||||
+++ b/socket.c
|
||||
@@ -322,8 +322,9 @@ failed:
|
||||
}
|
||||
#else /* WITH_SECURITY */
|
||||
static int
|
||||
-isns_pdu_authenticate(isns_security_t *sec,
|
||||
- struct isns_partial_msg *msg, buf_t *bp)
|
||||
+isns_pdu_authenticate(__attribute__((unused))isns_security_t *sec,
|
||||
+ __attribute__((unused))struct isns_partial_msg *msg,
|
||||
+ __attribute__((unused))buf_t *bp)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
44
0003-Fix-586-compile-issue-and-remove-Werror.patch
Normal file
44
0003-Fix-586-compile-issue-and-remove-Werror.patch
Normal file
@ -0,0 +1,44 @@
|
||||
From 427678fb7e0d0242ea2c9fa51469495c105f6e8c Mon Sep 17 00:00:00 2001
|
||||
From: Lee Duncan <lduncan@suse.com>
|
||||
Date: Sat, 1 Feb 2020 10:23:04 -0800
|
||||
Subject: [PATCH 3/3] Fix 586 compile issue and remove -Werror
|
||||
|
||||
Using -Werror causes any issue to break the build, whereas
|
||||
I'd rather let the build continue and address the issue.
|
||||
|
||||
Also, fixed one signed-vs-unsigned compare for time_t, which
|
||||
shows up only on 586 (32-bit).
|
||||
---
|
||||
configure.ac | 2 +-
|
||||
isnsdd.c | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index e4f3995..d956e58 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -17,7 +17,7 @@ AC_PATH_PROG(SH, sh)
|
||||
dnl C Compiler features
|
||||
AC_C_INLINE
|
||||
if test "$GCC" = "yes"; then
|
||||
- CFLAGS="-Wall -Werror -Wextra $CFLAGS"
|
||||
+ CFLAGS="-Wall -Wextra $CFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
|
||||
fi
|
||||
|
||||
diff --git a/isnsdd.c b/isnsdd.c
|
||||
index 58825cc..9cedb9f 100644
|
||||
--- a/isnsdd.c
|
||||
+++ b/isnsdd.c
|
||||
@@ -401,7 +401,7 @@ check_portal_registration(__attribute__((unused))void *ptr)
|
||||
continue;
|
||||
|
||||
last_modified = isns_object_last_modified(obj);
|
||||
- if (last_modified + 2 * interval > now) {
|
||||
+ if ((time_t)(last_modified + 2 * interval) > now) {
|
||||
good_portals++;
|
||||
continue;
|
||||
}
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
44
0005-libisns-remove-sighold-and-sigrelse.patch
Normal file
44
0005-libisns-remove-sighold-and-sigrelse.patch
Normal file
@ -0,0 +1,44 @@
|
||||
From e7dac76ce61039fefa58985c955afccb60dabe87 Mon Sep 17 00:00:00 2001
|
||||
From: Rosen Penev <rosenp@gmail.com>
|
||||
Date: Wed, 29 Apr 2020 15:55:55 -0700
|
||||
Subject: [PATCH] libisns: remove sighold and sigrelse
|
||||
|
||||
The man page says that these are deprecated. Use sugprocmask as a replacement.
|
||||
---
|
||||
include/libisns/util.h | 16 ++++++++++++----
|
||||
1 file changed, 12 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/include/libisns/util.h b/include/libisns/util.h
|
||||
index e5ed037..f1b97f0 100644
|
||||
--- a/include/libisns/util.h
|
||||
+++ b/include/libisns/util.h
|
||||
@@ -41,14 +41,22 @@ char * print_size(unsigned long);
|
||||
*/
|
||||
static inline void signals_hold(void)
|
||||
{
|
||||
- sighold(SIGTERM);
|
||||
- sighold(SIGINT);
|
||||
+ sigset_t s;
|
||||
+
|
||||
+ sigemptyset(&s);
|
||||
+ sigaddset(&s, SIGTERM);
|
||||
+ sigaddset(&s, SIGINT);
|
||||
+ sigprocmask(SIG_BLOCK, &s, 0);
|
||||
}
|
||||
|
||||
static inline void signals_release(void)
|
||||
{
|
||||
- sigrelse(SIGTERM);
|
||||
- sigrelse(SIGINT);
|
||||
+ sigset_t s;
|
||||
+
|
||||
+ sigemptyset(&s);
|
||||
+ sigaddset(&s, SIGTERM);
|
||||
+ sigaddset(&s, SIGINT);
|
||||
+ sigprocmask(SIG_UNBLOCK, &s, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
39
0006-isnsadm-Fix-unparse-command-line-options-V-and-r.patch
Normal file
39
0006-isnsadm-Fix-unparse-command-line-options-V-and-r.patch
Normal file
@ -0,0 +1,39 @@
|
||||
From 82fbb3cef309f17a88e44fe9c379d84f9835f39b Mon Sep 17 00:00:00 2001
|
||||
From: Wenchao Hao <haowenchao@huawei.com>
|
||||
Date: Tue, 9 Aug 2022 21:52:18 +0800
|
||||
Subject: [PATCH] isnsadm: Fix unparse command line options "-V" and "-r"
|
||||
|
||||
Following error would reported:
|
||||
|
||||
root@fedora:# isnsadm -V
|
||||
isnsadm: invalid option -- 'V'
|
||||
Error: Unknown option
|
||||
|
||||
root@fedora:# isnsadm -r
|
||||
isnsadm: invalid option -- 'r'
|
||||
Error: Unknown option
|
||||
|
||||
This is because we did not add "V" and "r" to parameter
|
||||
when calling getopt_long()
|
||||
|
||||
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
|
||||
---
|
||||
isnsadm.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/isnsadm.c b/isnsadm.c
|
||||
index 94c705e..0710877 100644
|
||||
--- a/isnsadm.c
|
||||
+++ b/isnsadm.c
|
||||
@@ -97,7 +97,7 @@ main(int argc, char **argv)
|
||||
isns_security_t *security = NULL;
|
||||
int c, status;
|
||||
|
||||
- while ((c = getopt_long(argc, argv, "46Cc:d:hK:k:ls:", options, NULL)) != -1) {
|
||||
+ while ((c = getopt_long(argc, argv, "46Cc:d:hK:k:ls:Vr", options, NULL)) != -1) {
|
||||
switch (c) {
|
||||
case '4':
|
||||
opt_af = AF_INET;
|
||||
--
|
||||
2.35.3
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
From c87b55dac84ac0702ef55345edf019cccf0c62d6 Mon Sep 17 00:00:00 2001
|
||||
From: Wenchao Hao <haowenchao@huawei.com>
|
||||
Date: Mon, 29 Aug 2022 22:40:46 +0800
|
||||
Subject: [PATCH] isnsd: socket: Make sure to create IPv6 socket default
|
||||
|
||||
As described in isnsd's manual, if not explictly specified, the isnsd
|
||||
should listen IPv6 address as default.
|
||||
|
||||
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
|
||||
---
|
||||
isnsd.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/isnsd.c b/isnsd.c
|
||||
index 6c41c30..4031b51 100644
|
||||
--- a/isnsd.c
|
||||
+++ b/isnsd.c
|
||||
@@ -29,7 +29,8 @@ enum {
|
||||
};
|
||||
|
||||
static const char * opt_configfile = ISNS_DEFAULT_ISNSD_CONFIG;
|
||||
-static int opt_af = AF_UNSPEC;
|
||||
+static int opt_af = AF_INET6; // should be AF_INET6 as described in isnsd's manual
|
||||
+
|
||||
static int opt_mode = MODE_NORMAL;
|
||||
static int opt_foreground = 0;
|
||||
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -1,13 +1,20 @@
|
||||
Name: open-isns
|
||||
Version: 0.100
|
||||
Release: 3
|
||||
Release: 10
|
||||
Summary: The iSNS server and client programs
|
||||
License: LGPLv2+
|
||||
URL: https://www.github.com/open-iscsi/open-isns
|
||||
Source0: https://www.github.com/open-iscsi/open-isns/archive/v%{version}.tar.gz#/open-isns-%{version}.tar.gz
|
||||
Patch0001: Fix-the-issue-of-ignoring-the-return-value.patch
|
||||
Patch0002: 0001-Do-not-install-isnsd.socket-in-isnsd.service.patch
|
||||
BuildRequires: gcc git systemd automake autoconf make
|
||||
|
||||
Patch1: 0001-Fix-the-issue-of-ignoring-the-return-value.patch
|
||||
Patch2: 0002-Fix-compiler-issue-when-not-in-security-mode.patch
|
||||
Patch3: 0003-Fix-586-compile-issue-and-remove-Werror.patch
|
||||
Patch4: 0004-Do-not-install-isnsd.socket-in-isnsd.service.patch
|
||||
Patch5: 0005-libisns-remove-sighold-and-sigrelse.patch
|
||||
Patch6: 0006-isnsadm-Fix-unparse-command-line-options-V-and-r.patch
|
||||
Patch7: 0007-isnsd-socket-Make-sure-to-create-IPv6-socket-default.patch
|
||||
|
||||
BuildRequires: gcc systemd automake autoconf make
|
||||
BuildRequires: openssl-devel systemd-devel
|
||||
Recommends: %{name}-help = %{version}-%{release}
|
||||
Requires(post): systemd-units
|
||||
@ -42,12 +49,15 @@ BuildArch: noarch
|
||||
This package consists of man files for iSNS
|
||||
|
||||
%prep
|
||||
%autosetup -n %{name}-%{version} -S git -p1
|
||||
%autosetup -n %{name}-%{version} -p1
|
||||
|
||||
%build
|
||||
%configure --enable-shared --disable-static
|
||||
%make_build
|
||||
|
||||
%check
|
||||
make tests
|
||||
|
||||
%install
|
||||
%make_install
|
||||
make DESTDIR=%{buildroot} install_hdrs install_lib
|
||||
@ -91,6 +101,27 @@ install -p -m 644 isnsd.service %{buildroot}%{_unitdir}/isnsd.service
|
||||
%{_mandir}/man8/*
|
||||
|
||||
%changelog
|
||||
* Fri Sep 2 2022 Wenchao Hao <haowenchao@huawei.com> - 0.101-3
|
||||
- isnsd: socket: Make sure to isnsd would listen IPv6 socket default
|
||||
|
||||
* Sat Aug 13 2022 Wenchao Hao <haowenchao@huawei.com> - 0.100-9
|
||||
- Backport patches to fix unparsed parameters
|
||||
|
||||
* Mon Sep 27 2021 Wenchao Hao <haowenchao@huawei.com> - 0.100-8
|
||||
- Noop operations to make it able to sync between different branches
|
||||
|
||||
* Mon Sep 27 2021 Wenchao Hao <haowenchao@huawei.com> - 0.100-7
|
||||
- DESC: delete -S git from %autosetup, and delete BuildRequires git
|
||||
|
||||
* Mon Sep 27 2021 Wenchao Hao <haowenchao@huawei.com> - 0.100-6
|
||||
- add make tests
|
||||
|
||||
* Mon Sep 27 2021 Wenchao Hao <haowenchao@huawei.com> - 0.100-5
|
||||
- backport upstream bugfix patches
|
||||
|
||||
* Wed Jun 30 2021 Wenchao Hao<haowenchao@huawei.com> - 0.100-4
|
||||
- libisns: remove sighold and sigrelse
|
||||
|
||||
* Thu Apr 4 2021 Wenchao Hao<haowenchao@huawei.com> - 0.100-3
|
||||
- Do not install isnsd.socket in isnsd.service
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user