Subject: Re: Can't login or su when using login.conf?
To: None <netbsd-users@NetBSD.org>
From: Dominik Bialy <dominik@underlegend.net>
List: netbsd-users
Date: 11/08/2005 10:10:22
--JP+T4n/bALQSJXh8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Sun, Nov 06, 2005 at 01:12:53PM +0100, Florian Stoehr wrote:
> On Sat, 5 Nov 2005, Cheese Lottery wrote:
> 
> >On 11/5/05, Christos Zoulas <christos@zoulas.com> wrote:
> >>This example works for me. Is there anything else in /var/log/authlog?
> >
> >/var/log/authlog:
> >Nov  5 18:59:24 8300 su: default: unknown class
> >Nov  5 18:59:24 8300 su: pam_acct_mgmt: error in service module
> >
> >Nothing out of the ordinary from /var/log/messages, but there was this
> >in /var/log/cron:
> >Nov  5 19:00:00 8300 /usr/sbin/cron[23963]: default: unknown class
> >Nov  5 19:00:00 8300 /usr/sbin/cron[24154]: default: unknown class
> >
> >strange, if I'm the only one.
> >
> 
> Well, you're not.

I had the same problem (I think) with netbsd-3 some time ago, attached
patch seems to fix it. (It's from -current, the fix to cap_mkdb which
wasn't pulled up to netbsd-3.)

HTH,
	Dominik

--JP+T4n/bALQSJXh8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="cap_mkdb-netbsd-3.diff"

Index: cap_mkdb.c
===================================================================
RCS file: /cvsroot/src/usr.bin/cap_mkdb/cap_mkdb.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -b -u -r1.21 -r1.22
--- cap_mkdb.c	23 Apr 2004 21:39:33 -0000	1.21
+++ cap_mkdb.c	13 Apr 2005 04:50:22 -0000	1.22
@@ -1,4 +1,4 @@
-/*	$NetBSD: cap_mkdb.c,v 1.21 2004/04/23 21:39:33 christos Exp $	*/
+/*	$NetBSD: cap_mkdb.c,v 1.22 2005/04/13 04:50:22 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "@(#)cap_mkdb.c	8.2 (Berkeley) 4/27/95";
 #endif
-__RCSID("$NetBSD: cap_mkdb.c,v 1.21 2004/04/23 21:39:33 christos Exp $");
+__RCSID("$NetBSD: cap_mkdb.c,v 1.22 2005/04/13 04:50:22 christos Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -124,7 +124,8 @@
 	 * The database file is the first argument if no name is specified.
 	 * Make arrangements to unlink it if exit badly.
 	 */
-	(void)snprintf(buf, sizeof(buf), "%s.db", capname ? capname : *argv);
+	(void)snprintf(buf, sizeof(buf), "%s.db.tmp",
+	    capname ? capname : *argv);
 	if ((capname = strdup(buf)) == NULL)
 		err(1, "strdup");
 	if ((capdbp = dbopen(capname, O_CREAT | O_TRUNC | O_RDWR,
@@ -138,6 +139,10 @@
 
 	if (capdbp->close(capdbp) < 0)
 		err(1, "%s", capname);
+	*strrchr(buf, '.') = '\0';
+	if (rename(capname, buf) == -1)
+		err(1, "rename");
+	free(capname);
 	capname = NULL;
 	return 0;
 }

--JP+T4n/bALQSJXh8--