From owner-freebsd-questions@FreeBSD.ORG Wed Apr 12 21:20:50 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4DDAF16A402 for ; Wed, 12 Apr 2006 21:20:50 +0000 (UTC) (envelope-from nocturnal@swehack.se) Received: from mail2.swebase.com (mail2.swebase.com [82.99.44.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id AD6C143D48 for ; Wed, 12 Apr 2006 21:20:49 +0000 (GMT) (envelope-from nocturnal@swehack.se) Received: from [81.170.248.148] by mail2.swebase.com (MDaemon.PRO.v8.1.0.R) with ESMTP id 01-md50000018830.msg for ; Wed, 12 Apr 2006 23:20:40 +0200 Message-ID: <443D6F36.2010904@swehack.se> Date: Wed, 12 Apr 2006 23:20:54 +0200 From: nocturnal User-Agent: Thunderbird 1.5 (X11/20060409) MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Authenticated-Sender: nocturnal@swehack.se X-Spam-Processed: mail2.swebase.com, Wed, 12 Apr 2006 23:20:40 +0200 (not processed: message from trusted or authenticated source) X-MDRemoteIP: 81.170.248.148 X-Return-Path: nocturnal@swehack.se X-MDaemon-Deliver-To: freebsd-questions@freebsd.org Subject: How to get the login class name from a uid? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2006 21:20:50 -0000 Hi Reading the login_cap(3) manual i thought i would get default returned if no other login classes are found but it's possible i misunderstood the manual. A sample of code i'm using is below. The user running the application is in a login class other than default, i've verified this in the master.passwd files class field. I have also rebuilt the termcap database for login.conf after adding the class. Right the new class only has a simple :tc=default: to test if it works. The code below outputs only (null). uid_t uid = getuid(); struct passwd * pw = getpwuid(uid); login_cap_t * lc = login_getuserclass(pw); printf("%s\n", lc->lc_class); Thank you in advance for any help. -- Med vänliga hälsningar Stefan Midjich aka nocturnal [Swehack] http://swehack.se