From: Roland McGrath Date: Mon, 13 May 2002 01:48:25 +0000 (+0000) Subject: 2002-05-13 Marcus Brinkmann X-Git-Tag: cvs/glibc-2-3~785 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ab7dd85bfbe9a176c2d5055d52185ae6364f97af;p=thirdparty%2Fglibc.git 2002-05-13 Marcus Brinkmann * 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 instead of . --- diff --git a/ChangeLog b/ChangeLog index 34fa18bdd9d..1783ade4a8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ +2002-05-13 Marcus Brinkmann + + * 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 + * mach/Makefile ($(mach-syscalls:%=$(objpfx)%.S)): Make the generated + files #include instead of . + * 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. diff --git a/hurd/hurdchdir.c b/hurd/hurdchdir.c index 0c10a37d1b7..5115e4d460d 100644 --- a/hurd/hurdchdir.c +++ b/hurd/hurdchdir.c @@ -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] = '.'; diff --git a/mach/Makefile b/mach/Makefile index a4e4c077f7f..cf274ceebb9 100644 --- a/mach/Makefile +++ b/mach/Makefile @@ -96,8 +96,8 @@ ifndef mach-syscalls no_deps=t else $(mach-syscalls:%=$(objpfx)%.S): $(objpfx)%.S: $(objpfx)mach-syscalls.mk - (echo '#include '; \ - echo 'kernel_trap(__$*,$(sysno-$*),$(nargs-$*))'; \ + (echo '#include '; \ + echo 'kernel_trap (__$*,$(sysno-$*),$(nargs-$*))'; \ echo 'weak_alias (__$*, $*)') > $@-new mv -f $@-new $@ generated += $(mach-syscalls:=.S) diff --git a/sysdeps/mach/hurd/chroot.c b/sysdeps/mach/hurd/chroot.c index 83f11bd17ee..fde01647137 100644 --- a/sysdeps/mach/hurd/chroot.c +++ b/sysdeps/mach/hurd/chroot.c @@ -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] = '.';