summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoug <doug@openbsd.org>2015-08-26 05:20:06 +0000
committerdoug <doug@openbsd.org>2015-08-26 05:20:06 +0000
commit826a739bf5cf955e4c2a554e39a66dd0c58c658e (patch)
tree4d459d0c7645db785956d518e9947341ca27bea9
parentsync (diff)
downloadwireguard-openbsd-826a739bf5cf955e4c2a554e39a66dd0c58c658e.tar.xz
wireguard-openbsd-826a739bf5cf955e4c2a554e39a66dd0c58c658e.zip
Convert paths argument of tame(2) to const char **.
The path will not be modified and this reduces casts. Discussed with many. ok deraadt@
-rw-r--r--lib/libc/sys/tame.26
-rw-r--r--sys/kern/kern_tame.c6
-rw-r--r--sys/kern/syscalls.master4
-rw-r--r--sys/sys/syscallargs.h4
-rw-r--r--sys/sys/tame.h4
5 files changed, 12 insertions, 12 deletions
diff --git a/lib/libc/sys/tame.2 b/lib/libc/sys/tame.2
index 0e3ebe7b75f..6551525e7ec 100644
--- a/lib/libc/sys/tame.2
+++ b/lib/libc/sys/tame.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tame.2,v 1.17 2015/08/22 20:18:50 deraadt Exp $
+.\" $OpenBSD: tame.2,v 1.18 2015/08/26 05:20:06 doug Exp $
.\"
.\" Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: August 22 2015 $
+.Dd $Mdocdate: August 26 2015 $
.Dt TAME 2
.Os
.Sh NAME
@@ -23,7 +23,7 @@
.Sh SYNOPSIS
.In sys/tame.h
.Ft int
-.Fn tame "int flags" "char *paths[]"
+.Fn tame "int flags" "const char *paths[]"
.Sh DESCRIPTION
The current process is forced into a restricted-service operating mode.
A few subsets are available, roughly described as computation, memory
diff --git a/sys/kern/kern_tame.c b/sys/kern/kern_tame.c
index 666d1e24752..1b5265c6af0 100644
--- a/sys/kern/kern_tame.c
+++ b/sys/kern/kern_tame.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_tame.c,v 1.29 2015/08/25 15:35:44 jsg Exp $ */
+/* $OpenBSD: kern_tame.c,v 1.30 2015/08/26 05:20:06 doug Exp $ */
/*
* Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org>
@@ -206,7 +206,7 @@ sys_tame(struct proc *p, void *v, register_t *retval)
{
struct sys_tame_args /* {
syscallarg(int) flags;
- syscallarg(char **)paths;
+ syscallarg(const char **)paths;
} */ *uap = v;
int flags = SCARG(uap, flags);
@@ -227,7 +227,7 @@ sys_tame(struct proc *p, void *v, register_t *retval)
}
if (SCARG(uap, paths)) {
- char **u = SCARG(uap, paths), *sp;
+ const char **u = SCARG(uap, paths), *sp;
struct whitepaths *wl;
char *cwdpath = NULL, *path;
size_t cwdpathlen, cwdlen, len, maxargs = 0;
diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master
index 3df64cd17c5..5c778538d76 100644
--- a/sys/kern/syscalls.master
+++ b/sys/kern/syscalls.master
@@ -1,4 +1,4 @@
-; $OpenBSD: syscalls.master,v 1.156 2015/08/22 20:18:49 deraadt Exp $
+; $OpenBSD: syscalls.master,v 1.157 2015/08/26 05:20:06 doug Exp $
; $NetBSD: syscalls.master,v 1.32 1996/04/23 10:24:21 mycroft Exp $
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
@@ -225,7 +225,7 @@
106 STD { int sys_listen(int s, int backlog); }
107 STD { int sys_chflagsat(int fd, const char *path, \
u_int flags, int atflags); }
-108 STD { int sys_tame(int flags, char **paths); }
+108 STD { int sys_tame(int flags, const char **paths); }
109 STD { int sys_ppoll(struct pollfd *fds, \
u_int nfds, const struct timespec *ts, \
const sigset_t *mask); }
diff --git a/sys/sys/syscallargs.h b/sys/sys/syscallargs.h
index 04aff28c321..2407fa256e0 100644
--- a/sys/sys/syscallargs.h
+++ b/sys/sys/syscallargs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: syscallargs.h,v 1.169 2015/08/22 20:18:50 deraadt Exp $ */
+/* $OpenBSD: syscallargs.h,v 1.170 2015/08/26 05:20:06 doug Exp $ */
/*
* System call argument lists.
@@ -546,7 +546,7 @@ struct sys_chflagsat_args {
struct sys_tame_args {
syscallarg(int) flags;
- syscallarg(char **) paths;
+ syscallarg(const char **) paths;
};
struct sys_ppoll_args {
diff --git a/sys/sys/tame.h b/sys/sys/tame.h
index 7346f439d99..52866ce1d8c 100644
--- a/sys/sys/tame.h
+++ b/sys/sys/tame.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tame.h,v 1.4 2015/08/22 20:18:50 deraadt Exp $ */
+/* $OpenBSD: tame.h,v 1.5 2015/08/26 05:20:06 doug Exp $ */
/*
* Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org>
@@ -97,7 +97,7 @@ struct whitepaths {
#else /* _KERNEL */
-int tame(int, char **);
+int tame(int, const char **);
#endif /* _KERNEL */