samba-tool and samdb.py: abilty to set/list/remove individual attributes

Pierre-Francois CARPENTIER carpentier.pf at gmail.com
Mon Mar 30 04:01:55 MDT 2015


Hello,

I've poked around python-samba this WE in order to enable fine grained
management of user and group attributes:

https://gist.github.com/kakwa/cf1e36f7b8d32763d0ee

it adds the following methods to SamDB:
* rmuserattr : remove a user attribute
* rmgroupattr : remove a group attribute
* setuserattr: set a user attribute
* setgroupattr: set a group attribute
* getuserattr: get a list of  a user's attribute(s)
* getgroupattr: get a list of  a group's attribute(s)

I would not consider this code "production ready" (lack of test/unit test,
rough exception handling, special cases like binary data not handled
properly... keep in mind it's only a WE work ^^), but it could give an idea
on how to implement them.

On a related subject, it could be nice to have a formatted and "parsable"
output format (yaml?) for entry/entries listing.

I've already post this on IRC, but the channel seems a bit dead.

Pierre-Francois Carpentier


More information about the samba-technical mailing list