summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/contrib
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/contrib
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/contrib')
-rw-r--r--freebsd/sys/contrib/pf/net/pf.c10
-rw-r--r--freebsd/sys/contrib/pf/net/pf_ioctl.c6
2 files changed, 14 insertions, 2 deletions
diff --git a/freebsd/sys/contrib/pf/net/pf.c b/freebsd/sys/contrib/pf/net/pf.c
index bad7a1cd..8070caa4 100644
--- a/freebsd/sys/contrib/pf/net/pf.c
+++ b/freebsd/sys/contrib/pf/net/pf.c
@@ -2987,8 +2987,13 @@ pf_socket_lookup(int direction, struct pf_pdesc *pd)
#ifdef __FreeBSD__
if (inp_arg != NULL) {
INP_LOCK_ASSERT(inp_arg);
+#ifndef __rtems__
pd->lookup.uid = inp_arg->inp_cred->cr_uid;
pd->lookup.gid = inp_arg->inp_cred->cr_groups[0];
+#else /* __rtems__ */
+ pd->lookup.uid = BSD_DEFAULT_UID;
+ pd->lookup.gid = BSD_DEFAULT_GID;
+#endif /* __rtems__ */
return (1);
}
#endif
@@ -3085,8 +3090,13 @@ pf_socket_lookup(int direction, struct pf_pdesc *pd)
return (-1);
}
#ifdef __FreeBSD__
+#ifndef __rtems__
pd->lookup.uid = inp->inp_cred->cr_uid;
pd->lookup.gid = inp->inp_cred->cr_groups[0];
+#else /* __rtems__ */
+ pd->lookup.uid = BSD_DEFAULT_UID;
+ pd->lookup.gid = BSD_DEFAULT_GID;
+#endif /* __rtems__ */
INP_INFO_RUNLOCK(pi);
#else
pd->lookup.uid = inp->inp_socket->so_euid;
diff --git a/freebsd/sys/contrib/pf/net/pf_ioctl.c b/freebsd/sys/contrib/pf/net/pf_ioctl.c
index e1ef3fac..24f41d36 100644
--- a/freebsd/sys/contrib/pf/net/pf_ioctl.c
+++ b/freebsd/sys/contrib/pf/net/pf_ioctl.c
@@ -1489,10 +1489,11 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
}
bcopy(&pr->rule, rule, sizeof(struct pf_rule));
#ifdef __FreeBSD__
- rule->cuid = td->td_ucred->cr_ruid;
#ifndef __rtems__
+ rule->cuid = td->td_ucred->cr_ruid;
rule->cpid = td->td_proc ? td->td_proc->p_pid : 0;
#else /* __rtems__ */
+ rule->cuid = BSD_DEFAULT_UID;
rule->cpid = BSD_DEFAULT_PID;
#endif /* __rtems__ */
#else
@@ -1763,10 +1764,11 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
}
bcopy(&pcr->rule, newrule, sizeof(struct pf_rule));
#ifdef __FreeBSD__
- newrule->cuid = td->td_ucred->cr_ruid;
#ifndef __rtems__
+ newrule->cuid = td->td_ucred->cr_ruid;
newrule->cpid = td->td_proc ? td->td_proc->p_pid : 0;
#else /* __rtems__ */
+ newrule->cuid = BSD_DEFAULT_UID;
newrule->cpid = BSD_DEFAULT_PID;
#endif /* __rtems__ */
#else