[-]
[+]
|
Changed |
_service:tar_git:libtirpc.spec
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://github.com/sailfishos-chum/libtirpc</param>
<param name="branch">master</param>
- <param name="revision">1.3.3+git1</param>
+ <param name="revision">1.3.4+git1</param>
<param name="debian">N</param>
<param name="dumb">N</param>
</service>
|
[-]
[+]
|
Changed |
_service:tar_git:libtirpc-1.3.4+git1.tar.bz2/upstream/configure.ac
^
|
@@ -1,4 +1,4 @@
-AC_INIT(libtirpc, 1.3.2)
+AC_INIT(libtirpc, 1.3.4)
AM_INIT_AUTOMAKE([silent-rules])
AM_SILENT_RULES([yes])
AC_CONFIG_SRCDIR([src/auth_des.c])
|
[-]
[+]
|
Changed |
_service:tar_git:libtirpc-1.3.4+git1.tar.bz2/upstream/src/auth_gss.c
^
|
@@ -184,6 +184,7 @@
AUTH *auth, *save_auth;
struct rpc_gss_data *gd;
OM_uint32 min_stat = 0;
+ rpc_gss_options_ret_t ret;
gss_log_debug("in authgss_create()");
@@ -229,8 +230,12 @@
save_auth = clnt->cl_auth;
clnt->cl_auth = auth;
- if (!authgss_refresh(auth, NULL))
+ memset(&ret, 0, sizeof(rpc_gss_options_ret_t));
+ if (!authgss_refresh(auth, &ret)) {
auth = NULL;
+ sec->major_status = ret.major_status;
+ sec->minor_status = ret.minor_status;
+ }
else
authgss_auth_get(auth); /* Reference for caller */
@@ -619,12 +624,9 @@
}
static bool_t
-authgss_refresh(AUTH *auth, void *dummy)
+authgss_refresh(AUTH *auth, void *ret)
{
- rpc_gss_options_ret_t ret;
-
- memset(&ret, 0, sizeof(ret));
- return _rpc_gss_refresh(auth, &ret);
+ return _rpc_gss_refresh(auth, (rpc_gss_options_ret_t *)ret);
}
bool_t
|
[-]
[+]
|
Changed |
_service:tar_git:libtirpc-1.3.4+git1.tar.bz2/upstream/src/binddynport.c
^
|
@@ -37,6 +37,7 @@
#include <unistd.h>
#include <errno.h>
#include <string.h>
+#include <syslog.h>
#include <rpc/rpc.h>
@@ -57,6 +58,84 @@
};
/*
+ * This function decodes information about given port from provided array and
+ * return if port is reserved or not.
+ *
+ * @reserved_ports an array of size at least "NPORTS / (8*sizeof(char)) + 1".
+ * @port port number within range LOWPORT and ENDPORT
+ *
+ * Returns 0 if port is not reserved, non-negative if port is reserved.
+ */
+static int is_reserved(char *reserved_ports, int port) {
+ port -= LOWPORT;
+ if (port < 0 || port >= NPORTS)
+ return 0;
+ return reserved_ports[port/(8*sizeof(char))] & 1<<(port%(8*sizeof(char)));
+}
+
+/*
+ * This function encodes information about given *reserved* port into provided
+ * array. Don't call this function for ports which are not reserved.
+ *
+ * @reserved_ports an array of size at least "NPORTS / (8*sizeof(char)) + 1".
+ * @port port number within range LOWPORT and ENDPORT
+ *
+ */
+static void set_reserved(char *reserved_ports, int port) {
+ port -= LOWPORT;
+ if (port < 0 || port >= NPORTS)
+ return;
+ reserved_ports[port/(8*sizeof(char))] |= 1<<(port%(8*sizeof(char)));
+}
+
+/*
+ * Parse local reserved ports obtained from
+ * /proc/sys/net/ipv4/ip_local_reserved_ports into bit array.
+ *
+ * @reserved_ports a zeroed array of size at least
+ * "NPORTS / (8*sizeof(char)) + 1". Will be used for bit-wise encoding of
+ * reserved ports.
+ *
+ * On each call, reserved ports are read from /proc and bit-wise stored into
+ * provided array
+ *
+ * Returns 0 on success, -1 on failure.
+ */
+
+static int parse_reserved_ports(char *reserved_ports) {
+ int from=0, to;
+ char delimiter = ',';
+ int res;
+ FILE * file_ptr = fopen("/proc/sys/net/ipv4/ip_local_reserved_ports","r");
+ if (file_ptr == NULL) {
+ (void) syslog(LOG_ERR,
+ "Unable to open open /proc/sys/net/ipv4/ip_local_reserved_ports.");
+ return -1;
+ }
+ do {
+ if ((res = fscanf(file_ptr, "%d", &to)) != 1) {
+ if (res == EOF) break;
+ goto err;
+ }
+ if (delimiter != '-') {
+ from = to;
+ }
+ for (int i = from; i <= to; ++i) {
+ set_reserved(reserved_ports, i);
+ }
+ } while ((res = fscanf(file_ptr, "%c", &delimiter)) == 1);
+ if (res != EOF)
+ goto err;
+ fclose(file_ptr);
+ return 0;
+err:
+ (void) syslog(LOG_ERR,
+ "An error occurred while parsing ip_local_reserved_ports.");
+ fclose(file_ptr);
+ return -1;
+}
+
+/*
* Bind a socket to a dynamically-assigned IP port.
*
* @fd is an open but unbound socket.
@@ -81,7 +160,8 @@
in_port_t port, *portp;
struct sockaddr *sap;
socklen_t salen;
- int i, res;
+ int i, res, array_size;
+ char *reserved_ports = NULL;
if (__rpc_sockisbound(fd))
return 0;
@@ -119,21 +199,33 @@
gettimeofday(&tv, NULL);
seed = tv.tv_usec * getpid();
}
+ array_size = NPORTS / (8*sizeof(char)) + 1;
+ reserved_ports = malloc(array_size);
+ if (!reserved_ports) {
+ goto out;
+ }
+ memset(reserved_ports, 0, array_size);
+ if (parse_reserved_ports(reserved_ports) < 0)
+ goto out;
+
port = (rand_r(&seed) % NPORTS) + LOWPORT;
for (i = 0; i < NPORTS; ++i) {
- *portp = htons(port++);
- res = bind(fd, sap, salen);
- if (res >= 0) {
- res = 0;
- break;
+ *portp = htons(port);
+ if (!is_reserved(reserved_ports, port++)) {
+ res = bind(fd, sap, salen);
+ if (res >= 0) {
+ res = 0;
+ break;
+ }
+ if (errno != EADDRINUSE)
+ break;
}
- if (errno != EADDRINUSE)
- break;
if (port > ENDPORT)
port = LOWPORT;
}
out:
+ free(reserved_ports);
mutex_unlock(&port_lock);
return res;
}
|
[-]
[+]
|
Changed |
_service:tar_git:libtirpc-1.3.4+git1.tar.bz2/upstream/src/bindresvport.c
^
|
@@ -130,6 +130,7 @@
if (list == NULL)
{
free (buf);
+ fclose (fp);
return;
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:libtirpc-1.3.4+git1.tar.bz2/upstream/src/clnt_raw.c
^
|
@@ -142,7 +142,7 @@
struct timeval timeout;
{
struct clntraw_private *clp = clntraw_private;
- XDR *xdrs = &clp->xdr_stream;
+ XDR *xdrs;
struct rpc_msg msg;
enum clnt_stat status;
struct rpc_err error;
@@ -154,6 +154,7 @@
mutex_unlock(&clntraw_lock);
return (RPC_FAILED);
}
+ xdrs = &clp->xdr_stream;
mutex_unlock(&clntraw_lock);
call_again:
@@ -245,7 +246,7 @@
void *res_ptr;
{
struct clntraw_private *clp = clntraw_private;
- XDR *xdrs = &clp->xdr_stream;
+ XDR *xdrs;
bool_t rval;
mutex_lock(&clntraw_lock);
@@ -254,6 +255,7 @@
mutex_unlock(&clntraw_lock);
return (rval);
}
+ xdrs = &clp->xdr_stream;
mutex_unlock(&clntraw_lock);
xdrs->x_op = XDR_FREE;
return ((*xdr_res)(xdrs, res_ptr));
|
[-]
[+]
|
Changed |
_service:tar_git:libtirpc-1.3.4+git1.tar.bz2/upstream/src/getnetconfig.c
^
|
@@ -436,11 +436,6 @@
fprintf(stderr, "in /etc/netconfig.\n");
fprintf(stderr, "Please change this to \"local\" manually ");
fprintf(stderr, "or run mergemaster(8).\n");
- fprintf(stderr, "See UPDATING entry 20021216 for details.\n");
- fprintf(stderr, "Continuing in 10 seconds\n\n");
- fprintf(stderr, "This warning will be removed 20030301\n");
- sleep(10);
-
}
/*
|
[-]
[+]
|
Changed |
_service:tar_git:libtirpc-1.3.4+git1.tar.bz2/upstream/src/rpcb_clnt.c
^
|
@@ -104,17 +104,27 @@
{
if (addr == NULL)
return;
- if(addr->ac_host != NULL)
+ if (addr->ac_host != NULL) {
free(addr->ac_host);
- if(addr->ac_netid != NULL)
+ addr->ac_host = NULL;
+ }
+ if (addr->ac_netid != NULL) {
free(addr->ac_netid);
- if(addr->ac_uaddr != NULL)
+ addr->ac_netid = NULL;
+ }
+ if (addr->ac_uaddr != NULL) {
free(addr->ac_uaddr);
- if(addr->ac_taddr != NULL) {
- if(addr->ac_taddr->buf != NULL)
+ addr->ac_uaddr = NULL;
+ }
+ if (addr->ac_taddr != NULL) {
+ if(addr->ac_taddr->buf != NULL) {
free(addr->ac_taddr->buf);
+ addr->ac_taddr->buf = NULL;
+ }
+ addr->ac_taddr = NULL;
}
free(addr);
+ addr = NULL;
}
/*
@@ -252,12 +262,15 @@
for (cptr = front; cptr != NULL; cptr = cptr->ac_next) {
if (!memcmp(cptr->ac_taddr->buf, addr->buf, addr->len)) {
/* Unlink from cache. We'll destroy it after releasing the mutex. */
- if (cptr->ac_uaddr)
+ if (cptr->ac_uaddr) {
free(cptr->ac_uaddr);
- if (prevptr)
+ cptr->ac_uaddr = NULL;
+ }
+ if (prevptr) {
prevptr->ac_next = cptr->ac_next;
- else
+ } else {
front = cptr->ac_next;
+ }
cachesize--;
break;
}
@@ -496,11 +509,7 @@
CLIENT *client = NULL;
rpcvers_t pmapvers = 2;
- /*
- * Try UDP only - there are some portmappers out
- * there that use UDP only.
- */
- if (nconf == NULL || strcmp(nconf->nc_proto, NC_TCP) == 0) {
+ if (nconf == NULL) {
struct netconfig *newnconf;
if ((newnconf = getnetconfigent("udp")) == NULL) {
@@ -509,7 +518,8 @@
}
client = getclnthandle(hostname, newnconf, tgtaddr);
freenetconfigent(newnconf);
- } else if (strcmp(nconf->nc_proto, NC_UDP) == 0) {
+ } else if (strcmp(nconf->nc_proto, NC_UDP) == 0 ||
+ strcmp(nconf->nc_proto, NC_TCP) == 0) {
if (strcmp(nconf->nc_protofmly, NC_INET) != 0)
return NULL;
client = getclnthandle(hostname, nconf, tgtaddr);
|
[-]
[+]
|
Changed |
_service:tar_git:libtirpc-1.3.4+git1.tar.bz2/upstream/src/svc_auth.c
^
|
@@ -66,6 +66,9 @@
extern SVCAUTH svc_auth_none;
+#ifdef AUTHDES_SUPPORT
+extern enum auth_stat _svcauth_des(struct svc_req *rqst, struct rpc_msg *msg);
+#endif
/*
* The call rpc message, msg has been obtained from the wire. The msg contains
* the raw form of credentials and verifiers. authenticate returns AUTH_OK
|
[-]
[+]
|
Changed |
_service:tar_git:libtirpc-1.3.4+git1.tar.bz2/upstream/tirpc/rpc/auth_gss.h
^
|
@@ -64,6 +64,8 @@
rpc_gss_svc_t svc; /* service */
gss_cred_id_t cred; /* cred handle */
u_int req_flags; /* req flags for init_sec_context */
+ int major_status;
+ int minor_status;
};
/* Private data required for kernel implementation */
|
[-]
[+]
|
Changed |
_service:tar_git:libtirpc.yaml
^
|
@@ -1,6 +1,6 @@
Name: libtirpc
Summary: Transport Independent RPC library (SunRPC replacement)
-Version: 1.3.3
+Version: 1.3.4
Release: 0
Group: Development/Libraries
License: GPLv2
|