[Samba] Migrating from TNG to 2.2

Martin Hermanowski martin at martin.mh57.net
Fri Sep 6 10:04:13 GMT 2002


On Thu, Sep 05, 2002 at 03:56:54PM +0100, Tom Crummey wrote:
> The problem is that when using a smbpasswd file, TNG and samba calculate
> the RID's in different ways. This means that the ownerships of all the
> files are wrong. We had this problem and we've had to change the formula
> for calculating RIDs in samba.
> 
> The line you need to change is in 
> 
> source/include/rpc_misc.h
> 
> Line 63:
> #define RID_MULTIPLIER 2
> 
> Change to:
> 
> /* This was originally '2' - Lee Heagney 02/08/02 */
> #define RID_MULTIPLIER 4

This did work!

But I don't like the fact that I need to patch every future version of
Samba. These are all lines containing RID_MULTIPLIER:

,----[ grep -r RID_MULTIPLIER ]
| include/rpc_misc.h:#define RID_MULTIPLIER 4
| lib/domain_namemap.c:   return ((user_rid & (~RID_TYPE_USER))- 1000)/RID_MULTIPLIER;
| lib/domain_namemap.c:   return ((group_rid & (~RID_TYPE_GROUP))- 1000)/RID_MULTIPLIER;
| lib/domain_namemap.c:   return ((alias_rid & (~RID_TYPE_ALIAS))- 1000)/RID_MULTIPLIER;
| lib/domain_namemap.c:   uint32 grp_rid = ((((gid)*RID_MULTIPLIER) + 1000) | RID_TYPE_GROUP);
| lib/domain_namemap.c:   uint32 alias_rid = ((((gid)*RID_MULTIPLIER) + 1000) | RID_TYPE_ALIAS);
| lib/domain_namemap.c:   uint32 user_rid = ((((uid)*RID_MULTIPLIER) + 1000) | RID_TYPE_USER);
| passdb/passdb.c:        return (uid_t)(((user_rid & (~USER_RID_TYPE))- 1000)/RID_MULTIPLIER);
| passdb/passdb.c:        return (uid_t)(((user_rid & (~GROUP_RID_TYPE))- 1000)/RID_MULTIPLIER);
| passdb/passdb.c:        return (((((uint32)uid)*RID_MULTIPLIER) + 1000) | USER_RID_TYPE);
| passdb/passdb.c:  return (((((uint32)gid)*RID_MULTIPLIER) + 1000) | GROUP_RID_TYPE);
`----

It seems that if I double the user/group ids in my /etc/(passwd|group)
it does work with a vanilla samba. So is this the way to go?

Regards,
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba/attachments/20020906/a51d0eb1/attachment.bin


More information about the samba mailing list