Well, at first glace it does seems my guess is right.
I have downloaded samba 3.0.28aorig.tar.gz (need to learn the command to extract sources and apply ubuntu patches) and found this in util_sec.c:
void set_effective_gid(gid_t gid)
{
#if USE_SETRESUID
setresgid(-1,gid,-1);
#endif
There is also:
void set_effective_uid(uid_t uid)
{
#if USE_SETRESUID
/* Set the effective as well as the real uid. */
if (setresuid(uid,uid,-1) == -1) {
if (errno == EAGAIN) {
DEBUG(0, ("setresuid failed with EAGAIN. uid(%d) "
"might be over its NPROC limit\n",
(int)uid));
}
}
#endif
Looks like to me these -1 need to be casted to uid_t or gid_t for 64 bits machine to work.
But I am really not a true programmer, so I might be wrong... still, it looks bad to me.
I'll take a look at jaunty version to see if it is done the same way.
Well, at first glace it does seems my guess is right. gid(gid_ t gid) -1,gid, -1);
I have downloaded samba 3.0.28aorig.tar.gz (need to learn the command to extract sources and apply ubuntu patches) and found this in util_sec.c:
void set_effective_
{
#if USE_SETRESUID
setresgid(
#endif
#if USE_SETREUID
setregid(-1,gid);
#endif
#if USE_SETEUID
setegid(gid);
#endif
#if USE_SETUIDX ID_EFFECTIVE, gid);
setgidx(
#endif
assert_gid(-1, gid);
}
There is also: uid(uid_ t uid) uid,uid, -1) == -1) {
void set_effective_
{
#if USE_SETRESUID
/* Set the effective as well as the real uid. */
if (setresuid(
if (errno == EAGAIN) {
DEBUG(0, ("setresuid failed with EAGAIN. uid(%d) "
"might be over its NPROC limit\n",
(int)uid));
}
}
#endif
#if USE_SETREUID
setreuid(-1,uid);
#endif
#if USE_SETEUID
seteuid(uid);
#endif
#if USE_SETUIDX ID_EFFECTIVE, uid);
setuidx(
#endif
assert_uid(-1, uid);
}
Looks like to me these -1 need to be casted to uid_t or gid_t for 64 bits machine to work.
But I am really not a true programmer, so I might be wrong... still, it looks bad to me.
I'll take a look at jaunty version to see if it is done the same way.