aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/libtirpc-hurd.patch
blob: cd625d696f3503d404f08872b463055c71cb91e7 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
This is a combination of two patches:

1) Taken from https://salsa.debian.org/debian/libtirpc/-/raw/master/debian/patches/03-kfreebsd.diff

Description: Fix build on non Linux architectures
Author: Andreas Beckmann <anbe@debian.org>
Last-Update: 2019-09-01

2) Taken from https://salsa.debian.org/debian/libtirpc/-/raw/master/debian/patches/05-hurd-port.diff

Description: Get source building on Hurd
 - Look for <sys/user.h> before using it.
 - Define MAXHOSTNAMELEN to 64 if missing.
 - Bind sockets on Hurd like on Linux.
Author: Petter Reinholdtsen <pere@hungry.com>

--- a/src/svc_dg.c
+++ b/src/svc_dg.c
@@ -648,6 +648,7 @@
 void
 svc_dg_enable_pktinfo(int fd, const struct __rpc_sockinfo *si)
 {
+#ifdef __linux__
 	int val = 1;
 
 	switch (si->si_af) {
@@ -660,6 +661,7 @@
 		break;
 #endif
 	}
+#endif
 }
 
 /*
@@ -670,6 +672,7 @@
 int
 svc_dg_valid_pktinfo(struct msghdr *msg)
 {
+#ifdef __linux__
 	struct cmsghdr *cmsg;
 
 	if (!msg->msg_name)
@@ -716,4 +719,7 @@
 	}
 
 	return 1;
+#else
+        return 0;
+#endif
 }
--- a/src/clnt_vc.c
+++ b/src/clnt_vc.c
@@ -71,10 +71,12 @@
 #define MCALL_MSG_SIZE 24
 
 #define CMGROUP_MAX    16
-#define SCM_CREDS      0x03            /* process creds (struct cmsgcred) */
 
 #undef rpc_createerr                   /* make it clear it is a thread safe variable */
 
+#ifndef SCM_CREDS
+#define SCM_CREDS      0x03            /* process creds (struct cmsgcred) */
+
 /*
  * Credentials structure, used to verify the identity of a peer
  * process that has sent us a message. This is allocated by the
@@ -90,6 +92,7 @@
         short   cmcred_ngroups;         /* number or groups */
         gid_t   cmcred_groups[CMGROUP_MAX];     /* groups */
 };
+#endif
 
 struct cmessage {
         struct cmsghdr cmsg;
--- a/src/getpeereid.c
+++ b/src/getpeereid.c
@@ -25,9 +25,14 @@
  */
 
 
+#include "config.h"
+
 #include <sys/param.h>
 #include <sys/socket.h>
 #include <sys/un.h>
+#ifdef HAVE_SYS_USER_H
+#  include <sys/user.h>
+#endif /* HAVE_SYS_USER_H */
 
 #include <errno.h>
 #include <unistd.h>
--- a/src/getpeereid.c
+++ b/src/getpeereid.c
@@ -35,12 +36,25 @@
 int
 getpeereid(int s, uid_t *euid, gid_t *egid)
 {
+#ifndef HAVE_SYS_USER_H
+        return(-1);
+#else
+#ifdef XUCRED_VERSION
+	struct xucred uc;
+#define uid  cr_uid
+#define gid  cr_gid
+#else
 	struct ucred uc;
+#endif
 	socklen_t uclen;
 	int error;
 
 	uclen = sizeof(uc); 
+#ifdef XUCRED_VERSION
+	error = getsockopt(s, 0, LOCAL_PEERCRED, &uc, &uclen);
+#else
 	error = getsockopt(s, SOL_SOCKET, SO_PEERCRED, &uc, &uclen); /*  SCM_CREDENTIALS */
+#endif
 	if (error != 0)
 		return (error);
 	//	if (uc.cr_version != XUCRED_VERSION)
@@ -59,4 +66,5 @@
 	*euid = uc.uid;
 	*egid = uc.gid;
 	return (0);
+#endif /* HAVE_SYS_USER_H */
  }
--- a/tirpc/reentrant.h
+++ b/tirpc/reentrant.h
@@ -36,7 +36,7 @@
  * These definitions are only guaranteed to be valid on Linux. 
  */
 
-#if defined(__linux__)
+#if defined(__linux__) || defined(__GLIBC__)
 
 #include <pthread.h>
 
--- a/configure.ac
+++ b/configure.ac
@@ -93,7 +93,7 @@
 AC_PROG_LIBTOOL
 AC_HEADER_DIRENT
 AC_PREFIX_DEFAULT(/usr)
-AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h limits.h locale.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h features.h gssapi/gssapi_ext.h])
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h limits.h locale.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h features.h gssapi/gssapi_ext.h sys/user.h])
 AC_CHECK_LIB([pthread], [pthread_create])
 AC_CHECK_FUNCS([getrpcbyname getrpcbynumber setrpcent endrpcent getrpcent])
 
--- a/src/auth_unix.c
+++ b/src/auth_unix.c
@@ -56,6 +56,11 @@
 #include <rpc/auth.h>
 #include <rpc/auth_unix.h>
 
+/* Workaround for Hurd */
+#ifndef MAXHOSTNAMELEN
+#  define MAXHOSTNAMELEN   64
+#endif
+
 /* auth_unix.c */
 static void authunix_nextverf (AUTH *);
 static bool_t authunix_marshal (AUTH *, XDR *);
--- a/src/bindresvport.c
+++ b/src/bindresvport.c
@@ -64,7 +64,7 @@
         return bindresvport_sa(sd, (struct sockaddr *)sin);
 }
 
-#ifdef __linux__
+#if defined(__linux__) || defined(__GNU__)
 
 #define STARTPORT 600
 #define LOWPORT 512
ass='msg-tooltip'>* gnu/installer/newt/final.scm (run-install-failed-page): Add a "Report the failure" button. Mathieu Othacehe 2022-10-20installer: Run the "guix system init" command in a PTY....Fixes: <https://issues.guix.gnu.org/55360> * gnu/installer/utils.scm (run-external-command-with-handler/tty): New procedure. (run-external-command-with-line-hooks, run-command): Add a TTY? argument. * gnu/installer/final.scm (install-system): Call run-command with TTY? argument set to #true. Mathieu Othacehe 2022-10-17installer: Factorize url-alive? in internet check....* gnu/installer/newt/network.scm (wait-service-online): Factorize url-alive? in internet check. Andrew Tropin 2022-10-17installer: Relax internet check availability criteria....Checks the availability of the mirror bordeaux.guix.gnu.org in addition to ci.guix.gnu.org. This allows to proceed the installation if the ci.guix.gnu.org is unavailable. * gnu/installer/newt/network.scm (wait-service-online): Relax internet check availability criteria. Signed-off-by: Andrew Tropin <andrew@trop.in> aleksandr barakin 2022-10-17guix: Fix typos....These typos were found and reported through weblate. * gnu/packages/audio.scm (wildmidi)[description]: Fix typo. * gnu/packages/games.scm (cgoban)[description]: Fix typo. * gnu/services/version-control.scm (gitolite-service-type)[description]: Fix typo. * gnu/installer/newt/substitutes.scm (run-substitutes-page): Remove full stop at end of title. * gnu/machine/ssh.scm (machine-ssh-configuration-system): Move punctuation outside of quotes. * guix/scripts/home.scm (process-action): Remove trailing space before newline. * guix/scripts/system.scm (show-help): Fix typo. * guix/scripts/environment.scm (with-store/maybe): Fix typo. Julien Lepiller 2022-10-13installer: partition: Add a confirmation page before formatting....Fixes: <https://issues.guix.gnu.org/57232>. * gnu/installer/newt/partition.scm (run-label-confirmation-page): New procedure. (run-label-page): Call the above procedure before proceeding. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Mathieu Othacehe 2022-09-24installer: tests: Fix typo....* gnu/installer/tests.scm (edit-configuration-file): Fix it. Mathieu Othacehe 2022-09-24installer: Fix configuration edition during testing....When the configuration is edited, it looks like there are some leftover fragments from the input configuration: Example content of config.scm after edition: #:imported-modules '((gnu services herd) (guix build utils) (guix combinators))) unted". The unique ;; file system identifiers there ("UUIDs") can be obtained ;; by running 'blkid' in a terminal. ... This is strange because call-with-output-file uses the O_TRUNC flag which resets the file size to zero. Remove the configuration file before writing it as a work-around. * gnu/installer/tests.scm (edit-configuration-file): Remove the configuration file before re-writing it. Mathieu Othacehe 2022-09-22installer: Exit console-services page with abort-to-prompt....* gnu/installer/newt/services.scm (run-console-services-cbt-page): Do it. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Josselin Poiret 2022-09-22installer: Ensure luks devices are open when mounting partitions....Partially-Fixes: <https://issues.guix.gnu.org/57983> * gnu/installer/parted.scm (luks-ensure-open): New procedure. (unmount-user-partitions): Ensure luks devices are open. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Josselin Poiret 2022-09-22installer: Return partitions with crypt password as step result....* gnu/installer/newt/partition.scm (run-partitioning-page): Do it. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Josselin Poiret 2022-09-22installer: Move <secret> to utils and use it for crypt passwords....* gnu/installer/user.scm (<secret>, secret?, make-secret, secret-content): Move to utils.scm. * gnu/installer/utils.scm (<secret>, secret?, make-secret, secret-content): Moved from user.scm. * gnu/installer/newt/partition.scm (prompt-luks-passwords): Make password a <secret>. * gnu/installer/parted.scm (luks-format-and-open): Unwrap secret. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Josselin Poiret 2022-09-01installer: Fix segfault on double logical partition removal....* gnu/installer/parted.scm (auto-partition!): Avoid removing logical partitions twice. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Josselin Poiret 2022-08-14installer: parted: Don't export WITH-DELAY-DEVICE-IN-USE?....* gnu/installer/parted.scm: Remove WITH-DELAY-DEVICE-IN-USE? from the module's export list. Tobias Geerinckx-Rice 2022-08-08installer: Add comments and vertical space to the generated config....* gnu/installer/parted.scm (user-partitions->configuration): Introduce vertical space and a comment. * gnu/installer/services.scm (G_): New macro. (%system-services): Add comment for OpenSSH. (system-services->configuration): Add vertical space and comments. * gnu/installer/user.scm (users->configuration): Add comment. * gnu/installer/steps.scm (format-configuration): Add comment. (configuration->file): Expound leading comment. Pass #:format-comment to 'pretty-print-with-comments/splice'. Ludovic Courtès 2022-08-08installer: Render the final configuration with (guix read-print)....* gnu/installer.scm (module-to-import?): Return #t for (guix read-print). * gnu/installer/steps.scm (configuration->file): Use 'pretty-print-with-comments/splice' instead of 'for-each' and 'pretty-print'. Ludovic Courtès 2022-08-05installer: parted: Call set-system before set-flags....Parted 3.5 introduces the following regression: - partition-set-flag sets the BIOS_GRUB flag. The partition type is set to PARTITION_BIOS_GRUB_GUID. - partition-set-system resets the partition type to PARTITION_LINUX_DATA_GUID undoing what's done by partition-set-flag. To prevent it, reverse the call order. Fixes: <https://issues.guix.gnu.org/55549>. * gnu/installer/parted.scm (mkpart): Call partition-set-system before partition-set-flag. Mathieu Othacehe 2022-08-05installer: parted: Log partition flags....* gnu/installer/parted.scm (mkpart): Log them. Mathieu Othacehe 2022-05-21Revert "installer: user: Remove useless filtering."...This reverts commit c2125e59d0774cda3e559adeb056459a5f23586b. Fixes <https://issues.guix.gnu.org/55361>. Ludovic Courtès