mirror of git://sourceware.org/git/glibc.git
2001-05-19 Roland McGrath <roland@frob.com>
* hurd/hurdlookup.c (__hurd_file_name_lookup_retry): Don't leak the result port when failing with ELOOP. Do the ELOOP check when following an absolute symlink target as well as relative. Remove #ifdef SYMLOOP_MAX conditional--it should always be defined.
This commit is contained in:
parent
0e17ee3c71
commit
a500fbcd53
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 1992, 93, 94, 95, 96, 97, 99 Free Software Foundation, Inc.
|
/* Copyright (C) 1992,93,94,95,96,97,99,2001 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
|
|
@ -164,10 +164,11 @@ __hurd_file_name_lookup_retry (error_t (*use_init_port)
|
||||||
/* Fall through. */
|
/* Fall through. */
|
||||||
|
|
||||||
case FS_RETRY_NORMAL:
|
case FS_RETRY_NORMAL:
|
||||||
#ifdef SYMLOOP_MAX
|
|
||||||
if (nloops++ >= SYMLOOP_MAX)
|
if (nloops++ >= SYMLOOP_MAX)
|
||||||
|
{
|
||||||
|
__mach_port_deallocate (__mach_task_self (), *result);
|
||||||
return ELOOP;
|
return ELOOP;
|
||||||
#endif
|
}
|
||||||
|
|
||||||
/* An empty RETRYNAME indicates we have the final port. */
|
/* An empty RETRYNAME indicates we have the final port. */
|
||||||
if (retryname[0] == '\0' &&
|
if (retryname[0] == '\0' &&
|
||||||
|
|
@ -240,6 +241,8 @@ __hurd_file_name_lookup_retry (error_t (*use_init_port)
|
||||||
dirport = INIT_PORT_CRDIR;
|
dirport = INIT_PORT_CRDIR;
|
||||||
if (*result != MACH_PORT_NULL)
|
if (*result != MACH_PORT_NULL)
|
||||||
__mach_port_deallocate (__mach_task_self (), *result);
|
__mach_port_deallocate (__mach_task_self (), *result);
|
||||||
|
if (nloops++ >= SYMLOOP_MAX)
|
||||||
|
return ELOOP;
|
||||||
file_name = &retryname[1];
|
file_name = &retryname[1];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue