Package: molly-guard Version: 0.4.4-2 Severity: wishlist As documented in the man page moly guard does not detect that it is run from a terminal not local to the display. see also bug 552321 which discusses the also documented screen issue and mentiones that the ideal test would be for a known local terminal instead of known remote terminal.
In either case detecting the remoteness of xterms, etc. should be undertaken. As an alternitave to extensive testing to determine which xterm the curent pty is assigned to I propose examining the DISPLAY varable. In the comon case the display will be accessed by unix sockets or tcp (parsing decnet, etc. is also possible). If a unix socket DISPLAY will be in the form ':n' or ':n.m' where n is the display number and m is the screen. for our purposes whe can drop the screen. Most systems have few displays attached to them ( <10 ) and openssh takes advantage of this by using a configurable offset for forwarding X ( default 10 ) we should therefore check wether n<offset (local) or not (remote). If tcp DISPLAY will be in the form 'host:n' or 'host:n.m' with n and m as defined prevously. The first step is to look at the host part to see if it referes to the local machine (i.e. full name, short name, localhost, local ipaddress, 127.0.0.1, ::1). If it refers to the local machine we should strip the host and then use the unix socket tests. otherwise we should assume remote. As a special case consider the the following situation: the active pty is not associated with the display refrenced in DISPLAY. This could invalidate the prevous tests, but the likelyhood of this is small. the two most common cases where this would hapen are setting DISPLAY prior to starting apps from another channel (telnet, rsh, etc.) in which case the tests will almost certanly be correct, or expermentation in which case you better know what you are doing. I did not include a patch due to only being able to come up with bash speciffic or vary ugly ways of implementation. If I come up with any bright ideas I will add them later. thanks, ben -- System Information: Debian Release: 5.0.6 APT prefers stable APT policy: (500, 'stable') Architecture: i386 (i686) Kernel: Linux 2.6.26-1-686 (SMP w/1 CPU core) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages molly-guard depends on: ii procps 1:3.2.7-11 /proc file system utilities molly-guard recommends no packages. molly-guard suggests no packages. -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org