mirror of
https://github.com/samba-team/samba.git
synced 2025-01-21 18:04:06 +03:00
handle being passed a dptr of -1 to mean "close all open dir handles".
Looks like OS/2 does this. It caused a core dump. (This used to be commit 4b2579daae0a9d78780476694fd395d97445e197)
This commit is contained in:
parent
3ae4d22406
commit
341a401b48
@ -186,6 +186,19 @@ close a dptr
|
||||
****************************************************************************/
|
||||
void dptr_close(int key)
|
||||
{
|
||||
/* OS/2 seems to use -1 to indicate "close all directories" */
|
||||
if (key == -1) {
|
||||
int i;
|
||||
for (i=0;i<NUMDIRPTRS;i++)
|
||||
dptr_close(i);
|
||||
return;
|
||||
}
|
||||
|
||||
if (key < 0 || key >= NUMDIRPTRS) {
|
||||
DEBUG(3,("Invalid key %d given to dptr_close\n",key));
|
||||
return;
|
||||
}
|
||||
|
||||
if (dirptrs[key].valid) {
|
||||
DEBUG(4,("closing dptr key %d\n",key));
|
||||
if (dirptrs[key].ptr) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user