From 341a401b4802b2759092819ab5e50fe237a406d9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 5 May 1996 11:23:23 +0000 Subject: 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) --- source3/smbd/dir.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source3/smbd/dir.c') diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index ac6f918b9d..214b28dad0 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -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) { + 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) { -- cgit