Disconnected Persistent Handles are NOT "stale" and must be preserved. But while
we're at it to check if the handle is connected or not, remember this
information so we can check this later in the open code.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
struct server_id_buf buf;
bool exists;
+ if (e->protect) {
+ SMB_ASSERT(!e->stale);
+ return false;
+ }
if (e->stale) {
+ SMB_ASSERT(!e->protect);
return true;
}
DBG_DEBUG("PID %s does not exist anymore\n",
server_id_str_buf(e->pid, &buf));
+ if (e->flags & SHARE_ENTRY_FLAG_PERSISTENT_OPEN) {
+ e->protect = true;
+ return false;
+ }
+
e->stale = true;
return true;