framework for samba3 hosts

Gerald (Jerry) Carter jerry at
Tue Jul 26 04:09:57 GMT 2005

Hash: SHA1

Amit Regmi wrote:
| Hi all,
| I have to design Samba Framework in Python .
| Previously I was facing problems on the design
| issues and still am confused. What I have at
| hand is a script to make changes in the smb.conf file.
| What I also have at present are the classes
|   FileService class
|   PrintService class


Here some comments.  I know you are still getting
your feet wet, but ...


* Store you classes in file and import them so you
~  get code reuse.
* Don't hardcode path and values in your classes.
* class FileService should be a single share.
~  Therefore an AddShare() method doesn't make much
~  sense.  You should be able to create a new
~  file share by simply creating a new FileService
~  object.  This object would then be connected to
~  a SambaConf object to tie it to a configuration
~  file.


* Don't redefine the Server class, reuse code.
* Don't worry about checking the effective UID.
~  Let the OS do the security checks for you when
~  possible.
* Don't worry about wrapping existing tools just
~  for the sake of having a python wrapper.

| What I also want to do is come up with few
| functions like
|   replace_A_Line_In_Smb_conf()
|   edit_A_section_In_Smb_conf()

You already have this in the SambaConf object
I gave you.  You read in the file and then set
a service option.  Then just flush the file to disk.

cheers, jerry

Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird -


More information about the samba-technical mailing list