* details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with these librararies and programs; if not, write
+ * License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
****************************************************************************
************************************<+>*************************************/
+#include <stdlib.h>
#include <limits.h>
#include <stddef.h>
#include <unistd.h>
#include <locale.h>
#include <sys/param.h> /* for MAXPATHLEN and MAXHOSTNAMELEN */
-#ifdef sun
+#if defined(sun) || defined(linux)
#include <crypt.h>
#include <shadow.h>
#endif
#include <X11/Intrinsic.h>
#include <Xm/XmP.h>
#include <Xm/Text.h>
+#include <Xm/TextF.h>
#include <Xm/SelectioB.h>
#include <Xm/MessageB.h>
#include <Xm/Protocols.h>
{ "-termOpts", "termOpts", XrmoptionSepArg, NULL},
};
-/* Fallback Resources */
-static char *fallback_resources[] = {
- "*timeout: 5",
- (char *) NULL
-};
-
typedef struct {
char * user;
char * contextDir;
}
-void
+int
main(
int argc,
char **argv )
int n=0;
char *actionName;
int numArgs = 0;
- char contextDir[MAXPATHLEN+1];
DtActionArg *ap = NULL;
XtSetLanguageProc(NULL, NULL, NULL);
&argc, argv)) )
{
setlocale(LC_ALL, "");
- fprintf(stderr,GETMESSAGE(1,11,"Can't open display.\n"));
+ fprintf(stderr, "%s", GETMESSAGE(1,11,"Can't open display.\n"));
exit(-1);
}
*/
if ( (actionName = argv[1]) == NULL)
{
- fprintf(stderr,GETMESSAGE(1,10,"No action name specified.\n"));
+ fprintf(stderr, "%s", GETMESSAGE(1,10,"No action name specified.\n"));
exit(-1);
}
XtAppMainLoop(appContext);
+ return EXIT_SUCCESS;
}
/* fix process gid */
#if defined(SVR4) || defined(_AIX)
setgid(rgid);
-#elif defined(__osf__) || defined(linux) || defined(CSRG_BASED)
- setregid(rgid, rgid);
+#elif defined(linux) || defined(CSRG_BASED)
+ if(-1 == setregid(rgid, rgid)) {
+ fprintf(stderr, "SetGidUid: setregid failed on %d\n", rgid);
+ }
#elif defined(__hpux)
setresgid(rgid, rgid, rgid);
#else
/* fix process uid */
#if defined (SVR4) || defined (_AIX)
setuid(ruid);
-#elif defined(__osf__) || defined(linux) || defined(CSRG_BASED)
- setreuid(ruid, ruid);
+#elif defined(linux) || defined(CSRG_BASED)
+ if(-1 == setreuid(ruid, ruid)) {
+ fprintf(stderr, "SetGidUid: setreuid failed on %d\n", ruid);
+ }
#elif defined(__hpux)
setresuid(ruid, ruid, ruid);
#else
/* Set up the user's new id's */
SetGidUid(basegid,newuid);
-#ifndef sco
initgroups(appArgs.user, basegid);
-#endif
}