summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorKean Johnson <kean@armory.com>2005-11-08 06:33:32 +0000
committerKean Johnson <kean@armory.com>2005-11-08 06:33:32 +0000
commit3834f880ba013be524cd5b4ce4ff75734742ad12 (patch)
tree4bcccc7370254f205d8eb2fec4c64353a9640ab2 /session.c
parentd384b20b3d63f1b28d428f02746d5ec0c1e81a39 (diff)
See ChangeLog entry 2005-11-07 for details.XORG-6_8_99_903XORG-6_8_99_902
Diffstat (limited to 'session.c')
-rw-r--r--session.c44
1 files changed, 41 insertions, 3 deletions
diff --git a/session.c b/session.c
index 66d7696..05aa1dc 100644
--- a/session.c
+++ b/session.c
@@ -61,6 +61,10 @@ extern int key_setnet(struct key_netstarg *arg);
# include <krb5/krb5.h>
#endif
+#ifdef __SCO__
+#include <prot.h>
+#endif
+
#ifndef GREET_USER_STATIC
# include <dlfcn.h>
# ifndef RTLD_NOW
@@ -70,7 +74,7 @@ extern int key_setnet(struct key_netstarg *arg);
static int runAndWait (char **args, char **environ);
-#if defined(CSRG_BASED) || defined(__osf__) || defined(__DARWIN__) || defined(__QNXNTO__) || defined(sun) || defined(__GLIBC__)
+#if defined(CSRG_BASED) || defined(__osf__) || defined(__DARWIN__) || defined(__QNXNTO__) || defined(sun) || defined(__GLIBC__) || defined(__SCO__)
# include <sys/types.h>
# include <grp.h>
#else
@@ -88,7 +92,7 @@ extern struct spwd *getspnam(GETSPNAM_ARGS);
extern void endspent(void);
# endif
#endif
-#if defined(CSRG_BASED) || defined(__GLIBC__) || defined(USL)
+#if defined(CSRG_BASED) || defined(__GLIBC__) || defined(__UNIXWARE__) || defined(__SCO__)
# include <pwd.h>
# include <unistd.h>
#else
@@ -534,6 +538,11 @@ StartClient (
pam_handle_t *pamh = thepamh ();
int pam_error;
#endif
+#ifdef USESECUREWARE
+ char *reason, **smpenv, *smpshell;
+ int ret;
+ extern struct smp_user_info *userp;
+#endif
if (verify->argv) {
Debug ("StartSession %s: ", verify->argv[0]);
@@ -570,6 +579,35 @@ StartClient (
}
#endif
+#ifdef USESECUREWARE
+ Debug ("set_identity: uid=%d\n", userp->pw.pw_uid);
+ ret = smp_set_identity (userp, &reason, &smpenv, &smpshell);
+ Debug ("smp_set_identity returns %d luid=%d\n", ret, getluid());
+ switch (ret) {
+ case SMP_FAIL:
+ LogError ("Unable to set identity\n");
+ smp_audit_fail (userp, 0);
+ return 0;
+ case SMP_EXTFAIL:
+ LogError ("Unable to set identity: %s\n", reason);
+ smp_audit_fail (userp, 0);
+ return 0;
+ case SMP_NOTAUTH:
+ LogError ("Authorization failed\n");
+ smp_audit_fail (userp, 0);
+ return 0;
+ case SMP_ACCTLOCK:
+ LogError ("Account is locked\n");
+ smp_audit_fail (userp, 0);
+ return 0;
+ case SMP_COMPLETE:
+ break;
+ default:
+ LogError ("Unhandled identity error %d\n", ret);
+ smp_audit_fail (userp, 0);
+ return 0;
+ }
+#endif
#ifndef AIXV3
#ifndef HAS_SETUSERCONTEXT
@@ -911,7 +949,7 @@ systemEnv (struct display *d, char *user, char *home)
return env;
}
-#if (defined(Lynx) && !defined(HAS_CRYPT)) || defined(SCO) && !defined(SCO_USA) && !defined(_SCO_DS)
+#if (defined(Lynx) && !defined(HAS_CRYPT))
char *crypt(char *s1, char *s2)
{
return(s2);