[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-337-g73e9693

boyang boyang at samba.org
Thu Jul 16 11:47:42 MDT 2009

Jeremy Allison wrote:
> On Wed, Jul 15, 2009 at 01:35:44AM +0800, boyang wrote:
> Ok, I think I have thought of a cleaner way to do this.
> We add a new message that smbd processes, REEVALUATE_SHARE,
> which gives the share name.
> On receipt of this message an smbd re-reads the share
> definition to get the new acl, then walks it's connection
> lists, and the file pointer lists and makes changes where
> needed (disconnection, modification of the conn->read_only
> field, modification of the fsp->can_write field).
> This will work for registry shares, where modification
> can only be done via tools connected to smbd (which can
> become_root() to send the message).
> For usershares, we modify the "net usershare" command to
> force an update in the timestamp of the containing directory
> (cerate and delete a dummy file for example, or maybe just
> changing the st_mode on the existing usershare file would
> do). Then smbd's notice this change by having the usershare
> directory added to the list of files whose timestamps we
> watch in lp_file_list_changed().
> Boyang, will this work for you ? Can you see any issues
> with this idea ?
Hi, Jeremy:
     I have finished the patch as your suggestion. Using poll-style
method to do this, and it can work. I didn't add the user share
directory to lp_file_list_changed, the reason is if only usershare was
changed, call reload_services() with lp_file_list_changed() evaluated to
false is expensive. It will reload all services, including printers,
somehow slow.

     Once the team decide to add reload_services() to child's main loop
[smbd_serever_connection_loop_once()], we can call
load_usershare_shares(true) within reload_services() to include
usershare. load_usershare_shares(false) is the original

     I didn't do the registry part.  The message register part  is easy.
I have to figure out  where  should we send  the message from.
I am not familiar with that part. :-) need to browse the code.

     Please review the patch in the attachment. If it is ok, I'll clean
comments and log messages and then commit. Which won't bother you
reverting it, again. :-) heihei
> Jeremy.

Bo Yang, Software Engineer, Suse Labs
GPG-key-ID   538C4C1A
Samba Team   boyang at samba.org    http://www.samba.org/
SUSE Linux   boyang at suse.de      http://www.novell.com/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: net_usershare_permission.diff
Type: text/x-patch
Size: 15778 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20090717/7af56667/attachment.bin>

More information about the samba-technical mailing list