1753970 Members
7195 Online
108811 Solutions
New Discussion юеВ

CDE - no command line

 
SOLVED
Go to solution
Dorothy Lim
Occasional Contributor

CDE - no command line

My establishment does not allow common line login for some staff.

Does any one know how to set up, such that when this group of staff log in thru' CDE,
they will be given a menu ?

Any other suggestions ?
Thks
Be prepared
8 REPLIES 8
Alex Glennie
Honored Contributor

Re: CDE - no command line

I'm not sure the exact functionality you are after ie are they are given only a menu or are they are given a customised menu in addition to CDE's normal functions etc ?

However : The following ITRC WEB DOCUMENT I found doing a search for "workspace menu and cde" may help ?

Configuring the workspace (root) menu in CDE
Configuring the workspace (root) menu in CDE
DocId:
KBRC00000005

Updated:
10/7/99 3:45:59 PM

PROBLEM

How can I add my own actions to the menu that pops up when pressing mouse
button 3 in the root window?

LIST OF TOPICS
Example of a Workspace Menu Customization
Single User Customization
System-Wide Customization

FURTHER READING
CDE OnLine Help (via front panel icon)
Man pages: dtwm
CDE 1.0 Advanced User's & System Administrator's Guide B1171-90102
Configuring CDE ISBN 0-13-102724-7

RESOLUTION


Example of a Workspace Menu Customization

An example workspace menu that adds a new action and a pop-up menu:

Menu DtRootMenu
{
"Workspace Menu" f.title
"Shuffle Up" f.circle_up
"Shuffle Down" f.circle_down
"Refresh" f.refresh
"Minimize/Restore Front Panel" f.toggle_frontpanel
no-label f.separator
"hpterm" f.exec /usr/bin/X11/hpterm
no-label f.separator
"Editors" f.menu EditorMenu
no-label f.separator
"Restart Workspace Manager..." f.restart
no-label f.separator
"Log out..." f.action ExitSession
}

Menu EditorMenu
{
"vi" f.exec "/usr/bin/X11/hpterm -e vi"
"dtpad" f.exec dtpad
}

For the Workspace Menu, f.circle_up, f.circle_down, etc. are predefined so that CDE
takes a particular action when they are called.

Entries can then be added using f.exec followed by the command string that would be required
to start the desired application (include the full path). If there are spaces in the command line as
with the vi example above, enclose the command string in double quotes.

Menu items can use f.action to call any of the actions that are already part of CDE or that have
been created with Create Action. The output from /usr/dt/bin/dttypes -db ACTION will give a
listing of the available actions.

Sub-menus like Editors in the above example can also be added. f.menu is followed by the
desired name for the new sub-menu and then the sub- menu must be defined. (See Menu
EditorMenu in the example).

Single User Customizations

The default system definition for the Workspace Menu is located in
/usr/dt/config/C/sys.dtwmrc. This file should not be edited as it will be overwritten with
subsequent patching and is the only system default copy.

For a single user customization, copy /usr/dt/config/C/sys.dtwmrc to
$HOME/.dt/dtwmrc and make any changes there.

If the user for whom the changes are being made is logged in to CDE, from the root window
menu (button 3), select Restart Workspace Manager.... This will rebuild the workspace
menu to include the changes.

System-wide Customizations

For a system-wide customization, copy /usr/dt/config/C/sys.dtwmrc to
/etc/dt/config/C/sys.dtwmrc and make any changes there.

Again, if the users for whom the changes are being made is logged in to CDE, from the root
window menu (button 3), select Restart Workspace Manager.... This will rebuild the
workspace menu to include changes.
Trevor Dyson
Trusted Contributor

Re: CDE - no command line

Hi,

To stop CDE users getting command line access you could change the execute permissions or use access control lists (see man pages for chmod, chacl and lsacl)on all terminal emulation commands that run under Xwindows and CDE.

These would be
/usr/bin/X11/xterm
/usr/contrib/bin/X11/xterm
/usr/bin/X11/hpterm
/usr/bin/X11/dtterm

Regards, Trevor
I've got a little black book with me poems in
Rick Garland
Honored Contributor

Re: CDE - no command line

If what you are looking for are captive menus for the users, modification of the dtprofile and the standard $HOME/.profile should accomplish this. The dtprofile will be set so that the .profile will be read. Within the .profile you have the standard assortment of traps, etc. that put a user into a captive menu. There have been previous posts regarding the dtprofile and .profile interaction.
Dorothy Lim
Occasional Contributor

Re: CDE - no command line

Thks guys for all the suggestions & ideas.

To answer Alex's question - The group of staff will be given a customised menu without the CDE's normal fuctions.

I am to provide them a set of menu that is sufficient for the normal function.

In this menu, there will be a function that allows to export the display on the screen or console, to that netscape function may be performed.

Thks
Be prepared
Antoanetta Naghiu
Esteemed Contributor

Re: CDE - no command line

To send a user directly to an application, is a very easy way: in /etc/password replace the shell with the specific script, application, and add it to /etc/shells. I guess is working with CDE as well.
Dorothy Lim
Occasional Contributor

Re: CDE - no command line

Antoanetta,

Your idea is interesting.

However, I cannot locate the /etc/shells.

Can U explain to me further ?

Thks
Be prepared
Alex Glennie
Honored Contributor
Solution

Re: CDE - no command line

I think I know what you're after, basically a customised, very basic X windows session where a user has only access to say your in-house application and a terminal window or similar (to exit). If this is the case xdm a window manager with basic functionality maybe what you are after. (It comes with CDE) and should be capable of running most Xapplications (standard & non standard). It's basically a failsafe session as also seen by selecting the option from the CDE login panel screen options menu.

Man xdm and man dtlogin are useful references.

Xwindows: How to start an XDM session from the CDE login

Use these steps to start an XDM session from the CDE login:

1. If the file /etc/dt/config/Xconfig does not exist, copy it over
from the directory /usr/dt/config.

cp /usr/dt/config/Xconfig /etc/dt/config/Xconfig

Important: Never apply a change to the files in the /usr/dt/...
directories.

2. Edit the file /etc/dt/config/Xconfig to add the following lines:

Dtlogin*xdmMode: True
Dtlogin*dtlite: True

Note: Ensure that there are no blanks in front of the new entries.

Note: If you only need to start an XDM session on specific
systems then, you can use this syntax:

Dtlogin**dtlite: True

The variable is the full
Displayname described in the follow format:

host_subdomain_domain_0

Example:

Dtlogin*summit_hp_com_0*dtlite: True

The above setting describe the Xterminal (summit.hp.com)
with the DISPLAY setting to summit.hp.com:0

3. Modify the file /etc/dt/bin/Xsession by adding the following
lines at the top of this script or before the first reference to
the variable $SESSIONTYPE:

if [ "$SESSIONTYPE" = &quotdtlite" ];
then
SESSIONTYPE=xdm
fi

Note: If the file does not exist, copy it over from the
/usr/dt/config directory.

4. Use chmod 555 to ensure that the startup script for the XDB
session is executable:

$HOME/.xsession

or

/usr/lib/X11/xdm/sys.xsession


Example Script
--------------

The following shell script is an example for a $HOME/.xsession or
/usr/lib/X11/xdm/sys.xsession file.

Note: There is a similiar script with the name
/usr/contrib/lib/X11/sys.x11start on each system.


if (cat /dev/null >$HOME/.x11startlog)
then
exec >$HOME/.x11startlog 2>$HOME/.x11startlog
else
exec >/dev/null 2>/dev/null
fi
# If there is not a Xdefaults. file in the user's home
# directory then use xrdb.
export doxrdb
doxrdb=
if [ -n "$HOME" ]
then
if [ ! ( -s $HOME/.Xdefaults ) ]
then
if [ -r /usr/contrib/lib/X11/sys.Xdefaults ]
then
if [ -s /usr/contrib/lib/X11/sys.Xdefaults]
then
doxrdb='xrdb -nocpp -load /usr/contrib/lib/X11/sys.Xdefaults'
fi
fi
fi
fi
$doxrdb
unset doxrdb
mwm $@ & # Start the Motif-based Window Manager.
sleep 5 # Allow time for initializing mwm before starting other
clients.
hpterm -C -geometry 80x24+1+1 $@ &
wait
exec sleep 2000000000

Antoanetta Naghiu
Esteemed Contributor

Re: CDE - no command line

Ok.
If you create a user call today and have the following line in the /etc/passwd:
user_name:incrypted_password:UID:GID:comments:/home_directory:/command

today:wrev34rfs:115:20:exec_of_date_command:/home/today:/usr/bin/date

if someone try to login as today user, provide the password, instead of a login shell, the command date is executing and after that the user is logout.
I suppose your application can work like that.

/etc/shell is the file that tells you the shells allowed on the system. You can create it with touch command and edit it after. Try without it, first.