[Samba] is it safe to encode/decode uid_t/gid_t in 4 bytes?

haihua yang hhyangdev at gmail.com
Tue Nov 21 02:08:30 UTC 2023


Hi,
Samba internally uses 8 bytes to encode/decode uid_t/gid_t, e.g.,

_PUBLIC_ enum ndr_err_code ndr_push_uid_t(struct ndr_push *ndr, int
ndr_flags, uid_t u)
{
        NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
        return ndr_push_hyper(ndr, NDR_SCALARS, (uint64_t)u);
}

I want to know if it is safe to use 4 bytes to reduce the size in storing
security_info in tdb.
I am not aware of if there is any platform on which uid_t or gid_t is
64bits, and it seems that the encoded data is not sent over the network.

Thanks,


More information about the samba mailing list