diff options
author | des <des@FreeBSD.org> | 2001-10-27 11:15:19 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2001-10-27 11:15:19 +0000 |
commit | f5a4c275f57e9f019767cbb7315bdf1eb0612c62 (patch) | |
tree | 17c20972c13b4a9de6a8d9b1514a15c03f12e59f /sys/compat/linux | |
parent | 6f69985e93c752e175036d79097afa859dfd8465 (diff) | |
download | FreeBSD-src-f5a4c275f57e9f019767cbb7315bdf1eb0612c62.zip FreeBSD-src-f5a4c275f57e9f019767cbb7315bdf1eb0612c62.tar.gz |
Eliminate the prefix parameter to linux_emul_find(), which was always
linux_emul_path anyway. Linux_emul_find() has interesting bugs in its
prefix handling (which luckily are not currently exploitable); this
commit is preliminary to an attempt at cleaning it up.
Approved by: marcel
Diffstat (limited to 'sys/compat/linux')
-rw-r--r-- | sys/compat/linux/linux_util.c | 6 | ||||
-rw-r--r-- | sys/compat/linux/linux_util.h | 6 |
2 files changed, 5 insertions, 7 deletions
diff --git a/sys/compat/linux/linux_util.c b/sys/compat/linux/linux_util.c index 45c85b6..c30d0f4 100644 --- a/sys/compat/linux/linux_util.c +++ b/sys/compat/linux/linux_util.c @@ -50,10 +50,9 @@ const char linux_emul_path[] = "/compat/linux"; * be in exists. */ int -linux_emul_find(td, sgp, prefix, path, pbuf, cflag) +linux_emul_find(td, sgp, path, pbuf, cflag) struct thread *td; caddr_t *sgp; /* Pointer to stackgap memory */ - const char *prefix; char *path; char **pbuf; int cflag; @@ -63,15 +62,16 @@ linux_emul_find(td, sgp, prefix, path, pbuf, cflag) struct vattr vat; struct vattr vatroot; int error; + const char *prefix; char *ptr, *buf, *cp; size_t sz, len; buf = (char *) malloc(MAXPATHLEN, M_TEMP, M_WAITOK); *pbuf = path; + prefix = linux_emul_path; for (ptr = buf; (*ptr = *prefix) != '\0'; ptr++, prefix++) continue; - sz = MAXPATHLEN - (ptr - buf); /* diff --git a/sys/compat/linux/linux_util.h b/sys/compat/linux/linux_util.h index 43aed1f..e01f260 100644 --- a/sys/compat/linux/linux_util.h +++ b/sys/compat/linux/linux_util.h @@ -76,15 +76,13 @@ stackgap_alloc(sgp, sz) extern const char linux_emul_path[]; -int linux_emul_find __P((struct thread *, caddr_t *, const char *, char *, - char **, int)); +int linux_emul_find __P((struct thread *, caddr_t *, char *, char **, int)); #define CHECKALT(p, sgp, path, i) \ do { \ int _error; \ \ - _error = linux_emul_find(p, sgp, linux_emul_path, path, \ - &path, i); \ + _error = linux_emul_find(p, sgp, path, &path, i); \ if (_error == EFAULT) \ return (_error); \ } while (0) |