Bug 3426 - "PANIC: failed to set gid" on mipsel when starting smbd
"PANIC: failed to set gid" on mipsel when starting smbd
Status: ASSIGNED
Product: Samba 3.0
Classification: Unclassified
Component: Build environment
3.0.21a
Other Linux
: P3 normal
: none
Assigned To: Tim Potter
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-01-19 06:47 UTC by Tomasz Chmielewski
Modified: 2006-01-28 02:17 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Chmielewski 2006-01-19 06:47:22 UTC
I compiled Samba 3.0.21a for mipsel / uclibc.

smbd doesn't want to start; it quits with:

[2006/01/19 12:29:09, 0] lib/util_sec.c:assert_gid(113)
  Failed to set gid privileges to (-1,65534) now set to (0,0) uid=(0,0)
[2006/01/19 12:29:09, 0] lib/util.c:smb_panic2(1554)
  PANIC: failed to set gid

To solve this problem I edited include/config.h, and added "#define USE_SETRESUID 1":

/* Whether setresuid() is available */
/* #undef USE_SETRESUID */
#define USE_SETRESUID 1

Compiled, and now smbd starts correctly.
Comment 1 Simo Sorce 2006-01-25 12:29:05 UTC
(In reply to comment #0)
> I compiled Samba 3.0.21a for mipsel / uclibc.
> 
> smbd doesn't want to start; it quits with:
> 
> [2006/01/19 12:29:09, 0] lib/util_sec.c:assert_gid(113)
>   Failed to set gid privileges to (-1,65534) now set to (0,0) uid=(0,0)
> [2006/01/19 12:29:09, 0] lib/util.c:smb_panic2(1554)
>   PANIC: failed to set gid
> 
> To solve this problem I edited include/config.h, and added "#define
> USE_SETRESUID 1":
> 
> /* Whether setresuid() is available */
> /* #undef USE_SETRESUID */
> #define USE_SETRESUID 1
> 
> Compiled, and now smbd starts correctly.

Seem cofigure has not properly detected the presence of setresgid()
can you tell what does config.log say about that?
You should see a failed check for setresgid/setresuid
Comment 2 Tomasz Chmielewski 2006-01-26 09:05:58 UTC
It looks like this for setresuid:

configure:13191: /home/data/wrt54/svn/white/openwrt/staging_dir_mipsel/bin/mipsel-linux-uclibc-gcc -c -Os -s -D_SAMBA_BUILD_
-I/home/data/wrt54/include conftest.c >&5
conftest.c: In function `main':
conftest.c:98: error: `setresuid' undeclared (first use in this function)
conftest.c:98: error: (Each undeclared identifier is reported only once
conftest.c:98: error: for each function it appears in.)
configure:13197: $? = 1
configure: failed program was:
| /* confdefs.h.  */


and a while later for setresgid:

configure:13232: checking for setresgid declaration
configure:13254: /home/data/wrt54/svn/white/openwrt/staging_dir_mipsel/bin/mipsel-linux-uclibc-gcc -c -Os -s -D_SAMBA_BUILD_  -I/home/data/wrt54/include conftest.c >&5
conftest.c: In function `main':
conftest.c:98: error: `setresgid' undeclared (first use in this function)
conftest.c:98: error: (Each undeclared identifier is reported only once
conftest.c:98: error: for each function it appears in.)
configure:13260: $? = 1
configure: failed program was:
| /* confdefs.h.  */


Then later:

configure:13549: checking for real setresuid
configure:13590: result: cross
configure:13602: checking for real setresgid
configure:13644: result: cross

And:

ac_cv_have_setresgid_decl=no
ac_cv_have_setresuid_decl=no

And the last ones:

samba_cv_have_setresgid=cross
samba_cv_have_setresuid=cross
Comment 3 Simo Sorce 2006-01-27 18:05:00 UTC
Can you tell me in which header file setresuid() is defined in your system ?
Comment 4 Tomasz Chmielewski 2006-01-28 02:17:39 UTC
Hmm, hard to tell, can I answer "none"?

It's a cross-compilation build environment.
It compiles for Linux/mipsel/uClibc.

grepping for setresuid, seteuid, setreuid (even with ignoring the case) gives no results, though.