static Boolean CanReAuthenticate(char *name, uid_t uid, char *passwd,
struct passwd **pwent, struct spwd **spent)
{
- Boolean fail = False;
+ if (!pwent)
+ return False;
+
+ *pwent = (name == NULL) ? getpwuid(uid) : getpwnam(name);
+ if (!*pwent)
+ return False;
- if (pwent)
- *pwent = (name == NULL) ? getpwuid(uid) : getpwnam(name);
- *spent = getspnam((*pwent)->pw_name);
+ *spent = getspnam((*pwent)->pw_name);
#ifdef JET_AUTHDEBUG
- fprintf(stderr, "CanReAuthenticate(): %s %s %s\n",
+ fprintf(stderr, "CanReAuthenticate(): uid: %d name: '%s' errno %d %s %s %s\n",
+ uid,
+ (name) ? name : "NULL",
+ errno,
(*pwent) ? "PWENT" : "NULL",
(*spent) ? "SPENT" : "NULL",
(name) ? name : "NULL");
#ifdef _AIX
#define SECURE_SYS_PATH "/etc/security/passwd"
#endif
-#ifdef SVR4
+#if defined(SVR4) || defined(__linux__)
#define SECURE_SYS_PATH "/etc/shadow"
#endif
#ifdef CSRG_BASED
* prepended with <unknown program name> in the error log.
*/
DtProgName = SM_RESOURCE_NAME ;
-
+
#ifdef DEBUG
if(argc > 5)
{
*/
smGD.runningUID = getuid();
-#ifdef linux /* linux always needs to be setup as secure */
-
- /*
- * Save the root privilege to be restored when trying to unlock
- */
- smGD.unLockUID = geteuid();
- smGD.secureSystem = True;
- SM_SETEUID(smGD.runningUID);
-
-#else
-
# ifdef SECURE_SYS_PATH
status = stat(SECURE_SYS_PATH, &buf);
# else
SM_SETEUID(smGD.runningUID);
}
-#endif /* linux */
-
/*
* Initialize LANG if it isn't defined.
*/
stopvec.sa_handler = StopAll;
sigemptyset(&stopvec.sa_mask);
stopvec.sa_flags = 0;
-
+
smGD.childvec.sa_handler = WaitChildDeath;
sigemptyset(&smGD.childvec.sa_mask);
smGD.childvec.sa_flags = 0;
* Create one display connection for dtsession, and one for
* the color server. We cannot share a display connection since
* motif creates a display object for the color server's display during
- * color server initialization. Since the color server is not yet
+ * color server initialization. Since the color server is not yet
* operational, any dialogs (ie the dtsession logout confirmation
- * dialogs) created on that display do not get the color server colors.
+ * dialogs) created on that display do not get the color server colors.
* The dtsession display object is created after color server
* initialization is complete.
*/
*/
XtToolkitInitialize();
smGD.appCon = XtCreateApplicationContext();
- smGD.display = XtOpenDisplay(smGD.appCon, NULL, argv[0],
+ smGD.display = XtOpenDisplay(smGD.appCon, NULL, argv[0],
SM_RESOURCE_CLASS,
NULL, 0, &argc, argv);
}
NULL, 0, &argc, argv);
/*
- * Initialize XSMP
+ * Initialize XSMP
*/
if (!InitXSMP (argv[0]))
SM_EXIT(-1);
StartWM();
}
- /*
+ /*
* Run the user's startup script if there is one
*/
*
* Description:
* -----------
- * Register with X11 screen saver server extension for screen saver events.
+ * Register with X11 screen saver server extension for screen saver events.
*
* Inputs:
* ------
*/
screen = DefaultScreen(display);
root = DefaultRootWindow(display);
-
+
XGrabServer(display);
if (!XScreenSaverGetRegistered(display, screen, &xid, &type))
{
- /*
+ /*
* No other clients registered with this server so register this one.
*/
XScreenSaverRegister(display, screen, XtWindow(smGD.topLevelWid), XA_WINDOW);
{
XSetWindowAttributes attr;
- /*
+ /*
* Registration successful.
*/
- XScreenSaverSelectInput(display, root,
+ XScreenSaverSelectInput(display, root,
ScreenSaverNotifyMask|ScreenSaverCycleMask);
/* Even though OverrideRedirect is the default attribute in this
CopyFromParent, CopyFromParent, CWOverrideRedirect, &attr);
}
}
- return(result);
+ return(result);
}
#endif /* USE_X11SSEXT */
-