GSoC Proposal: Enhanced Registry Configuration for Samba3

suheaven suheaven at gmail.com
Wed Apr 7 21:07:16 MDT 2010


Hello, Everyone:
 
My name is Hang Su, a student from china. This is my proposal for samba3's GSoC subject--"Add remote (RPC) support for Samba configuration". I have discussed this subject with obnox for about 3 weeks. I have submitted this proposal to Google gsoc application web site 1 week ago but get no comment till now. So I post it to the mail list hoping to get some advice from you. Thank you for taking your time reading my proposal and i will appreciat very much for your coment.
 
P.S: Have someone contacted obnox these days? I saw he was on line in IRC but couldn’t get reply from him…He’s the mentor of this subject. So I want to get some of his opinion on my proposal…

Application for Samba GSoC 2010 subject  
  --Enhanced Registry Configuration for Samba3(for the idea “Add remote (RPC) support for Samba configuration”)
   
Hang Su<suheaven at gmail.com>    
 1. Self Introduction & Personal Information  
  My name is Hang Su, a student from China. I'm in my first year for my doctor's degree of engineering (3 years in total) in the Graduate University of Chinese Academy of Sciences. My major is P2P and multimedia networks.
   I have 5 years' experience on C language and 4 years on C++. More detailed resume of mine is listed here: http://socghop.appspot.com/document/show/user/suheaven/resume_2010
    My Email: suheaven at gmail.com
   IRC nick name: alexaa 
   I usually hang on IRC around 9:00~11:30 AM and 14:00~22:30 in the timezone of GMT+8.     
 2. Ideas On The Subject “Add remote (RPC) support for Samba configuration”     
  2.1. Background of The Subject
    Now there exist 3 ways to access Samba’s registry based configuration: calling reg_api directly, using libsmbconf abstraction which will call reg_api finally, and using win_reg based methods. The former 2 are “local” methods which just call local functions and could only be used to configure registry of local Samba server. The win_reg based method could be used to configure both local and remote Samba server via rpc call remotely. But all the 3 ways would call the code of reg_api finally, even libsmbconf use reg_api to access the registry back backend, win_reg based method call reg_api finally in the code of win_reg rpc server.
   The different methods of calling reg_api make the code identity not very good and restrict the scale of operation target. So there need a new way to call the registry operation code to make all the methods identical.
   Binding reg_api to a local rpc client and calling it in a “remote like” way is a solution to this problem.    
 2.2. My Ideas on "Add remote (RPC) support for Samba configuration"    
 2.2.1. The whole subject could be carried out following the next 3 steps:  
  (1) Do a local bind to reg_api:
   Add a function reg_bind_local() to reg_api.c to do a local bind for reg_api. This function should call rpc_pipe_open_internal()  in  srv_pipe_hnd.c to create a local rpc_pipe_client. And the local client would be used in the following steps.
   In this step, rpc_pipe_open_internal() need a input parameter “dispatch”. Creating of this param could use the rpc_winreg_dispatch() in srv_winreg.c as a reference. rpc_winreg_dispatch() also call reg_api finally.    
The auth info could be supplied by calling functions in auth_util.c 
(2) Change net registry to use local bind of reg_api:  
  Currently, net registry directly calls reg_api. When the first step if finished, we could change net registry to call win_reg functions by passing the local rpc client created in the 1st step to rpccli_winreg_xxx(). This step makes net registry calling reg_api in a “remote like” way, and the reg_api functions would be called in win_reg rpc server side.  
  Actually, the effect of this step is same to adding a local mode to net_rpc_registry. By judging the configuration target and passing local rpc_pipe_client created in the 1st step to rpccli_winreg_xxx() functions when the target is local machine, net_rpc_registry will also have a local mode to finish registry operation without a real rpc pipe. And the reg_api is also called in win_reg server code.      
(3) Add remote support to libsmbconf
   This step is composed of 2 sub steps 
  (3.1) Abandon calling reg_api directly 
  After the 2 steps above, libsmbconf is the next target to be enhanced. libsmbconf calls rep_api to access the registry backend. So we could follow the idea of the 2nd step, switch libsmbconf to using the local bind+ rpccli_winreg_xxx method instead of calling reg_api directly. 
  This step mainly focuses on smbconf_reg.c. As smbconf_reg_xxx() functions use the same parameter list to the text based smbconf_txt_xxx() functions, 
  (3.2) Enable remote configuration of libsmbconf
   The sub step 3.1 gives libsmbconf the infrastructure of accessing registry in a rpc calling way, although step 3.1 only use a fake local rpc pipe. If we pass a real remote rpc pipe client to libsmbconf now, it could also access the remote samba server’s registry.
   To create the real remote rpc pipe, we need further information about the target remote machine, such as the domain name, user name, password, etc. These information could be fetched in the following ways:
   User input. The user of “net conf” utility should input the information needed to establish a rpc bind as part of input arguments, such as server ip: port, username, and password, etc.
   Copy the information from another rpc pipe      
2.2.2. Test of The Code
   testsuit.c under lib/smbconf could be used to test new functionalities added to libsmbconf.by modifying some code and give extra connection info needed to establish remote bind. I have a laptop and 2 desktop PC to carry out remote test suits.
   To test the new functionalities of “net_registry”/”net_rpc_registry” and “net conf”, running the utility and call the new functionalities accordingly is also a necessary step.   
 3.My Time zone 
   I'm in GMT+8, Beijing China
 




suheaven
2010-04-06


More information about the samba-technical mailing list