Bug 12475 - bug in source3/smbd/smbXsrv_open.c -> smbXsrv_open_global_verify_record()
Summary: bug in source3/smbd/smbXsrv_open.c -> smbXsrv_open_global_verify_record()
Status: RESOLVED INVALID
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Other (show other bugs)
Version: 4.2.14
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Andrew Bartlett
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-21 16:08 UTC by YOUZHONG YANG
Modified: 2017-01-03 14:12 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description YOUZHONG YANG 2016-12-21 16:08:32 UTC
From: Youzhong Yang 
Sent: Monday, December 19, 2016 11:54 AM
To: samba-technical@lists.samba.org
Cc: Stefan Metzmacher <metze@samba.org>; Jeremy Allison <jra@samba.org>
Subject: true or false?

Hi,

While browsing samba code, I found something puzzling:

source3/smbd/smbXsrv_open.c -> smbXsrv_open_global_verify_record()

        if (server_id_is_disconnected(&global->server_id)) {
                exists = true;
        } else {
                exists = serverid_exists(&global->server_id);
        }
        if (!exists) {
                struct server_id_buf idbuf;
                DEBUG(2,("smbXsrv_open_global_verify_record: "
                         "key '%s' server_id %s does not exist.\n",
                         hex_encode_talloc(frame, key.dptr, key.dsize),
                         server_id_str_buf(global->server_id, &idbuf)));
                if (CHECK_DEBUGLVL(2)) {
                        NDR_PRINT_DEBUG(smbXsrv_open_globalB, &global_blob);
                }
                TALLOC_FREE(frame);
                dbwrap_record_delete(db_rec);
                *is_free = true;
                return;
        }

If server_id is disconnected, shouldn’t “exists” be set to false? Am I wrong?

Thanks,

-Youzhong