NetBSD Problem Report #45801

From  Sun Jan  8 17:17:24 2012
Return-Path: <>
Received: from ( [])
	by (Postfix) with ESMTP id 2042A63B9C8
	for <>; Sun,  8 Jan 2012 17:17:24 +0000 (UTC)
Message-Id: <>
Date: Sun,  8 Jan 2012 17:17:23 +0000 (UTC)
Subject: samba35 crashing when a member of many Domain Groups tries to connect
X-Send-Pr-Version: www-1.0

>Number:         45801
>Category:       pkg
>Synopsis:       samba35 crashing when a member of many Domain Groups tries to connect
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 08 17:20:01 +0000 2012
>Originator:     Ingo Meyer
>Release:        NetBSD 5.1
meyer  datasystems
NetBSD vertrieb 5.1 NetBSD 5.1 (MY_XEN3_DOMU) #0: Fri Jun  3 17:41:36 CEST 2011  ingo@coxen2:/usr/src/sys/arch/amd64/compile/MY_XEN3_DOMU amd64
samba as a Bomain member server crashes, if a user, who is member of many Domain groups tries to connect.

with a log level of 10 you get the following error message in the connecting computers logfile

[2012/01/08 16:41:23.582375,  0] lib/util.c:1468(smb_panic)
  PANIC (pid 5947): sys_setgroups failed

I found the reason in source3/lib system.c on line 1153 in the function

 /* setgroups(2) will fail with EINVAL if we pass too many groups. */
        max = groups_max();

just add a user to 5 or more Groups on your W2K Domain controller and try to connect to the samba server as this user.

You will get an error message, concerning possibly missing access rights.
--- ./org/system.c      2011-11-01 19:53:03.000000000 +0100
+++ ./work/samba-3.5.12/source3/lib/system.c    2012-01-08 17:11:09.000000000 +0100
@@ -1134,7 +1134,7 @@
 /* This is a list of systems that require the first GID passed to setgroups(2)
  * to be the effective GID. If your system is one of these, add it here.
-#if defined (FREEBSD) || defined (DARWINOS)
+#if defined (FREEBSD) || defined (DARWINOS) || defined (__NetBSD__)

You have to ensure, that in source3/lib/system.c 'USE_BSD_SETGROUPS' is defined as is for FreeBSD and DARWIN.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.