From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,9aee0c9e48d0a1a3,start X-Google-Attributes: gid1164f8,public X-Google-Thread: 10b612,9aee0c9e48d0a1a3,start X-Google-Attributes: gid10b612,public X-Google-ArrivalTime: 1990-04-05 18:15:51 PST Path: gmdzi!unido!mcsun!ukc!tcdcs!swift.cs.tcd.ie!maths.tcd.ie!ajudge From: ajudge@maths.tcd.ie (Alan Judge) Newsgroups: comp.sys.dec,comp.unix.ultrix Subject: Single user booting of DECStations and security Keywords: ultrix 3.0 decstation 2100 3100 security Message-ID: <1990Apr5.123703.2251@maths.tcd.ie> Date: 5 Apr 90 12:37:03 GMT Sender: ajudge@maths.tcd.ie (Alan Judge) Organization: Dept. of Maths, Trinity College, Dublin, Ireland. Xref: gmdzi comp.sys.dec:2220 comp.unix.ultrix:2527 Posted: Thu Apr 5 13:37:03 1990 Has anybody come up with a satisfactory method of preventing users from resetting DECStations and booting into single user mode? What I am looking for is a system similar to Sun, where the root password is required to come up single user. I am thinking of implementing this by running a program from /.profile which detects single user mode (somehow? getpid() == 3?), disables interrupts, and demands the root password. Has anyone got a better suggestion? (I'm sure we're not the first people to use DS2100s in a student lab situation.) Thanks in advance, Alan. -- Alan Judge, SysAdmin, Dept. of Maths, Trinity College, Dublin, Ireland. ajudge@maths.tcd.ie a.k.a. amjudge@cs.tcd.ie also, Distributed System Group, Dept. of Computer Science, TCD. Newsgroups: comp.windows.x Path: csaran!cjmchale From: cjmchale@cs.tcd.ie (Ciaran McHale) Subject: Re: scrolling (long) Message-ID: <1990Apr5.133832.24268@cs.tcd.ie> Reply-To: cjmchale@csaran.UUCP (Ciaran McHale) Organization: DSG, Dept. of Comp.Sc., Trinity College, Dublin, Ireland. References: <54424@bbn.COM> Date: Thu, 5 Apr 90 13:38:32 GMT In article <54424@bbn.COM> koolish@bbn.com (Dick Koolish) writes: >Does X have any notion of scrolling? I would like to create >a large image in memory but view a smaller part of it on the screen. >To scroll the window over the image, the only ways I have found so far >are to use either XCopyArea to put up a different part of a pixmap, >or XPutImage to display a different part of an XImage. Both seem to >be complete redisplay operations rather than scrolling operations. >Is there any more appropriate way to do this? Imagine that you create a window, win1, and a window within this window, win2. Usually win2 will be smaller than, and will reside fully inside, it's parent window as shown below. ------------------------ |win1 | | | | -------- | | |win2 | | | | | | | | | | | | | | | -------- | | | | | ------------------------ Now imagine that win2 was moved---the XMoveWindow() function can be used to do this---down a bit. The result would be something like: ------------------------ |win1 | | | | | | | | | | | | | | -------- | | |win2 | | | | | | ------------------------ : : ........ where the dotted lines indicate that part of win2 lies outside win1. Since a window is always "clipped" by it's parent window, only the part of win2 which lies within win1 will de displayed (so the rectangular section marked with dots would not be visible on the screen). Now imagine that win2 happens to be bigger than win1 like shown below: ..................................................... :win2 : : ------------------------ : : |win1 | : : | | : : | | : : | | : : | | : : | | : : | | : : | | : : | | : : | | : : ------------------------ : : : : : : : ..................................................... In this case win1 will show a small part of win2. The part of win2 which lies outside win1 will not be displayed. Or to put it differently, only the part of win2 which lies inside win1 will be visible (i.e. win2 is still "clipped" by it's parent window). If win2 was moved then win1 will display a different part of win2. This can be seen by the following diagrams which show some text in win2. ..................................................... :win2 : : ------------------------ : : |win1 | : : | | : : Once upon a time there|lived a princess who w|s : : very pretty. However, |he was also very lonel|. : : A handsome knight in s|ining armour married h|r : : and they all lived hap|ily every after. | : : | | : : | | : : | | : : | | : : ------------------------ : : : : : : : ..................................................... Move win2 right 3 character spaces using XMoveWindow() to get ..................................................... :win2 : : ------------------------ : : |win1 | : : | | : : Once upon a time th|re lived a princess wh| was : : very pretty. Howeve|, she was also very lo|ely. : : A handsome knight i| shining armour marrie| her : : and they all lived |appily every after. | : : | | : : | | : : | | : : | | : : ------------------------ : : : : : : : ..................................................... Notice that win1 stayed in the same place on the screen. The effect is that win2 has scrolled left. So to scroll win2 left we actually move it right! Similarly to scroll up we move win2 down. When you do the XMoveWindow(), X will, with a bit of luck, have the sense to scroll what it can and it will only generate an expose event for the section of the window that has become visible as a result of the XMoveWindow(). Thus, for the above case, the rectanged specified in the expose event would be as indicated below marked as "###" ..................................................... :win2 : : ------------------------ : : |###1 | : : |### | : : Once upon a time th|###lived a princess wh| was : : very pretty. Howeve|###he was also very lo|ely. : : A handsome knight i|###ining armour marrie| her : : and they all lived |###ily every after. | : : |### | : : |### | : : |### | : : |### | : : ------------------------ : : : : : : : ..................................................... Your application would then have to repaint the exposed rectangle. If you're using a pixmap to retain the picture then you can simply use XCopyArea() to do the necessary. That's the theory. If I got any of it wrong then I'm sure somebody on the net will correct me. Since this is something that is commonly needed, it has all been encapsulated in various widget sets. In the Athena widget set, for example, win1 would be a Viewport widget. The viewport would optionally have horizontal and/or vertical scrollbars. When the user scrolls using a scrollbar, the viewport will automatically execute the code necessary to move the inner widget. I've used it once in an application and was very plesantly surprised just how easy it all was. I'm sure that other toolkits provide something similar to Athena's Viewport. Hope that's of some help, Ciaran. ------- cjmchale@cs.tcd.ie "3 out of 2 ain't bad"