Bug 7049 - Cross compilation without something like samba_cv_USE_SETRESUID=yes in config.site causes Samba to fail at runtime in hard to understand ways
Summary: Cross compilation without something like samba_cv_USE_SETRESUID=yes in config...
Status: RESOLVED WONTFIX
Alias: None
Product: Samba 3.4
Classification: Unclassified
Component: Build environment (show other bugs)
Version: 3.4.4
Hardware: Other Windows XP
: P3 normal
Target Milestone: ---
Assignee: Björn Jacke
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-19 12:17 UTC by Richard Sharpe
Modified: 2012-05-14 01:22 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Sharpe 2010-01-19 12:17:15 UTC
If you are cross compiling Samba with something like:

CONFIG_SITE=config.site ./configure --host=arm-none-linux-gnueabi --without-krb5 --without-ldap --without-ads --with-privatedir=/var/locks --with-lockdir=/var/locks --with-piddir=/var/locks --with-modulesdir=/lib/vfs --with-aio-support --disable-fam

and you do not have something like samba_cv_USE_SETRESUID=yes in config.site, you end up with problems in source3/lib/util_sec.c:set_effective_[gu]id et all, because they all have things like this:

void set_effective_gid(gid_t gid)
{
#if USE_SETRESUID
        setresgid(-1,gid,-1);
#endif

#if USE_SETREUID
        setregid(-1,gid);
#endif

#if USE_SETEUID
        setegid(gid);
#endif

#if USE_SETUIDX
        setgidx(ID_EFFECTIVE, gid);
#endif

        assert_gid(-1, gid);
}

If none of those USE_xxx symbols are set, nothing is done and you assert at runtime.

It would be useful for those doing cross compiles if there was something in there that caused a compile time error if none of those symbols is set/defined or perhaps a configure time error if none of them is defined in a cross compiling situation.
Comment 1 Richard Sharpe 2012-05-14 01:22:07 UTC
I guess it is too hard to do anything about this ...