11-08-2007
If you want to open an x-window on a remote machine uninvited, it's generally non-trivial.
If the users are not using Xauth security (eg MIT magic cookies etc) then it's not _too_ hard to determine the display to send to and fire a window at it.
This 'military software'; does it run with the display name (ie <hostname>:<display number>) in the commandline or do they rely on a $DISPLAY environment variable?
For that matter, does it even use X or is it run within a terminal session via X?
It's totally doable, but there are a lot of factors that will determine how to go about it.
High-level approach:
Produce a list of users to warn (probably from 'ps' or 'who' output)
Identify the X server they are connecting from
Obtain a copy of appropriate authorisation to send something to their X server
Send the message, taking care not to present them with an app that has elevated privilages.
Log the response to the message (if you need to).
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I used the command
osascript -e 'tell app "Finder" to display dialog "Hey!"'
to display a dialog box..it works fine, it displays a dialog box with 'OK' and 'CANCEL' buttons..i want to get the button returned value how can i do that using terminal command?
is there any command to get... (1 Reply)
Discussion started by: keshav.murthy@r
1 Replies
2. Web Development
Hi,
I was writing a simple web application using Perl -CGI. When users try to do some operations, I wanted like a pop-up confirmation box. Is this possible with Perl-CGI?
Thanks in advance.
Regards,
garric (6 Replies)
Discussion started by: garric
6 Replies
3. Debian
Hi all,
I am working with debconf file for packaging the projects. I have used the
". /usr/share/debconf/confmodule" file to do the packaging in debian standard. It worked fine. When ever I am installing the package in apt-get the dialogs are come as I mentioned in the templates file.... (0 Replies)
Discussion started by: Nila
0 Replies
4. Shell Programming and Scripting
I want to create a script that displays a dialog box every interval of time and exits that loop when a user presses ENTER
Any idies? (4 Replies)
Discussion started by: amitlib
4 Replies
5. Red Hat
For some reason i cannot login using root or other accounts on my Linux system.
When logging in at the main console it says "Authentication failed" in a dialog box with an OK button.
The Linux system is Redhat 4.7.
I've already checked /etc/pam.d/login, /etc/security/access.conf and ... (27 Replies)
Discussion started by: redhatuser2012
27 Replies
6. Shell Programming and Scripting
Hi All,
I was trying to generate GUI using shell script. After long search I found the utility called “dialog”. Using this utility I am able to generate window to collect the input.
dialog --inputbox "Input 1" 10 45
dialog --inputbox "Input 2" 10 45
dialog --inputbox "Input 3" 10 45
Using... (2 Replies)
Discussion started by: kalpeer
2 Replies
7. UNIX for Dummies Questions & Answers
I know, I can run dialog command in my machine. But what I want to do is I wanna show the dialog box to some other Remote host.
I connected to the remote system and used dialog command its shows the box in my terminal only. How can I display to that remote machine?? Any suggestions??? (3 Replies)
Discussion started by: Adhi
3 Replies
8. Shell Programming and Scripting
Does dialog box works on all kind of shells? I am using korn shell in Linux .
For me dialog is not working :) is there any particular syntax or do we need to have particular OS version or shell env?
#!/bin/ksh
dialog --title "create file" \
--backtitle "shell script practice" \... (1 Reply)
Discussion started by: NarayanaPrakash
1 Replies
9. Web Development
Hi,
I need to add confirmation pop up msg box before deleting the record from database, I have added following snippets to my code but its not working for me, your help will be much appreciated :
print header;
print <<EOF;
<script type="text/javascript">
function confirmOk() {
return... (0 Replies)
Discussion started by: terrykhatri531
0 Replies
10. Shell Programming and Scripting
Hello.
Any help would be greatly appreciated.
Right now I have the following input box that works fine and well, however I would like to wrap this is a loop that requires input. Right now the script will happily continue on if the user just hits enter. I'd like to require a minimum of a 5... (5 Replies)
Discussion started by: woodson2
5 Replies
send(n) Tk Built-In Commands send(n)
__________________________________________________________________________________________________________________________________________________
NAME
send - Execute a command in a different application
SYNOPSIS
send ?options? app cmd ?arg arg ...?
_________________________________________________________________
DESCRIPTION
This command arranges for cmd (and args) to be executed in the application named by app. It returns the result or error from that command
execution. App may be the name of any application whose main window is on the display containing the sender's main window; it need not be
within the same process. If no arg arguments are present, then the command to be executed is contained entirely within the cmd argument.
If one or more args are present, they are concatenated to form the command to be executed, just as for the eval command.
If the initial arguments of the command begin with "-" they are treated as options. The following options are currently defined:
-async Requests asynchronous invocation. In this case the send command will complete immediately without waiting for cmd to complete in
the target application; no result will be available and errors in the sent command will be ignored. If the target application is
in the same process as the sending application then the -async option is ignored.
-displayof pathName
Specifies that the target application's main window is on the display of the window given by pathName, instead of the display con-
taining the application's main window.
-- Serves no purpose except to terminate the list of options. This option is needed only if app could contain a leading "-" character.
APPLICATION NAMES
The name of an application is set initially from the name of the program or script that created the application. You can query and change
the name of an application with the tk appname command.
DISABLING SENDS
If the send command is removed from an application (e.g. with the command rename send {}) then the application will not respond to incom-
ing send requests anymore, nor will it be able to issue outgoing requests. Communication can be reenabled by invoking the tk appname com-
mand.
SECURITY
The send command is potentially a serious security loophole. On Unix, any application that can connect to your X server can send scripts to
your applications. These incoming scripts can use Tcl to read and write your files and invoke subprocesses under your name. Host-based
access control such as that provided by xhost is particularly insecure, since it allows anyone with an account on particular hosts to con-
nect to your server, and if disabled it allows anyone anywhere to connect to your server. In order to provide at least a small amount of
security, Tk checks the access control being used by the server and rejects incoming sends unless (a) xhost-style access control is enabled
(i.e. only certain hosts can establish connections) and (b) the list of enabled hosts is empty. This means that applications cannot con-
nect to your server unless they use some other form of authorization such as that provide by xauth. Under Windows, send is currently dis-
abled. Most of the functionality is provided by the dde command instead.
EXAMPLE
This script fragment can be used to make an application that only runs once on a particular display.
if {[tk appname FoobarApp] ne "FoobarApp"} {
send -async FoobarApp RemoteStart $argv
exit
}
# The command that will be called remotely, which raises
# the application main window and opens the requested files
proc RemoteStart args {
raise .
foreach filename $args {
OpenFile $filename
}
}
KEYWORDS
application, dde, name, remote execution, security, send
Tk 4.0 send(n)