NetBSD Problem Report #45801

From www@NetBSD.org  Sun Jan  8 17:17:24 2012
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 2042A63B9C8
	for <gnats-bugs@gnats.NetBSD.org>; Sun,  8 Jan 2012 17:17:24 +0000 (UTC)
Message-Id: <20120108171723.41C8063B8C3@www.NetBSD.org>
Date: Sun,  8 Jan 2012 17:17:23 +0000 (UTC)
From: info@meyer-datasystems.de
Reply-To: info@meyer-datasystems.de
To: gnats-bugs@NetBSD.org
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
>Organization:
meyer  datasystems
>Environment:
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
>Description:
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
 sys_bsd_setgroups():

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



>How-To-Repeat:
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.
>Fix:
--- ./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__)
 #define USE_BSD_SETGROUPS
 #endif

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: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.