ecb66a780e9b353a88483937f4d12255e4ef41c0
[oweals/cde.git] / cde / lib / DtSvc / DtUtil1 / CmdProcess.c
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these libraries and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $TOG: CmdProcess.c /main/8 1998/04/09 17:47:13 mgreess $ */
24 /***************************************************************************
25 *
26 * File:         CmdProcess.c
27 * Description:  Miscellaneous functions for the command execution system
28 * Language:     C
29 *
30 ** (c) Copyright 1993, 1994 Hewlett-Packard Company
31 ** (c) Copyright 1993, 1994 International Business Machines Corp.
32 ** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
33 ** (c) Copyright 1993, 1994 Novell, Inc.
34 ***************************************************************************/
35
36 #include "CmdInvP.h"
37
38 #include <X11/Xproto.h>
39 #include <Dt/CommandM.h>
40 #include <Dt/DtNlUtils.h>
41 #include <Dt/ActionUtilP.h>
42 #include "myassertP.h"
43
44 #if defined(sun)
45 #include <limits.h>
46 #endif 
47
48 #if defined(__hpux)
49 #include <sys/getaccess.h>
50 #endif
51
52 #include <sys/socket.h>
53 #include <netdb.h>
54 #include <netinet/in.h>
55
56 #include <Tt/tt_c.h>
57
58 /*
59  * Global variables:
60  */
61 Cmd_Resources cmd_Resources = { 0 };
62 Cmd_Globals cmd_Globals = { 0 };
63
64 /********    Static Function Declarations    ********/
65
66 static char *_GetRemoteTerminalsResource (
67                         Display *display,
68                         char *appClass,
69                         char *appName);
70 static void GetRemoteTerminalsResource (
71                         Display *display,
72                         char *appClass,
73                         char *appName);
74 static void GetLocalTerminalResource (
75                         Display *display,
76                         char *appClass,
77                         char *appName);
78 static void GetWaitTimeResource (
79                         Display *display,
80                         char *appClass,
81                         char *appName);
82 static void GetDtexecPath (
83                         Display *display,
84                         char *appClass,
85                         char *appName);
86 static void GetExecutionHostLoggingResource (
87                         Display *display,
88                         char *appClass,
89                         char *appName);
90 static char *GetRemoteTerminal(
91                         char *host);
92
93 /********    End Static Function Declarations    ********/
94
95 /******************************************************************************
96  *
97  * _GetRemoteTerminalsResource - gets the value of the "remoteTerminals"
98  *    resource.
99  *
100  * PARAMETERS:
101  *
102  *   Display *display;       The connection to the X server.
103  *
104  *   char *appClass;            The client's application class.
105  *
106  *   char *appName;             The client's application name.
107  *
108  * RETURNS: a pointer to the "remoteTerminals" resource or NULL if the
109  *   resource is not defined.
110  *
111  * NOTES:  The space for the returned string is "malloc'ed".  The calling
112  *   function should free the string.
113  *
114  *****************************************************************************/
115
116 static char 
117 *_GetRemoteTerminalsResource (
118         Display         *display,
119         char            *appClass,
120         char            *appName)
121 {
122    XrmValue resource_value;
123    XrmDatabase db;
124    char *rep_type;
125    char *name;
126    char *class;
127    char *terminals = NULL;
128
129    name = XtMalloc (strlen (DtREMOTE_TERMINALS_NAME) + strlen (appName) + 4);
130    sprintf (name, "%s*%s", appName, DtREMOTE_TERMINALS_NAME);
131
132    class = XtMalloc (strlen (DtREMOTE_TERMINALS_CLASS) + strlen (appClass) + 4);
133    sprintf (class, "%s*%s", appClass, DtREMOTE_TERMINALS_CLASS);
134
135    db = XtDatabase (display);
136    if (XrmGetResource (db, name, class, &rep_type, &resource_value)) 
137       terminals = (char *) XtNewString (resource_value.addr);
138
139    XtFree (name);
140    XtFree (class);
141
142    return (terminals);
143 }
144
145 /******************************************************************************
146  *
147  * GetRemoteTerminalsResource - initializes the "remoteTerminals" resource.
148  *
149  * PARAMETERS:
150  *
151  *   Display *display;       The connection to the X server.
152  *
153  *   char *appClass;            The client's application class.
154  *
155  *   char *appName;             The client's application name.
156  *
157  * MODIFIED:
158  *
159  *   char *cmd_Resources.remoteTerminals; -  Set to the list of remote 
160  *                                           terminals.
161  *
162  *   char *cmd_Resources.remoteHosts;     -  Set to the list of remote hosts..
163  *
164  *****************************************************************************/
165
166 static void 
167 GetRemoteTerminalsResource (
168         Display         *display,
169         char            *appClass,
170         char            *appName)
171 {
172    int num, j;
173    char *terminals;
174    char *pch, *host;
175
176    if ((terminals = _GetRemoteTerminalsResource (display, appClass, appName)) 
177         == NULL) {
178       /*
179        * The resource was not specified, and no defaults are set.
180        */
181       cmd_Resources.remoteHosts = (char **) NULL;
182       cmd_Resources.remoteTerminals = (char **) NULL;
183       return;
184    }
185
186    /*
187     * Find out how many terminals are specified by counting the number of
188     * colons.
189     */
190    for (pch=terminals, num=0; pch != NULL ; ) {
191       if ((pch = DtStrchr (pch, ':')) != NULL) {
192          /*
193           * Move past the ':'.
194           */
195          pch++;
196          num++;
197       }
198    }
199
200    if (num == 0) {
201       /*
202        * No "host:/terminal" pairs were found.
203        */
204       cmd_Resources.remoteHosts = (char **) NULL;
205       cmd_Resources.remoteTerminals = (char **) NULL;
206       return;
207    }
208
209    /*
210     * Create space for the pointers to the hosts and terminals and 
211     * make room for a NULL terminator.
212     *
213     * Note that the host names and terminal names are "vectorized" in
214     * place by replacing the ':' and ',' characters with '\0'.
215     */
216
217    cmd_Resources.remoteHosts = (char **) XtMalloc (num * sizeof(char *));
218    cmd_Resources.remoteTerminals = (char **) XtMalloc (num * sizeof(char *));
219    
220    for (pch=terminals, j=0; j < num && pch != NULL && *pch != '\0'; j++) 
221    {
222
223       host = pch;
224
225       if ((pch = DtStrchr (pch, ':')) == NULL)
226          break;
227
228       /*
229        * Null terminate the host and then move past the ':'.
230        */
231       *pch = '\0';
232       pch++;
233
234       if (*pch == '\0')
235          /* 
236           * Found a host but nothing followed it. 
237           */
238          break;
239
240       cmd_Resources.remoteHosts[j] = host;
241       cmd_Resources.remoteTerminals[j] = pch;
242
243       /*
244        * Find the end of this entry and skip past it.
245        */
246       if ((pch = DtStrchr (pch, ',')) == NULL) {
247          /*
248           * This is the last pair, advance "j" and break the loop.
249           */
250          j++;
251          break;
252       }
253
254       /*
255        * End the terminal name.
256        */
257       *pch = '\0';
258       pch++;
259    }
260    
261    /*
262     * NULL terminate the arrays.
263     */
264    cmd_Resources.remoteHosts[j] = (char *) NULL;
265    cmd_Resources.remoteTerminals[j] = (char *) NULL;
266 }
267
268
269 /******************************************************************************
270  *
271  * GetLocalTerminalResource - initializes the "localTerminal resource.
272  *
273  * PARAMETERS:
274  *
275  *   Display *display;       The connection to the X server.
276  *
277  *   char *appClass;            The client's application class.
278  *
279  *   char *appName;             The client's application name.
280  *
281  * MODIFIED:
282  *
283  *   char *cmd_Resources.localTerminal; -  Set to the "localTerminal"
284  *                                         or to DtDEFUALT_TERMINAL.
285  *
286  *   Boolean cmd_Globals.terminal_ok;   -  Set to True if "localTerminal"
287  *                                         is executable and has the correct
288  *                                         permissions; False otherwise.
289  *
290  *****************************************************************************/
291
292 static void 
293 GetLocalTerminalResource (
294         Display         *display,
295         char            *appClass,
296         char            *appName)
297 {
298    XrmValue resource_value;
299    char *rep_type;
300    char *name;
301    char *class;
302    XrmDatabase db = XtDatabase (display);
303
304    name = XtMalloc (strlen (DtLOCAL_TERMINAL_NAME) + strlen (appName) + 4);
305    sprintf (name, "%s*%s", appName, DtLOCAL_TERMINAL_NAME);
306
307    class = XtMalloc (strlen (DtLOCAL_TERMINAL_CLASS) + strlen (appClass) + 4);
308    sprintf (class, "%s*%s", appClass, DtLOCAL_TERMINAL_CLASS);
309
310    if (XrmGetResource (db, name, class, &rep_type, &resource_value)) 
311       cmd_Resources.localTerminal = (char *) XtNewString (resource_value.addr);
312    else 
313       cmd_Resources.localTerminal = XtNewString (DtTERMINAL_DEFAULT);
314
315    /*
316     * Check to see if the execvp will potentially fail because the 
317     * localTerminal is not accessable or it it is not executable.  If not, 
318     * log an error message.
319     */
320    cmd_Globals.terminal_ok = True;
321    if (!(_DtCmdCheckForExecutable (cmd_Resources.localTerminal))) {
322       char *errorMessage = XtMalloc(MAX_BUF_SIZE);
323
324       cmd_Globals.terminal_ok = False;
325       if (errorMessage)
326       {
327           (void) sprintf (errorMessage, 
328                           cmd_Globals.error_terminal, 
329                           cmd_Resources.localTerminal);
330           _DtCmdLogErrorMessage (errorMessage);
331           XtFree(errorMessage);
332       }
333    }
334
335    XtFree (name);
336    XtFree (class);
337 }
338
339 /******************************************************************************
340  *
341  * GetWaitTimeResource - initializes the "waitTime" resource.
342  *
343  * PARAMETERS:
344  *
345  *   Display *display;          The connection to the X server.
346  *
347  *   char *appClass;            The client's application class.
348  *
349  *   char *appName;             The client's application name.
350  *
351  * MODIFIED:
352  *
353  *   char *cmd_Resources.waitTime; -  Set to the "waitTime" resource
354  *                                        or "True" by default.
355  *
356  *****************************************************************************/
357
358 static void 
359 GetWaitTimeResource (
360         Display         *display,
361         char            *appClass,
362         char            *appName)
363 {
364    XrmValue resource_value;
365    char *rep_type;
366    char *name;
367    char *class;
368    XrmDatabase db= XtDatabase (display);
369
370    cmd_Resources.waitTime = DtWAIT_TIME_DEFAULT;
371
372    name = XtMalloc (strlen (DtWAIT_TIME_NAME) + strlen (appName) + 4);
373    sprintf (name, "%s*%s", appName, DtWAIT_TIME_NAME);
374
375    class = XtMalloc (strlen (DtWAIT_TIME_CLASS) + strlen (appClass) + 4);
376    sprintf (class, "%s*%s", appClass, DtWAIT_TIME_CLASS);
377
378    if (XrmGetResource (db, name, class, &rep_type, &resource_value)) {
379       cmd_Resources.waitTime = atoi (resource_value.addr);
380       if (cmd_Resources.waitTime < 0)
381          cmd_Resources.waitTime = DtWAIT_TIME_DEFAULT;
382    }
383
384    XtFree (name);
385    XtFree (class);
386 }
387
388 /******************************************************************************
389  *
390  * GetDtexecPath - initializes the "dtexecPath" resource.
391  *
392  * PARAMETERS:
393  *
394  *   Display *display;       The connection to the X server.
395  *
396  *   char *appClass;            The client's application class.
397  *
398  *   char *appName;             The client's application name.
399  *
400  * MODIFIED:
401  *
402  *   char *cmd_Resources.dtexecPath; -  Set to the "dtexecPath" resource
403  *                                       or to DtCMD_INV_SUB_PROCESS.
404  *
405  *****************************************************************************/
406
407 static void 
408 GetDtexecPath (
409         Display         *display,
410         char            *appClass,
411         char            *appName)
412 {
413    XrmValue resource_value;
414    char *rep_type;
415    char errorMessage [MAX_BUF_SIZE];
416    char *name;
417    char *class;
418    XrmDatabase db = XtDatabase (display);
419
420    name = XtMalloc (strlen (DtDTEXEC_PATH_NAME) + strlen (appName) + 4);
421    sprintf (name, "%s*%s", appName, DtDTEXEC_PATH_NAME);
422
423    class = XtMalloc (strlen (DtDTEXEC_PATH_CLASS) + strlen (appClass) + 4);
424    sprintf (class, "%s*%s", appClass, DtDTEXEC_PATH_CLASS);
425
426    if (XrmGetResource (db, name, class, &rep_type, &resource_value)) 
427       cmd_Resources.dtexecPath = (char *) XtNewString (resource_value.addr);
428    else 
429       cmd_Resources.dtexecPath = XtNewString (DtCMD_INV_SUB_PROCESS);
430
431    /*
432     * Check to see if the execvp will potentially fail because the 
433     * subprocess is not accessable or it it is not executable.  If not, 
434     * log an error message.
435     */
436    cmd_Globals.subprocess_ok = True;
437    if (!(_DtCmdCheckForExecutable (cmd_Resources.dtexecPath))) {
438       char *errorMessage = XtMalloc(MAX_BUF_SIZE);
439
440       cmd_Globals.subprocess_ok = False;
441       if (errorMessage)
442       {
443           (void) sprintf (errorMessage, 
444                           cmd_Globals.error_subprocess, 
445                           cmd_Resources.dtexecPath);
446           _DtCmdLogErrorMessage (errorMessage);
447           XtFree(errorMessage);
448       }
449    }
450
451    XtFree (name);
452    XtFree (class);
453 }
454
455 /******************************************************************************
456  *
457  * GetExecutionHostLoggingResources - initializes the "executionHostLogging"
458  *   
459  *
460  * PARAMETERS:
461  *
462  *   Display *display;          The connection to the X server.
463  *
464  *   char *appClass;            The client's application class.
465  *
466  *   char *appName;             The client's application name.
467  *
468  * MODIFIED:
469  *
470  *   char *cmd_Resources.executionHostLogging; 
471  *
472  *         -  Set to the "executionHostLogging" resource or "False" by default.
473  *
474  *****************************************************************************/
475
476 static void 
477 GetExecutionHostLoggingResource (
478         Display         *display,
479         char            *appClass,
480         char            *appName)
481 {
482    XrmValue resource_value;
483    char *rep_type;
484    char *name;
485    char *class;
486    XrmDatabase db= XtDatabase (display);
487
488    cmd_Resources.executionHostLogging = False;
489
490    name = XtMalloc (strlen (DtEXECUTION_HOST_LOGGING_NAME) + 
491                     strlen (appName) + 4);
492    sprintf (name, "%s*%s", appName, DtEXECUTION_HOST_LOGGING_NAME);
493
494    class = XtMalloc (strlen (DtEXECUTION_HOST_LOGGING_CLASS) + 
495                      strlen (appClass) + 4);
496    sprintf (class, "%s*%s", appClass, DtEXECUTION_HOST_LOGGING_CLASS);
497
498    if (XrmGetResource (db, name, class, &rep_type, &resource_value)) {
499       if (((strcmp (resource_value.addr, "True")) == 0) ||
500           ((strcmp (resource_value.addr, "true")) == 0) ||
501           ((strcmp (resource_value.addr, "TRUE")) == 0))
502          cmd_Resources.executionHostLogging = True;
503       else if (((strcmp (resource_value.addr, "False")) == 0) ||
504           ((strcmp (resource_value.addr, "false")) == 0) ||
505           ((strcmp (resource_value.addr, "FALSE")) == 0))
506          cmd_Resources.executionHostLogging = False;
507    }
508
509    XtFree (name);
510    XtFree (class);
511 }
512
513 /******************************************************************************
514  *
515  * GetRemoteTerminal - takes a host name "host" and searches the list of remote
516  *   host:terminal pairs for "host" and if found, returns the corresponding
517  *   terminal emulator.
518  *
519  * PARAMETERS:
520  *
521  *   char *host;                - Name of the host to use as the key to find
522  *                                the terminal emulator name.
523  *
524  * RETURNS:  If "host" is found, the corresponding terminal emulator is
525  *   returned, otherwise "NULL" is returned.
526  *
527  *****************************************************************************/
528
529 static char * 
530 GetRemoteTerminal(
531         char *host )
532 {
533    int i;
534
535    if (cmd_Resources.remoteHosts == NULL)
536       return (NULL);
537
538    for (i=0; cmd_Resources.remoteHosts[i] != NULL; i++) {
539       if ((strcmp (host, cmd_Resources.remoteHosts[i])) == 0)
540          return (cmd_Resources.remoteTerminals[i]);
541    }
542
543    return (NULL);
544 }
545
546 /******************************************************************************
547  *
548  * _DtCmdCreateTerminalCommand - takes a windowType, execString 
549  * and execParms and creates an appropriate command to execute.
550  *
551  * Note that if valid execParms are found, they are simply added
552  * to the execution string, before the "-e" option.
553  *
554  * PARAMETERS:
555  *
556  *   char **theCommand;         - The command line to be expanded and returned.
557  *   int windowType;            - The request number (window number).
558  *   char *execString;          - The execution string to be expanded.
559  *   char *execParms;           - The execution parameters.
560  *   char *procId               - tooltalk procId for dtexec
561  *   char *tmpFiles             - string containing tmp file args for dtexec
562  *
563  * MODIFIED:
564  *
565  *    char ** theCommand;       - Contains the completed execution string.
566  *
567  *****************************************************************************/
568
569 void 
570 _DtCmdCreateTerminalCommand(
571         char **theCommand,
572         int windowType,
573         char *execString,
574         char *execParms,
575         char *execHost,
576         char *procId,
577         char *tmpFiles)
578 {
579    char *pGeom = NULL;
580    char *pName = NULL;
581    char *pTitle = NULL;
582    char options[MAX_BUF_SIZE];
583    char *defaultTerminal;
584
585    strcpy(options,execParms);
586    
587    /*
588     * Get the name of the terminal emulator to use.
589     */
590    if ((defaultTerminal = GetRemoteTerminal (execHost)) == NULL)
591       defaultTerminal = cmd_Resources.localTerminal;
592
593    /*
594     * Create space for the expanded command line.
595     */
596    *theCommand = (char *) XtMalloc ( strlen (defaultTerminal) 
597          + strlen(options) 
598          + strlen(cmd_Resources.dtexecPath)
599          + strlen(" -open ") + 4 /* max waitTime len */
600          + strlen(" -ttprocid ") + strlen(_DtActNULL_GUARD(procId))
601          + strlen(_DtActNULL_GUARD(tmpFiles))
602          + strlen(execString) + 9 /* 2 quotes, "-e", 7 blanks, null */ );
603
604    if (windowType == TERMINAL) {
605       (void) sprintf (*theCommand, "%s %s -e %s -open %d -ttprocid '%s' %s %s",
606                       defaultTerminal, options, cmd_Resources.dtexecPath, 
607                       cmd_Resources.waitTime, 
608                       _DtActNULL_GUARD(procId),
609                       _DtActNULL_GUARD(tmpFiles),
610                       execString);
611    }
612    else {
613       (void) sprintf (*theCommand, "%s %s -e %s -open -1 -ttprocid '%s' %s %s",
614                       defaultTerminal, options, cmd_Resources.dtexecPath, 
615                       _DtActNULL_GUARD(procId),
616                       _DtActNULL_GUARD(tmpFiles),
617                       execString);
618    }
619
620 }
621
622 /******************************************************************************
623  * 
624  * _DtCmdCheckForExecutable - checks "fileName" to see if it is executable
625  *   by the user.
626  *
627  * PARAMETERES:
628  *
629  *   char *fileName;    - The name of the file to check.
630  *
631  * RETURNS: "True" if the file is access'able && executable, "False" otherwise.
632  *
633  *****************************************************************************/
634
635 Boolean 
636 _DtCmdCheckForExecutable(
637         char *fileName )
638 {
639    char **ppch;
640    int access;
641
642
643    /* First check to see if the fileName contains the complete path
644     * and is access'able.
645     */
646
647    switch (access = _DtExecuteAccess(fileName)) 
648    {
649         /* execution access allowed for this process */
650        case 1: return True;
651            break;
652         /* file found -- not executable by this process */
653        case 0: return False;
654            break;
655         /* file not found -- yet */
656        case -1: /* fall through */
657        default:
658            break;
659    }
660
661    /* Append fileName to each entry in "cmd_Globals.path_list" and then see
662     * if that is accessable. 
663     */
664
665    for (ppch = cmd_Globals.path_list; *ppch != NULL; ppch++) 
666    {
667       char *longName = XtMalloc(MAXPATHLEN);
668
669       if (longName)
670       {
671           (void) sprintf (longName, "%s/%s", *ppch, fileName);
672           switch (access = _DtExecuteAccess(longName)) 
673           {
674                /* execution access allowed for this process */
675               case 1: return True;
676                   break;
677               /* file found -- not executable by this process */
678               case 0: return False;
679                   break;
680               /* file not found -- yet */
681               case -1: /* fall through */
682               default:
683                   break;
684           }
685           XtFree(longName);
686       }
687    }
688
689    return (False);
690 }
691
692 /******************************************************************************
693  *
694  * _DtCmdValidDir - takes the client host, context directory and a context host
695  *   and checks to see if the directory is valid.
696  *
697  * PARAMETERS:
698  *
699  *   char *clientHost;  - Host where the client is running.
700  *
701  *   char *contextDir;          - Directory to "chdir" to.
702  *
703  *   char *contextHost;         - Host where 'contextDir' resides.
704  *
705  * NOTES:
706  *
707  *   If the context directory is NULL, "chdir" is not run and "True" is
708  *   returned.
709  *
710  * RETURNS:  "True" if "chdir" succeeds and "False" otherwise.
711  *
712  *****************************************************************************/
713
714 Boolean 
715 _DtCmdValidDir(
716         char *clientHost,
717         char *contextDir,
718         char *contextHost )
719 {
720    int          retValue = 0;
721
722    if (contextDir == NULL) 
723       /*
724        * Stay in the same directory.
725        */
726       return (True);
727    if (contextHost == NULL)
728       /*
729        * Change to 'contextDir'.
730        */
731       retValue = chdir (contextDir);
732    else if (_DtIsSameHost (clientHost, contextHost))
733       /*
734        * Just change to 'contextDir'.
735        */
736       retValue = chdir (contextDir);
737    else {
738       /*
739        * Need to create a pathname for the directory.
740        */
741       char      *netfile;
742       char      *path;
743       char      *errorMessage = XtMalloc(MAX_BUF_SIZE);
744
745       /* Old syntax should no longer appear in contextHost/Dir */
746       myassert( *contextHost != '*' && *contextDir != '*' );
747       netfile = (char *) tt_host_file_netfile (contextHost, contextDir);
748       if (tt_pointer_error (netfile) != TT_OK) {
749          (void) sprintf (errorMessage, cmd_Globals.error_directory_name_map, 
750                          contextDir, contextHost,
751                          tt_status_message (tt_pointer_error(netfile)));
752          _DtCmdLogErrorMessage (errorMessage);
753          return (False);
754       }
755
756       path = (char *) tt_netfile_file (netfile);
757       tt_free (netfile);
758       if (tt_pointer_error (path) != TT_OK) {
759          (void) sprintf (errorMessage, cmd_Globals.error_directory_name_map, 
760                          contextDir, contextHost,
761                          tt_status_message (tt_pointer_error(path)));
762          _DtCmdLogErrorMessage (errorMessage);
763          return (False);
764       }
765
766       retValue = chdir (path);
767       tt_free (path);
768       if (errorMessage) XtFree(errorMessage);
769    }
770
771    if (retValue == -1)
772       return (False);
773    else
774       return (True);
775 }
776
777 /******************************************************************************
778  *
779  * _DtCmdGetResources - initializes the Command Invoker's resources.
780  *
781  * PARAMETERS:
782  *
783  *   Display *display;          The connection to the X server.
784  *
785  *   char *appClass;            The client's application class.
786  *
787  *****************************************************************************/
788
789 void
790 _DtCmdGetResources (
791         Display         *display)
792 {
793    char *appClass = NULL;
794    char *appName = NULL;
795
796    /*
797     * Determine the name and class for this client.
798     */
799    XtGetApplicationNameAndClass (display, &appName, &appClass);
800
801    GetLocalTerminalResource (display, appClass, appName);
802
803    GetRemoteTerminalsResource (display, appClass, appName);
804
805    GetWaitTimeResource (display, appClass, appName);
806
807    GetDtexecPath (display, appClass, appName);
808
809    GetExecutionHostLoggingResource (display, appClass, appName);
810 }