Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Oct 1999 00:16:07 -0700 (PDT)
From:      tempest@ecst.csuchico.edu
To:        freebsd-gnats-submit@freebsd.org
Subject:   ports/14366: wdm doesn't call setlogin() properly--actually, it doesn't call it at all
Message-ID:  <19991017071607.78A3314CE9@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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 <sys/param.h> 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 <unistd.h>
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 <sys/param.h>
+#include <unistd.h>
 #endif
 #ifdef HAS_SETUSERCONTEXT
 #include <login_cap.h>


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991017071607.78A3314CE9>