true or false?
Youzhong Yang
Youzhong.Yang at mathworks.com
Tue Jan 3 14:10:23 UTC 2017
Thanks, I see that server_id_set_disconnected() has its special purpose.
-----Original Message-----
From: Ralph Böhme [mailto:slow at samba.org]
Sent: Tuesday, January 03, 2017 6:34 AM
To: Youzhong Yang <Youzhong.Yang at mathworks.com>
Cc: samba-technical at lists.samba.org
Subject: Re: true or false?
On Mon, Dec 19, 2016 at 04:54:00PM +0000, Youzhong Yang wrote:
> 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?
for disconnected durable opens server_id_is_disconnected() will return true, but we obviously don't want to delete the open record, otherwise the open wouldn't be ....ehh... very durable. :)
Cheerio!
-slow
More information about the samba-technical
mailing list