Storing pipe opens in the share_mode db ?
Stefan (metze) Metzmacher
metze at samba.org
Thu Jun 8 05:45:09 GMT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Gerald (Jerry) Carter schrieb:
> Jeremy & Volker,
> I'm working on the Open Files enumeration in MMC.
> Here's a screenshot of what's working.
> Next, I need to be able to enumerate pipe opens across
> all smbd process which means I need to store them in a db.
> I am thinking about just using the share_mode db. Any objections
> to this? I believe that set_share_mode() when opening the pipe
> and del_share_mode() when closing the pipe is all I need.
> But I need to fake up a dev & inode pair. Any warnings
> or suggestions about this? Do either of you think this is
> a horrible idea
have you thought about how to create a unique uint32 id for the returned
files? the numbers are unique between multiple connections.
In samba4 I planed to implement this via internal messaging,
so all smb connections are asked for open files, when a NetFileEnum()
comes in, but the unique ids were my big problem, as uint32 has to
little bits to use something like this:
uint32 id = ((uint32)conn_id<<64) | (uint32 tcon_id)>>32| (uint32)fnum;
(uint32 fnum because of smb2)
hmm, but for samba3 it might be ok, to use maybe this:
uint32 id = conn_id << 15 | (0x8FFF|fnum);
so 17 or 18 bits for the connection (pid in samba3) and 14-15 bits for
the fnum, as fnum's are not allocated per tcon in samba3.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the samba-technical