From owner-freebsd-ports Sun Oct 17 0:20: 8 1999 Delivered-To: freebsd-ports@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 9E76B14D39 for ; Sun, 17 Oct 1999 00:20:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id AAA41798; Sun, 17 Oct 1999 00:20:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: by hub.freebsd.org (Postfix, from userid 32767) id 78A3314CE9; Sun, 17 Oct 1999 00:16:07 -0700 (PDT) Message-Id: <19991017071607.78A3314CE9@hub.freebsd.org> Date: Sun, 17 Oct 1999 00:16:07 -0700 (PDT) From: tempest@ecst.csuchico.edu To: freebsd-gnats-submit@freebsd.org X-Send-Pr-Version: www-1.0 Subject: ports/14366: wdm doesn't call setlogin() properly--actually, it doesn't call it at all Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 14366 >Category: ports >Synopsis: wdm doesn't call setlogin() properly--actually, it doesn't call it at all >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Oct 17 00:20:01 PDT 1999 >Closed-Date: >Last-Modified: >Originator: Ken Lui >Release: 3.2 RELEASE >Organization: >Environment: FreeBSD 3.2-RELEASE >Description: Using wdm to login causes the system call getlogin() to return "root" if one isn't logged in as root. The immediate consequence that I encountered is programs like trn posts messages that says one is "root" rather than the actual user. Problem is the BSD macro never gets set as it's defined in but it's included only if CSRG_BASED is defined and FreeBSD doesn't define it. >How-To-Repeat: Run this program as a non-root user and it will return root rather than the user's login. #include main() { printf("%s\n",getlogin()); } >Fix: patch xdm/session.c as follows: --- session.c.orig Mon Mar 2 03:56:36 1998 +++ session.c Sun Oct 17 00:01:10 1999 @@ -63,8 +63,9 @@ #endif #endif -#ifdef CSRG_BASED +#if defined(CSRG_BASED) || defined(__FreeBSD__) #include +#include #endif #ifdef HAS_SETUSERCONTEXT #include >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message