text-base idmap patch

Ikebe Takashi iktaka99 at hotmail.com
Tue Apr 6 03:36:03 GMT 2004


Hi,
I rewrite my patch as module.
I have been testing this module as idmap_ldap.c, so I do not have patch for 
module initalization code(configure and Makefile).
Please add initialization to configure and Makefile.
This module working good whenever I tested.

ID map file path is /etc/samba/smbidmap. If there are no smbidmap, module 
make new map file and add new mapping.
Whenever you add this module to exiting samba, you need to delete old 
cache(on my env, /var/lib/samba/*.tdb).

Please feel free to let me know if there any bugs.
Thank you.

Stefan (metze) Metzmacher wrote:

> Takashi Ikebe wrote:
> 
>> Hi,
>> I made idmap patch based on samba 3.0.2a.
>> Attached patch maps sid to gid/uid with text base database.
>> The ldap server is good for big network, however small network does
>> not need such database.
>> By using this patch, you can use same uid with nis with text-base
>> configuration.
>>
>> Text base user database should be named as "smbidmap" and should be
>> placed on /etc/samba/smbidmap.
>> Format is below;
>> SID id(uid/gid) type(uid=1,gid=2)
>> for instance,
>> S-1-5-21-2581315262-1086050687-3579556021-**** 1012 1
>> This mean S-1-5-21-2581315262-1086050687-3579556021-**** is user's SID
>> and uid is 1012.
>>
>> I don't know this kind of patch is welcome, however I need this
>> function for my environment.
> 
> 
> Hi,
> 
> why haven't written this as idmap module?
> 
> try to add a file sam/idmap_text.c and put all stuff in there.
> 
> you need something like this at the end of the file:
> 
> static struct idmap_methods text_methods = {
>     text_idmap_init,
>     text_allocate_rid,
>     text_allocate_id,
>     text_get_sid_from_id,
>     text_get_id_from_sid,
>     text_set_mapping,
>     text_idmap_close,
>     text_idmap_status
> };
> 
> NTSTATUS idmap_ldap_init(void)
> {
>     return smb_register_idmap(SMB_IDMAP_INTERFACE_VERSION, "text", 
> &text_methods);
> }
> 
> above of this you just need to implement your versions of the 
> 
text_idmap_init,text_allocate_rid,text_allocate_id,text_get_sid_from_id,text_get_id_from_sid,text_set_mapping,text_idmap_close,text_idmap_status 

> 
> functions...
> 
> take a look at include/idmap.h and and sam/idmap_ldap.c for the 
> prototypes of this functions
> 
> you later can choose your backend by "idmap backend = text" in smb.conf
> 
> 
> 

-- 
Takashi Ikebe
e-mail : ikebe.takashi at lab.ntt.co.jp
e-mail : iktaka99 at hotmail.com

_________________________________________________________________
友達と24時間ホットライン「MSN メッセンジャー」、今すぐダウンロード!  
http://messenger.msn.co.jp 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: idmap_text.c
Type: application/octet-stream
Size: 9178 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20040406/0b68c825/idmap_text.obj


More information about the samba-technical mailing list