Status Update -- Python Management Framework for Samba

Amit Regmi amitregmi at neolinuxsolutions.com
Mon Aug 1 17:15:53 GMT 2005


So far what I have come up with is a number of classes that are used to 
come up with the "most common parameters" that Samba configuration file 
deals with. Now for a server configuration I have distributed those 
parameter bulk into approx 20 classes.

  Basic class :
      It covers the Basic parameters in the Server , Fileshare and 
Printshare configurations
      and includes parameters like

                comment, path, netbiosname , workgroup , server string,  
etc >

  Tuning class:
      it covers the methods to fine tune the Share and Server 
configurations .
      includes parameters like
                max smbd connections , keepalive, socket options, max 
open files, ---- for Global
                maxconnections , write cache size, strict allocation ,
                strict sync , minprint 
space                                      ---- for file and print shares

  Browse class:
      covers
                browseable , OS level , preferred master , local master, 
browse list , enhanced browsing

  Protocol Class:
                Protocol , smb ports, max protocol, min protocol , nt 
pipe support , disable netbios, time server,                          nt 
acl support, client signing , name resolve order ,

  FilenameHandling Class :

                 case sensitive, preserve case, short preserve case, 
mangle case , hide dot files,
                   delete veto, hide files, veto files, map system , map 
hidden , map archive, mangled map

  Locking class :

                 blocking locks , locking , oplocks , posix locking , 
strict locking , share modes , fake oplocks

  printing class :

          printing , cups options, lpq command, lppause command .....
          printcap name , load printers , delete printed command , 
addprinter command ,
          max reported print job , printable , printer name ....

  Logon class :
          add user script , delete user script , logon script , logon 
drive , logon path , logon home
          domain logons , shutdown script

  WINS class :
          dns proxy , wins proxy , wins server, wins support , wins hook

  LogFile class :
          includes parameters related to the log files       LDAP class :

  Winbind class :

  Security class :
          includes parameters that handle the server and share security .

          server security

               security , auth methods, encrypt passwords , null 
passwords, password server, smb passwd file ,
               username level , unix passwd sync, root dir , guest 
account , private dir , username map

          share security

               force user , force group , inherit permissions , guest 
only , only user , writable
               username , invalid users, valid users, admin users , read 
list , security mask , directory
               mask , create mask ......

  Miscellaneous class :

          remaining but frequent parameters ..

                   follow symlinks , wide links , postexec , root 
preexec , root postexec , delete readonly ,
                   dos file mode , fstyps , volume , dont descend ......


Now based upon these classes there would be three MAIN  classes
a)     ServerClass
b)     FileShareClass
c)    PrintShareClass

The Objects Distribution for classes ...

  ServerClass
      Basic
      Security
      Tuning
      Locking
      Protocol
      Printing
      FilenameHandling
      Logon Options
      Browse
      WINS         LDAP
      winbind
      Miscellaneous

  FileShareClass
      Basic
      Security
      Protocol
      Tuning
      FilenameHandling
      Browse
      Locking
      Miscellaneous

  PrintShareClass
      Basic
      Security
      Tuning
      Browsing
      Miscellaneous
      Printing Options
      UserAccountsClass
   



At present I am dealing with the functions for Each of the Main Classes 
designed so far ..
What would be a test file look ??

  A client's use of the Library (framework :-)) would be like this :

    import sys
from ServerClass import Server  from FileShareClass import FileShare

if __name__ == "__main__":
    s = Server("/home/amit/test/smb.conf")
  s.Basic.Workgroup(" workgroupnamE ")
  s.Basic.NetBIOSname(" my computer ")
    s.Security.EncryptPasswords("yes")

  s.FilenameHandling.HideDotFiles("yes","comment here")

  S.Browse.Browseable("yes")
  s.CommitChanges()

  s1 = FileShare("mama")
  s1.Basic.Path("/home/amit")
  s1.Basic.Comment(" comment for the share name")
  s1.Security.ReadOnly("yes")
  s1.Security.Writable("yes")

  s.AddShare(s1)

  print "done"


============================================================================================================

I would really be glad to hear suggestions .


-- 
-Amit

<amit at samba dot org>
http://www.geocities.com/broamit
http://www.pythong.blog.com/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQBC3HHp/u1Xr7tKTYARAv6eAJoDpKVv45v/M7NSH+xekpX6jasBJACeLcB/
lSIVQ0AMXFQrKPLZFOd6Qno=
=Tltk
-----END PGP SIGNATURE-----




More information about the samba-technical mailing list