Fix bugs in opendir() and add extra checks to ensure functionality in all cases
Fix bugs in opendir() and add extra checks to ensure functionality in all cases

IljaN/core,whitekiba/server,jbicha/server,lrytz/core,IljaN/core,owncloud/core,Ardinis/server,michaelletzgus/nextcloud-server,endsguy/server,bluelml/core,endsguy/server,lrytz/core,xx621998xx/server,pixelipo/server,xx621998xx/server,xx621998xx/server,jbicha/server,Ardinis/server,bluelml/core,pmattern/server,cernbox/core,pmattern/server,pmattern/server,michaelletzgus/nextcloud-server,IljaN/core,nextcloud/server,sharidas/core,jbicha/server,bluelml/core,cernbox/core,jbicha/server,whitekiba/server,Ardinis/server,xx621998xx/server,whitekiba/server,pmattern/server,nextcloud/server,pollopolea/core,sharidas/core,lrytz/core,whitekiba/server,sharidas/core,nextcloud/server,phil-davis/core,lrytz/core,andreas-p/nextcloud-server,Ardinis/server,owncloud/core,IljaN/core,sharidas/core,lrytz/core,whitekiba/server,andreas-p/nextcloud-server,michaelletzgus/nextcloud-server,owncloud/core,pollopolea/core,jbicha/server,cernbox/core,bluelml/core,pixelipo/server,IljaN/core,owncloud/core,andreas-p/nextcloud-server,pixelipo/server,andreas-p/nextcloud-server,andreas-p/nextcloud-server,cernbox/core,Ardinis/server,endsguy/server,pmattern/server,michaelletzgus/nextcloud-server,pollopolea/core,owncloud/core,sharidas/core,pollopolea/core,cernbox/core,nextcloud/server,xx621998xx/server,endsguy/server,endsguy/server,pollopolea/core,pixelipo/server,bluelml/core,pixelipo/server