2002-05-13 Marcus Brinkmann <marcus@gnu.org>
authorRoland McGrath <roland@gnu.org>
Mon, 13 May 2002 01:48:25 +0000 (01:48 +0000)
committerRoland McGrath <roland@gnu.org>
Mon, 13 May 2002 01:48:25 +0000 (01:48 +0000)
        * hurd/hurdchdir.c (_hurd_change_directory_port_from_name):
        Allocate three, not two, more than LEN when appending '/.'.
        * sysdeps/mach/hurd/chroot.c (chroot): Likewise.  Don't check
        if NAME ends with '/.' if it is shorter than 2 chars.

* mach/Makefile ($(mach-syscalls:%=$(objpfx)%.S)): Make the generated
files #include <sysdep.h> instead of <mach/machine/syscall_sw.h>.

ChangeLog
hurd/hurdchdir.c
mach/Makefile
sysdeps/mach/hurd/chroot.c

index 34fa18bdd9dfa583efedc9d0e73d5993333419ef..1783ade4a8c6ea6be68df367cd29fb8053bc0386 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
+2002-05-13  Marcus Brinkmann  <marcus@gnu.org>
+
+        * hurd/hurdchdir.c (_hurd_change_directory_port_from_name):
+        Allocate three, not two, more than LEN when appending '/.'.
+        * sysdeps/mach/hurd/chroot.c (chroot): Likewise.  Don't check
+        if NAME ends with '/.' if it is shorter than 2 chars.
+
 2002-05-12  Roland McGrath  <roland@frob.com>
 
+       * mach/Makefile ($(mach-syscalls:%=$(objpfx)%.S)): Make the generated
+       files #include <sysdep.h> instead of <mach/machine/syscall_sw.h>.
+
        * hurd/hurdexec.c (_hurd_exec): Reauthenticate ports/dtable used in
        file_exec to effect svuid=euid, svgid=egid if that is not a no-op.
 
index 0c10a37d1b7f9ab120929298a66996abc0034cd8..5115e4d460d935958ee28ba229031a54ba4b7412 100644 (file)
@@ -40,7 +40,7 @@ _hurd_change_directory_port_from_name (struct hurd_port *portcell,
     lookup = name;
   else
     {
-      char *n = alloca (len + 2);
+      char *n = alloca (len + 3);
       memcpy (n, name, len);
       n[len] = '/';
       n[len + 1] = '.';
index a4e4c077f7f8e372e31859f55d63d0b7cf4e0278..cf274ceebb959282ae392da5c170ec61e004c249 100644 (file)
@@ -96,8 +96,8 @@ ifndef mach-syscalls
 no_deps=t
 else
 $(mach-syscalls:%=$(objpfx)%.S): $(objpfx)%.S: $(objpfx)mach-syscalls.mk
-       (echo '#include <mach/machine/syscall_sw.h>'; \
-        echo 'kernel_trap(__$*,$(sysno-$*),$(nargs-$*))'; \
+       (echo '#include <sysdep.h>'; \
+        echo 'kernel_trap (__$*,$(sysno-$*),$(nargs-$*))'; \
         echo 'weak_alias (__$*, $*)') > $@-new
         mv -f $@-new $@
 generated += $(mach-syscalls:=.S)
index 83f11bd17ee39a40f35fe435a1752ddbe7584b4c..fde01647137e7ddbe44bdbc6f1a48c60a693e8fd 100644 (file)
@@ -36,11 +36,11 @@ chroot (const char *path)
   /* Append trailing "/." to directory name to force ENOTDIR if it's not a
      directory and EACCES if we don't have search permission.  */
   len = strlen (path);
-  if (path[len - 2] == '/' && path[len - 1] == '.')
+  if (len >= 2 && path[len - 2] == '/' && path[len - 1] == '.')
     lookup = path;
   else
     {
-      char *n = alloca (len + 2);
+      char *n = alloca (len + 3);
       memcpy (n, path, len);
       n[len] = '/';
       n[len + 1] = '.';