RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN with the following as its source: https://src.fedoraproject.org/rpms/isns-utils#3f3376053060f373cf3ad72a2e3bf913e8c0c61a
This commit is contained in:
parent
095bf66d9c
commit
2f4ce7d441
4
.gitignore
vendored
4
.gitignore
vendored
@ -0,0 +1,4 @@
|
|||||||
|
open-isns-0.93.tar.bz2
|
||||||
|
/open-isns-0.94.tar.gz
|
||||||
|
/open-isns-0.97.tar.gz
|
||||||
|
/open-isns-0.100.tar.gz
|
34
0001-Ignore-common-build-files.patch
Normal file
34
0001-Ignore-common-build-files.patch
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
From 85fab42764fb063097ab8f7fb0a843f7320be8c8 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Lee Duncan <lduncan@suse.com>
|
||||||
|
Date: Tue, 28 Jan 2020 11:49:12 -0800
|
||||||
|
Subject: [PATCH 1/7] Ignore common build files
|
||||||
|
|
||||||
|
---
|
||||||
|
.gitignore | 5 +++++
|
||||||
|
include/libisns/.gitignore | 1 +
|
||||||
|
2 files changed, 6 insertions(+)
|
||||||
|
create mode 100644 include/libisns/.gitignore
|
||||||
|
|
||||||
|
diff --git a/.gitignore b/.gitignore
|
||||||
|
index 5da7a8b..2a0f55d 100644
|
||||||
|
--- a/.gitignore
|
||||||
|
+++ b/.gitignore
|
||||||
|
@@ -7,3 +7,8 @@ isnsd
|
||||||
|
isnsdd
|
||||||
|
libisns.a
|
||||||
|
libisns*.so.?
|
||||||
|
+Makefile
|
||||||
|
+config.h
|
||||||
|
+config.log
|
||||||
|
+config.status
|
||||||
|
+autom4te.cache
|
||||||
|
diff --git a/include/libisns/.gitignore b/include/libisns/.gitignore
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..a3757fd
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/include/libisns/.gitignore
|
||||||
|
@@ -0,0 +1 @@
|
||||||
|
+paths.h
|
||||||
|
--
|
||||||
|
2.18.1
|
||||||
|
|
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 0543f1d02ee733d34ee109d00e7d0efd432bb37b 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/7] 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;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.18.1
|
||||||
|
|
89
0003-Do-not-ignore-write-return-value.patch
Normal file
89
0003-Do-not-ignore-write-return-value.patch
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
From 4c39cb09735a494099fba0474d25ff26800de952 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Lee Duncan <lduncan@suse.com>
|
||||||
|
Date: Wed, 29 Jan 2020 12:47:16 -0800
|
||||||
|
Subject: [PATCH 3/7] Do not ignore write() return value.
|
||||||
|
|
||||||
|
Some distros set the warn_unused_result attribute for the write()
|
||||||
|
system call, so check the return value.
|
||||||
|
---
|
||||||
|
pki.c | 37 ++++++++++++++++++++++++++++++++-----
|
||||||
|
1 file changed, 32 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/pki.c b/pki.c
|
||||||
|
index 486d9bb..57ea664 100644
|
||||||
|
--- a/pki.c
|
||||||
|
+++ b/pki.c
|
||||||
|
@@ -9,12 +9,13 @@
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#include "config.h"
|
||||||
|
+#include <fcntl.h>
|
||||||
|
+#include <assert.h>
|
||||||
|
#ifdef WITH_SECURITY
|
||||||
|
#include <openssl/pem.h>
|
||||||
|
#include <openssl/err.h>
|
||||||
|
#include <openssl/evp.h>
|
||||||
|
#endif
|
||||||
|
-#include <fcntl.h>
|
||||||
|
#include <libisns/isns.h>
|
||||||
|
#include "security.h"
|
||||||
|
#include <libisns/util.h>
|
||||||
|
@@ -431,17 +432,43 @@ isns_dsa_load_params(const char *filename)
|
||||||
|
return dsa;
|
||||||
|
}
|
||||||
|
|
||||||
|
+/*
|
||||||
|
+ * write one 'status' character to stdout
|
||||||
|
+ */
|
||||||
|
+static void
|
||||||
|
+write_status_byte(int ch)
|
||||||
|
+{
|
||||||
|
+ static int stdout_fd = 1; /* fileno(stdout) */
|
||||||
|
+ char buf[2];
|
||||||
|
+ int res;
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * We don't actually care about the return value here, since
|
||||||
|
+ * we are just dumping a status byte to stdout, but
|
||||||
|
+ * some linux distrubutions set the warn_unused_result attribute
|
||||||
|
+ * for the write() API, so we might as well use the return value
|
||||||
|
+ * to make sure the write command isn't broken.
|
||||||
|
+ */
|
||||||
|
+ assert(ch);
|
||||||
|
+ buf[0] = ch;
|
||||||
|
+ buf[1] = '\0';
|
||||||
|
+ res = write(stdout_fd, buf, 1);
|
||||||
|
+ assert(res == 1);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static int
|
||||||
|
isns_dsa_param_gen_callback(int stage,
|
||||||
|
__attribute__((unused))int index,
|
||||||
|
__attribute__((unused))void *dummy)
|
||||||
|
{
|
||||||
|
if (stage == 0)
|
||||||
|
- write(1, "+", 1);
|
||||||
|
+ write_status_byte('+');
|
||||||
|
else if (stage == 1)
|
||||||
|
- write(1, ".", 1);
|
||||||
|
+ write_status_byte('.');
|
||||||
|
else if (stage == 2)
|
||||||
|
- write(1, "/", 1);
|
||||||
|
+ write_status_byte('/');
|
||||||
|
+
|
||||||
|
+ /* as a callback, we must return a value, so just return success */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -478,7 +505,7 @@ isns_dsa_init_params(const char *filename)
|
||||||
|
dsa = DSA_generate_parameters(dsa_key_bits, NULL, 0,
|
||||||
|
NULL, NULL, isns_dsa_param_gen_callback, NULL);
|
||||||
|
#endif
|
||||||
|
- write(1, "\n", 1);
|
||||||
|
+ write_status_byte('\n');
|
||||||
|
|
||||||
|
if (dsa == NULL) {
|
||||||
|
isns_dsasig_report_errors("Error generating DSA parameters",
|
||||||
|
--
|
||||||
|
2.18.1
|
||||||
|
|
44
0004-Fix-586-compile-issue-and-remove-Werror.patch
Normal file
44
0004-Fix-586-compile-issue-and-remove-Werror.patch
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
From 40eb9ce75518817762a0eac4a93016ab817add89 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Lee Duncan <lduncan@suse.com>
|
||||||
|
Date: Sat, 1 Feb 2020 10:23:04 -0800
|
||||||
|
Subject: [PATCH 4/7] 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;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.18.1
|
||||||
|
|
@ -0,0 +1,27 @@
|
|||||||
|
From 2e27c43228210eaa7aaabc2048c78645f319d080 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Leo <thinkabit.ukim@gmail.com>
|
||||||
|
Date: Tue, 4 Feb 2020 05:42:22 +0100
|
||||||
|
Subject: [PATCH 5/7] socket.c: include poll.h instead of sys/poll.h for POSIX
|
||||||
|
compatibility
|
||||||
|
|
||||||
|
https://pubs.opengroup.org/onlinepubs/009695399/basedefs/poll.h.html
|
||||||
|
---
|
||||||
|
socket.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/socket.c b/socket.c
|
||||||
|
index a76d593..432a9bd 100644
|
||||||
|
--- a/socket.c
|
||||||
|
+++ b/socket.c
|
||||||
|
@@ -5,7 +5,7 @@
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <sys/socket.h>
|
||||||
|
-#include <sys/poll.h>
|
||||||
|
+#include <poll.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <sys/un.h>
|
||||||
|
#include <string.h>
|
||||||
|
--
|
||||||
|
2.18.1
|
||||||
|
|
41
0006-fix-compilation-without-deprecated-OpenSSL-APIs.patch
Normal file
41
0006-fix-compilation-without-deprecated-OpenSSL-APIs.patch
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
From 18de2f0670ede5e15a45a94ddecd4218e9267831 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Rosen Penev <rosenp@gmail.com>
|
||||||
|
Date: Wed, 22 Apr 2020 14:35:54 -0700
|
||||||
|
Subject: [PATCH 6/7] fix compilation without deprecated OpenSSL APIs
|
||||||
|
|
||||||
|
Needed two missing headers and a small ifdef fix.
|
||||||
|
---
|
||||||
|
pki.c | 6 +++---
|
||||||
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/pki.c b/pki.c
|
||||||
|
index 57ea664..00dc383 100644
|
||||||
|
--- a/pki.c
|
||||||
|
+++ b/pki.c
|
||||||
|
@@ -15,6 +15,8 @@
|
||||||
|
#include <openssl/pem.h>
|
||||||
|
#include <openssl/err.h>
|
||||||
|
#include <openssl/evp.h>
|
||||||
|
+#include <openssl/dsa.h>
|
||||||
|
+#include <openssl/bn.h>
|
||||||
|
#endif
|
||||||
|
#include <libisns/isns.h>
|
||||||
|
#include "security.h"
|
||||||
|
@@ -97,13 +99,11 @@ isns_create_dsa_context(void)
|
||||||
|
isns_security_t *ctx;
|
||||||
|
|
||||||
|
if (!isns_openssl_init) {
|
||||||
|
- ERR_load_crypto_strings();
|
||||||
|
#if OPENSSL_API_COMPAT < 0x10100000L
|
||||||
|
+ ERR_load_crypto_strings();
|
||||||
|
OpenSSL_add_all_algorithms();
|
||||||
|
OpenSSL_add_all_ciphers();
|
||||||
|
OpenSSL_add_all_digests();
|
||||||
|
-#else
|
||||||
|
- OPENSSL_init_crypto();
|
||||||
|
#endif
|
||||||
|
isns_openssl_init = 1;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.18.1
|
||||||
|
|
44
0007-libisns-remove-sighold-and-sigrelse.patch
Normal file
44
0007-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 7/7] 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
--
|
||||||
|
2.18.1
|
||||||
|
|
214
isns-utils.spec
Normal file
214
isns-utils.spec
Normal file
@ -0,0 +1,214 @@
|
|||||||
|
Name: isns-utils
|
||||||
|
Version: 0.100
|
||||||
|
Release: 0%{?dist}
|
||||||
|
Summary: The iSNS daemon and utility programs
|
||||||
|
|
||||||
|
License: LGPLv2+
|
||||||
|
URL: https://github.com/open-iscsi/open-isns
|
||||||
|
Source0: https://github.com/open-iscsi/open-isns/archive/v%{version}.tar.gz#/open-isns-%{version}.tar.gz
|
||||||
|
Source1: isnsd.service
|
||||||
|
|
||||||
|
Patch0001: 0001-Ignore-common-build-files.patch
|
||||||
|
Patch0002: 0002-Fix-compiler-issue-when-not-in-security-mode.patch
|
||||||
|
Patch0003: 0003-Do-not-ignore-write-return-value.patch
|
||||||
|
Patch0004: 0004-Fix-586-compile-issue-and-remove-Werror.patch
|
||||||
|
Patch0005: 0005-socket.c-include-poll.h-instead-of-sys-poll.h-for-PO.patch
|
||||||
|
Patch0006: 0006-fix-compilation-without-deprecated-OpenSSL-APIs.patch
|
||||||
|
Patch0007: 0007-libisns-remove-sighold-and-sigrelse.patch
|
||||||
|
|
||||||
|
BuildRequires: gcc
|
||||||
|
BuildRequires: openssl-devel automake pkgconfig systemd-devel systemd
|
||||||
|
Requires(post): systemd-units
|
||||||
|
Requires(preun): systemd-units
|
||||||
|
Requires(postun): systemd-units
|
||||||
|
|
||||||
|
%description
|
||||||
|
The iSNS package contains the daemon and tools to setup a iSNS server,
|
||||||
|
and iSNS client tools. The Internet Storage Name Service (iSNS) protocol
|
||||||
|
allows automated discovery, management and configuration of iSCSI and
|
||||||
|
Fibre Channel devices (using iFCP gateways) on a TCP/IP network.
|
||||||
|
|
||||||
|
%package libs
|
||||||
|
Summary: Shared library files for iSNS
|
||||||
|
|
||||||
|
%description libs
|
||||||
|
Shared library files for iSNS
|
||||||
|
|
||||||
|
%package devel
|
||||||
|
Summary: Development files for iSNS
|
||||||
|
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
||||||
|
|
||||||
|
%description devel
|
||||||
|
Development files for iSNS
|
||||||
|
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autosetup -p1 -n open-isns-%{version}
|
||||||
|
|
||||||
|
|
||||||
|
%build
|
||||||
|
%configure --enable-shared --disable-static
|
||||||
|
%make_build
|
||||||
|
|
||||||
|
|
||||||
|
%install
|
||||||
|
%make_install
|
||||||
|
make install_hdrs DESTDIR=%{buildroot}
|
||||||
|
make install_lib DESTDIR=%{buildroot}
|
||||||
|
chmod 755 %{buildroot}%{_sbindir}/isns*
|
||||||
|
chmod 755 %{buildroot}%{_libdir}/libisns.so.0
|
||||||
|
rm %{buildroot}%{_unitdir}/isnsd.service
|
||||||
|
rm %{buildroot}%{_unitdir}/isnsd.socket
|
||||||
|
install -p -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/isnsd.service
|
||||||
|
|
||||||
|
|
||||||
|
%post
|
||||||
|
%systemd_post isnsd.service
|
||||||
|
|
||||||
|
|
||||||
|
%postun
|
||||||
|
%systemd_postun isnsd.service
|
||||||
|
|
||||||
|
|
||||||
|
%preun
|
||||||
|
%systemd_preun isnsd.service
|
||||||
|
|
||||||
|
|
||||||
|
%triggerun -- isns-utils < 0.91-7
|
||||||
|
# Save the current service runlevel info
|
||||||
|
# User must manually run systemd-sysv-convert --apply httpd
|
||||||
|
# to migrate them to systemd targets
|
||||||
|
/usr/bin/systemd-sysv-convert --save isnsd >/dev/null 2>&1 ||:
|
||||||
|
|
||||||
|
# Run these because the SysV package being removed won't do them
|
||||||
|
/sbin/chkconfig --del isnsd >/dev/null 2>&1 || :
|
||||||
|
/bin/systemctl try-restart isnsd.service >/dev/null 2>&1 || :
|
||||||
|
|
||||||
|
|
||||||
|
%ldconfig_scriptlets -n %{name}-libs
|
||||||
|
|
||||||
|
|
||||||
|
%files
|
||||||
|
%doc COPYING README
|
||||||
|
%{_sbindir}/isnsd
|
||||||
|
%{_sbindir}/isnsadm
|
||||||
|
%{_sbindir}/isnsdd
|
||||||
|
%{_mandir}/man5/*
|
||||||
|
%{_mandir}/man8/*
|
||||||
|
%{_unitdir}/isnsd.service
|
||||||
|
%dir %{_sysconfdir}/isns
|
||||||
|
%dir %{_var}/lib/isns
|
||||||
|
%config(noreplace) %{_sysconfdir}/isns/*
|
||||||
|
|
||||||
|
%files libs
|
||||||
|
%{_libdir}/libisns.so.0
|
||||||
|
|
||||||
|
%files devel
|
||||||
|
%dir %{_includedir}/libisns
|
||||||
|
%{_includedir}/libisns/*.h
|
||||||
|
%{_libdir}/libisns.so
|
||||||
|
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Thu Sep 17 2020 Chris Leech <cleech@redhat.com> - 0.100-0
|
||||||
|
- rebase to upstream v0.100 + patches from git
|
||||||
|
|
||||||
|
* Fri Aug 21 2020 Tom Stellard <tstellar@redhat.com> - 0.97-12
|
||||||
|
- Use make macros
|
||||||
|
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
|
||||||
|
|
||||||
|
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.97-11
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||||
|
|
||||||
|
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.97-10
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||||
|
|
||||||
|
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.97-9
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||||
|
|
||||||
|
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.97-8
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||||
|
|
||||||
|
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.97-7
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||||
|
|
||||||
|
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.97-6
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||||
|
|
||||||
|
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.97-5
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
|
||||||
|
|
||||||
|
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.97-4
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
||||||
|
|
||||||
|
* Wed Apr 12 2017 Chris Leech <cleech@redhat.com> - 0.97-3
|
||||||
|
- switch to building as a shared library instead of static
|
||||||
|
|
||||||
|
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.97-2
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
||||||
|
|
||||||
|
* Tue Dec 13 2016 Miro Hrončok <mhroncok@redhat.com> - 0.97-1
|
||||||
|
- Update to 0.97
|
||||||
|
- Upstream moved on GitHub
|
||||||
|
|
||||||
|
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.94-3
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sat Dec 12 2015 Michael Schwendt <mschwendt@fedoraproject.org> - 0.94-2
|
||||||
|
- add -static Provides to the -devel package (#1284298)
|
||||||
|
|
||||||
|
* Mon Oct 05 2015 Chris Leech <cleech@redhat.com> - 0.94-1
|
||||||
|
- new upstream location, update to 0.94
|
||||||
|
- new devel package, upstream open-iscsi is dropping it's internal copy
|
||||||
|
|
||||||
|
* Wed Jun 17 2015 Chris Leech <cleech@redhat.com> - 0.93-8
|
||||||
|
- use of systemd rpm macros now require systemd as a BuildRequires
|
||||||
|
|
||||||
|
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.93-7
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.93-6
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.93-5
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sun Aug 4 2013 Peter Robinson <pbrobinson@fedoraproject.org> 0.93-4
|
||||||
|
- Fix FTBFS, modernise spec
|
||||||
|
|
||||||
|
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.93-3
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
|
||||||
|
|
||||||
|
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.93-2
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
||||||
|
|
||||||
|
* Mon Sep 10 2012 Chris Leech <cleech@redhat.com> - 0.93-1
|
||||||
|
- Rebase to 0.93
|
||||||
|
- Make use of systemd rpm macros for scriptlets, BZ 850174
|
||||||
|
|
||||||
|
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.91-8
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||||
|
|
||||||
|
* Wed Feb 15 2012 Jon Ciesla <limburgher@gmail.com> - 0.91-7
|
||||||
|
- Migrate to systemd, BZ 789707.
|
||||||
|
|
||||||
|
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.91-6
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||||
|
|
||||||
|
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.91-5
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
||||||
|
|
||||||
|
* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 0.91-4
|
||||||
|
- rebuilt with new openssl
|
||||||
|
|
||||||
|
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.91-3
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
|
||||||
|
|
||||||
|
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.91-2
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sat Jan 17 2009 Tomas Mraz <tmraz@redhat.com> - 0.91-1
|
||||||
|
- rebuild with new openssl
|
||||||
|
|
||||||
|
* Wed Jan 16 2008 Mike Christie <mchristie@redhat.com> - 0.91-0.0
|
||||||
|
- first build
|
88
isnsd.init
Normal file
88
isnsd.init
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# open-isns isnsd init script
|
||||||
|
# # Copyright (C) 2007 Albert Pauw
|
||||||
|
#
|
||||||
|
# chkconfig: - 39 35
|
||||||
|
#
|
||||||
|
### BEGIN INIT INFO
|
||||||
|
# Provides: isnsd
|
||||||
|
# Required-Start: $network
|
||||||
|
# Short-Description: Starts and stops the generic iSNS daemon
|
||||||
|
# Description: isnsd provides a iSNS daemon and iSNS management tools.
|
||||||
|
### END INIT INFO
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# pidfile: /var/run/isns.pid
|
||||||
|
|
||||||
|
# Source function library.
|
||||||
|
. /etc/init.d/functions
|
||||||
|
|
||||||
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||||
|
RETVAL=0
|
||||||
|
|
||||||
|
start()
|
||||||
|
{
|
||||||
|
[ `id -u` = 0 ] || exit 4
|
||||||
|
|
||||||
|
echo -n "Starting iSNS Server:"
|
||||||
|
daemon isnsd
|
||||||
|
echo
|
||||||
|
RETVAL=$?
|
||||||
|
if [ $RETVAL -eq "0" ]; then
|
||||||
|
touch /var/lock/subsys/isnsd
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
stop()
|
||||||
|
{
|
||||||
|
[ `id -u` = 0 ] || exit 4
|
||||||
|
|
||||||
|
echo -n "Stopping iSNS Server: "
|
||||||
|
if [ ! -f /var/lock/subsys/isnsd ]; then
|
||||||
|
echo
|
||||||
|
success
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
killproc isnsd
|
||||||
|
echo
|
||||||
|
RETVAL=$?
|
||||||
|
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/isnsd
|
||||||
|
}
|
||||||
|
|
||||||
|
restart()
|
||||||
|
{
|
||||||
|
stop
|
||||||
|
start
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
start
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
stop
|
||||||
|
;;
|
||||||
|
reload)
|
||||||
|
exit 3
|
||||||
|
;;
|
||||||
|
force-reload)
|
||||||
|
restart
|
||||||
|
;;
|
||||||
|
restart)
|
||||||
|
restart
|
||||||
|
;;
|
||||||
|
status)
|
||||||
|
status isnsd
|
||||||
|
RETVAL=$?
|
||||||
|
;;
|
||||||
|
condrestart|try-restart)
|
||||||
|
[ -f /var/lock/subsys/isnsd ] && restart
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo $"Usage: $0 {start|stop|restart|status|force-reload|condrestart|try-restart}"
|
||||||
|
exit 2
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit $RETVAL
|
9
isnsd.service
Normal file
9
isnsd.service
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=ISNS Server
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/usr/sbin/isnsd -f
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
Reference in New Issue
Block a user