[aklug] Re: terminal types and curses programming

From: Arthur Corliss <acorliss@nevaeh-linux.org>
Date: Mon Jan 26 2009 - 10:49:59 AKST

On Sat, 24 Jan 2009, Christopher Howard wrote:

> My program is a curses-based program launcher:
> http://indicium.us/cgi-bin/pages/get?view=minmenu. It is meant to be
> useful to anyone working in a *nix console environment.
>
> Its purpose is to make a menu of programs available to the user in a
> attractive and convenient. For most people, the TERM issue doesn't matter.
>
> However, someone had suggested to me that the program would be a nifty way
> for some companies to allow untrusted users to have access to some
> programs inside a shell account, without actually having full access to
> the shell. (The program can be called by the profile, so that it is the
> first thing that opens when a users logs in via ssh.)

My suggestion was not to call the program from your shell rc scripts, but to
use it as a shell itself. If you want to do it that way, though, make sure
you're using 'trap' to disable signals before the program is executed, and
then use 'exit' after calling your program. That ensures the shell is
exited regardless of how your program is terminated.

> Somebody else mentioned setupterm: I think I've got the idea but I'm not
> sure. Would this work?:
>
> int errret;
> if(setupterm((char *)0, 1, &errret) == ERR) {
> /* do something, maybe depending on the value of errret */
> }
>
> This seems to make sense, from what I read in the man page.

Instead of '(char *)0' you can use just NULL, but that's the idea...

         --Arthur Corliss
           Live Free or Die
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Mon Jan 26 10:50:10 2009

This archive was generated by hypermail 2.1.8 : Mon Jan 26 2009 - 10:50:10 AKST