summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/netinet
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-10-10 16:11:02 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-10-31 13:18:47 +0100
commit69b29a0c0d5bfddff5c6723ac80c0f6967550900 (patch)
treec2b180f3fea5010fbe848bdc9fa359116ef0126b /freebsd/sys/netinet
parentUse default PID value for all process identifiers (diff)
downloadrtems-libbsd-69b29a0c0d5bfddff5c6723ac80c0f6967550900.tar.bz2
Disable user credentials and use default values
Diffstat (limited to 'freebsd/sys/netinet')
-rw-r--r--freebsd/sys/netinet/in_pcb.c4
-rw-r--r--freebsd/sys/netinet/ipfw/ip_fw2.c16
-rw-r--r--freebsd/sys/netinet/tcp_syncache.c4
3 files changed, 22 insertions, 2 deletions
diff --git a/freebsd/sys/netinet/in_pcb.c b/freebsd/sys/netinet/in_pcb.c
index 9fd9536e..b336164b 100644
--- a/freebsd/sys/netinet/in_pcb.c
+++ b/freebsd/sys/netinet/in_pcb.c
@@ -385,8 +385,12 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *nam, in_addr_t *laddrp,
ntohl(t->inp_laddr.s_addr) != INADDR_ANY ||
(t->inp_socket->so_options &
SO_REUSEPORT) == 0) &&
+#ifndef __rtems__
(inp->inp_cred->cr_uid !=
t->inp_cred->cr_uid))
+#else /* __rtems__ */
+ 0)
+#endif /* __rtems__ */
return (EADDRINUSE);
}
t = in_pcblookup_local(pcbinfo, sin->sin_addr,
diff --git a/freebsd/sys/netinet/ipfw/ip_fw2.c b/freebsd/sys/netinet/ipfw/ip_fw2.c
index dd0c2fea..4328c50e 100644
--- a/freebsd/sys/netinet/ipfw/ip_fw2.c
+++ b/freebsd/sys/netinet/ipfw/ip_fw2.c
@@ -717,11 +717,19 @@ check_uidgid(ipfw_insn_u32 *insn, int proto, struct ifnet *oif,
}
}
if (insn->o.opcode == O_UID)
+#ifndef __rtems__
match = ((*uc)->cr_uid == (uid_t)insn->d[0]);
+#else /* __rtems__ */
+ match = (BSD_DEFAULT_UID == (uid_t)insn->d[0]);
+#endif /* __rtems__ */
else if (insn->o.opcode == O_GID)
match = groupmember((gid_t)insn->d[0], *uc);
else if (insn->o.opcode == O_JAIL)
+#ifndef __rtems__
match = ((*uc)->cr_prison->pr_id == (int)insn->d[0]);
+#else /* __rtems__ */
+ match = (BSD_DEFAULT_PRISON->pr_id == (int)insn->d[0]);
+#endif /* __rtems__ */
return match;
#endif /* __FreeBSD__ */
}
@@ -1389,9 +1397,17 @@ do { \
#ifdef __FreeBSD__
&ucred_cache, args->inp);
if (v == 4 /* O_UID */)
+#ifndef __rtems__
key = ucred_cache->cr_uid;
+#else /* __rtems__ */
+ key = BSD_DEFAULT_UID;
+#endif /* __rtems__ */
else if (v == 5 /* O_JAIL */)
+#ifndef __rtems__
key = ucred_cache->cr_prison->pr_id;
+#else /* __rtems__ */
+ key = BSD_DEFAULT_PRISON->pr_id;
+#endif /* __rtems__ */
#else /* !__FreeBSD__ */
(void *)&ucred_cache,
(struct inpcb *)args->m);
diff --git a/freebsd/sys/netinet/tcp_syncache.c b/freebsd/sys/netinet/tcp_syncache.c
index 04f321ab..4dc1208f 100644
--- a/freebsd/sys/netinet/tcp_syncache.c
+++ b/freebsd/sys/netinet/tcp_syncache.c
@@ -735,7 +735,7 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m)
thread0.td_ucred)) != 0) {
#else /* __rtems__ */
if ((error = in6_pcbconnect(inp, (struct sockaddr *)&sin6,
- rtems_bsd_thread0_ucred)) != 0) {
+ NULL)) != 0) {
#endif /* __rtems__ */
inp->in6p_laddr = laddr6;
if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) {
@@ -775,7 +775,7 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m)
thread0.td_ucred)) != 0) {
#else /* __rtems__ */
if ((error = in_pcbconnect(inp, (struct sockaddr *)&sin,
- rtems_bsd_thread0_ucred)) != 0) {
+ NULL)) != 0) {
#endif /* __rtems__ */
inp->inp_laddr = laddr;