[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

2001.0. "DECnet and Opening Windows from Ultrix" by ARTFUL::SCOTT (Mike against the wall) Thu Jan 04 1990 13:56

I just installed DECnet-Ultrix on a DECstation 3100.  On my VAXstation, running
VMS and DECwindows, I added a security entry specifying the nodename, UIC and
the DECnet transport.  Most DECwindows applications work fine with this. Some,
notably "xterm", complain that "Client is not authorized to access server" when
I try to run them.  I noticed that this wasn't true when I use TCP/IP as the
transport.  However, to use TCP/IP as a transport, you have to specify the
username field of the security entry as a wildcard (reportedly because the in-
formation is not provided by TCP/IP).  So I went back and changed the username
in the DECnet transport entry to a wildcard, and now all applications work.

I assume by this that "xterm" and some other applications somehow fail to pro-
vide the proper user-id when they create their windows.  How is this possible?
It was my impression that that was beyond the control of the application.
Thanks.

                                                                   -- Michael
T.RTitleUserPersonal
Name
DateLines
2001.1Interesting... only xterm doesn't work?STAR::VATNEPeter Vatne, VMS DevelopmentThu Jan 04 1990 14:335
Whenever you get "Client is not authorized to access server", the access
failure should be logged in SYS$MANAGER:DECW$SERVER_0_ERROR.LOG.  That
should give you a clue as to what the problem is.  Please post the contents
of the log file, even if the error is obvious.  I'm interested in learning
what kinds of difficulties people encounter.
2001.2Thanks--I found the problem (but I don't understand *why* it can happen)ARTFUL::SCOTTMike against the wallThu Jan 04 1990 15:4449
I got the following mail message in response to .0 (reprinted with the permis-
sion of the author 8^):

From:	38863::DERAMO "Daniel V. {AITG,ZFC}:: D'Eramo  04-Jan-1990 1502"  4-JAN-1990 15:04:00.26
To:	ARTFUL::SCOTT
CC:	
Subj:	DECwindows note 2001.0 "DECnet and Opening Windows from Ultrix"

	Michael,

	On my VMS workstation I have two security entries for me
	for an ULTRIX node (Blake) using DECNET:

		BLAKE DERAMO
		BLAKE 21

	The 21 is the user number on the ULTRIX system ... grep your
	username in /etc/passwd if you don't know it

		$ grep deramo /etc/passwd
		deramo:IITYWIMWYBMED:21:10:Daniel V. D'Eramo:/staff/deramo:/bin/sh

	The third field (between the second and third colons) is the
	user number.  I think most ULTRIX clients use it, but "setuid"
	clients use the username (I suppose VMS upcases it).

	Dan

Given this, I deleted the wildcard entry from the security list and included
an entry giving the username (in addition to the one giving the user number).
xterm works now.

I'm no "X-pert", but this doesn't seem like a good thing.  How is it possible
for "'setuid' clients" to give a different ID to the server than other appli-
cations?  Isn't that stuff all specified for the application by X-window
routines?

BTW, this came up when I tried starting an application which comes up initially
with a control panel *and* an xterm.  The control panel came up successfully,
and the xterm did not.  Yet the application worked perfectly when using TCP/IP
as a transport.


RE: .1

Thanks--I checked the log, and it contained very nice error messages saying
that connection attempts had failed, giving the system, username and transport.
If I'd looked at this I would have seen the problem immediately.  Thanks for
the tip.
2001.3Security info is supplied by DECnet, not XSTAR::VATNEPeter Vatne, VMS DevelopmentThu Jan 04 1990 17:0718
This is very interesting.  Thanks for the info.  I'm not sure what the
right thing to do is, but at least for now we can tell users to put both
the user ID and the user name in the security list.  

The security information for VMS is not supplied via Xlib routines.
The VMS server does all its security checking through information
supplied by DECnet (or TCP/IP as the case may be).  DECnet supplies
the node name and user name.  TCP/IP only supplies the node name.

This is currently the only practical way to do security checking.  Xlib
does nothing magic for you, all it does is format X protocol packets.
If the security information was passed via the protocol, it would be
very easy for someone to fool your security setup simply by passing
a bogus node name and user name.

It is theoretically possible to pass the node name and user name using
some kind of encryption system that prevents spoofing, but this kind of
system won't be much good until the industry agrees on some standards.
2001.4A parrotted explanationDECWIN::FISHERBurns Fisher 381-1466, ZKO3-4/W23Fri Jan 05 1990 17:198
I'm not an Ultrix guru, but someone explained this oddness to me some time ago.

It seems that the username is only available to a process in a file which is
protected such that only system can read it.  If you are normal code, you
can't get at it and all you know is the uid,so that is what you send.  If you
are running root (such as dxterm), then you can get the info and you do.

Burns
2001.5FLUME::dikeMon Jan 08 1990 07:323
Untrue.  The password file is world-readable and any process can perform the
uid to real name mapping.
				Jeff
2001.6HmmmDECWIN::FISHERBurns Fisher 381-1466, ZKO3-4/W23Mon Jan 08 1990 08:397
    So Jeff, is there any germ of sense in .4?  What can be going on here?
    I had several people explain to me that DECnet could not get the
    username info securely unless the program is privileged?  I'm really
    curious!  Could it be that the username is available to all, but not
    trustworthy unless the program is privileged?
    
    Burns
2001.7FLUME::dikeMon Jan 08 1990 12:207
I'm curious too.  I may have had this explained to me once, but all I remember
being told is that this was completely DECnet's doing and had little to do with
Ultrix itself.

I can't imagine how calling getpwent as root is more secure or trustworthy than
calling it as any other user.  Nothing else in Ultrix has this hangup.
				Jeff
2001.8AITG::DERAMODaniel V. {AITG,ZFC}:: D'EramoMon Jan 08 1990 15:119
>>        Untrue.  The password file is world-readable and any
>>        process can perform the uid to real name mapping.
        
        I thought that more than one line in /etc/passwd may be
        set up to use the same uid.  Knowing the uid or even both
        uid and gid doesn't seem to be enough to determine the
        username in all cases.
        
        Dan
2001.9The WordUPSAR::THOMASThe Code WarriorMon Jan 08 1990 16:2524
    Unlike VMS, the login name of an ULTRIX user is not available in kernel
    context, only the UID.  dnet_conn(3dn) will attempt to communicate the
    loginname to the kernel.  Now if the process isn't running with an
    effective UID of root, the kernel won't use the supplied name (can't 
    trust the user) and so converts the UID to an ASCII decimal string.
    When the connect is made, the name (if available) will be sent
    otherwise the UID will be sent.
    
    XOpenDisplay(3X) uses dnet_conn(3dn) to establish the X connection.
    Since, dxterm & xterm are setuid-root, they supply the loginname.
    Since most everything else isn't, they supply the UID.
    
    Now don't go setting applications setuid-root!!  If you do, you will be
    setting all sorts of security holes on your system.  An application
    must be coded with the knowledge that it will be setuid-root, otherwise
    it can used to get to root.
    
    In 4.0, we (DECnet-ULTRIX) tried to get the loginname added to the
    process/user structure so we could do the right thing.  Unfortunately
    we failed (it would have required too many changes to too many
    components, etc.).
    
    matt
    [DECnet-ULTRIX (owner of said DECnet kernel code)]
2001.10You should be consistent...ARTFUL::SCOTTMikey likes it!Tue Jan 09 1990 10:408
    RE: .9
    
    In that case, why do you _ever_ send the username?  The problem here is
    not in whether we'd rather have the username or the UID, but in that
    the identification should be consistent (at least for X-window
    applications).  One solution would be for dnet_conn to add an optional
    flag argument with which to force the UID to be sent, whether or not
    the username is available.  XOpenDisplay could then use that flag.
2001.11Too late now...MIPSBX::thomasThe Code WarriorTue Jan 09 1990 11:019
>    In that case, why do you _ever_ send the username?  The problem here is
>    not in whether we'd rather have the username or the UID, but in that
>    the identification should be consistent (at least for X-window
>    applications).  One solution would be for dnet_conn to add an optional
>    flag argument with which to force the UID to be sent, whether or not
>    the username is available.  XOpenDisplay could then use that flag.

Historical reasons.  If an application sets proxy_requested to 0, then the
UID will always be sent regardless of the effective UID.