Update for Tru64 Unix

Chris Adams cmadams at hiwaay.net
Thu Feb 27 13:03:41 EST 2003


Here is a long-overdue (sorry about that) patch for Tru64.  It is pretty
minor mostly (minor formatting and removal of a couple of unneeded
calls), and it disables post-auth privsep (so that OpenSSH will work
"out of the box" on Tru64, avoiding the many questions).

I'm also looking at getting setproctitle working.  For Tru64 4.x, it
isn't a big deal (normal PS_USE_CLOBBER_ARGV will work), but Tru64 5.x
aligns the argv elements on 64 bit boundaries, making them look
non-contiguous, when in fact they are (and overwriting the bits in
between really does show up).  I'll work on that and try to get a patch
out soon (it'll more-or-less be based on the FFR code in sendmail that
was based on what I sent them).
-- 
Chris Adams <cmadams at hiwaay.net>
Systems and Network Administrator - HiWAAY Internet Services
I don't speak for anybody but myself - that's enough trouble.


diff -urN openssh-SNAP-20030226/README.privsep openssh/README.privsep
--- openssh-SNAP-20030226/README.privsep	Tue Jun 25 19:43:57 2002
+++ openssh/README.privsep	Wed Feb 26 19:48:37 2003
@@ -43,6 +43,10 @@
 configuration.  PAMAuthenticationViaKbdInt does not function with
 privsep.
 
+On Compaq Tru64 Unix, only the pre-authentication part of privsep is
+supported.  Post-authentication privsep is disabled automatically (so
+you won't see the additional process mentioned below).
+
 Note that for a normal interactive login with a shell, enabling privsep
 will require 1 additional process per login session.
 
diff -urN openssh-SNAP-20030226/auth-sia.c openssh/auth-sia.c
--- openssh-SNAP-20030226/auth-sia.c	Tue Jan 21 22:42:27 2003
+++ openssh/auth-sia.c	Wed Feb 26 19:46:17 2003
@@ -45,27 +45,25 @@
 extern int saved_argc;
 extern char **saved_argv;
 
-extern int errno;
-
 int
 auth_sia_password(Authctxt *authctxt, char *pass)
 {
 	int ret;
 	SIAENTITY *ent = NULL;
 	const char *host;
-	char *user = authctxt->user;
 
 	host = get_canonical_hostname(options.verify_reverse_mapping);
 
-	if (pass[0] == '\0')
+	if (!authctxt->user || !pass || pass[0] == '\0')
 		return(0);
 
-	if (sia_ses_init(&ent, saved_argc, saved_argv, host, user, NULL, 0,
-	    NULL) != SIASUCCESS)
+	if (sia_ses_init(&ent, saved_argc, saved_argv, host, authctxt->user,
+	    NULL, 0, NULL) != SIASUCCESS)
 		return(0);
 
 	if ((ret = sia_ses_authent(NULL, pass, ent)) != SIASUCCESS) {
-		error("Couldn't authenticate %s from %s", user, host);
+		error("Couldn't authenticate %s from %s", authctxt->user,
+		    host);
 		if (ret & SIASTOP)
 			sia_ses_release(&ent);
 		return(0);
@@ -77,48 +75,35 @@
 }
 
 void
-session_setup_sia(char *user, char *tty)
+session_setup_sia(struct passwd *pw, char *tty)
 {
-	struct passwd *pw;
 	SIAENTITY *ent = NULL;
 	const char *host;
 
-	host = get_canonical_hostname (options.verify_reverse_mapping);
+	host = get_canonical_hostname(options.verify_reverse_mapping);
 
-	if (sia_ses_init(&ent, saved_argc, saved_argv, host, user, tty, 0,
-	    NULL) != SIASUCCESS) {
+	if (sia_ses_init(&ent, saved_argc, saved_argv, host, pw->pw_name, tty,
+	    0, NULL) != SIASUCCESS)
 		fatal("sia_ses_init failed");
-	}
 
-	if ((pw = getpwnam(user)) == NULL) {
-		sia_ses_release(&ent);
-		fatal("getpwnam: no user: %s", user);
-	}
 	if (sia_make_entity_pwd(pw, ent) != SIASUCCESS) {
 		sia_ses_release(&ent);
 		fatal("sia_make_entity_pwd failed");
 	}
 
 	ent->authtype = SIA_A_NONE;
-	if (sia_ses_estab(sia_collect_trm, ent) != SIASUCCESS) {
-		fatal("Couldn't establish session for %s from %s", user,
-		    host);
-	}
-
-	if (setpriority(PRIO_PROCESS, 0, 0) == -1) {
-		sia_ses_release(&ent);
-		fatal("setpriority: %s", strerror (errno));
-	}
+	if (sia_ses_estab(sia_collect_trm, ent) != SIASUCCESS)
+		fatal("Couldn't establish session for %s from %s",
+		    pw->pw_name, host);
 
-	if (sia_ses_launch(sia_collect_trm, ent) != SIASUCCESS) {
-		fatal("Couldn't launch session for %s from %s", user, host);
-	}
+	if (sia_ses_launch(sia_collect_trm, ent) != SIASUCCESS)
+		fatal("Couldn't launch session for %s from %s", pw->pw_name,
+		    host);
 	
 	sia_ses_release(&ent);
 
-	if (setreuid(geteuid(), geteuid()) < 0) {
+	if (setreuid(geteuid(), geteuid()) < 0)
 		fatal("setreuid: %s", strerror(errno));
-	}
 }
 
 #endif /* HAVE_OSF_SIA */
diff -urN openssh-SNAP-20030226/auth-sia.h openssh/auth-sia.h
--- openssh-SNAP-20030226/auth-sia.h	Fri Apr 12 10:36:08 2002
+++ openssh/auth-sia.h	Wed Feb 26 19:43:34 2003
@@ -27,6 +27,6 @@
 #ifdef HAVE_OSF_SIA
 
 int	auth_sia_password(Authctxt *authctxt, char *pass);
-void	session_setup_sia(char *user, char *tty);
+void	session_setup_sia(struct passwd *pw, char *tty);
 
 #endif /* HAVE_OSF_SIA */
diff -urN openssh-SNAP-20030226/configure.ac openssh/configure.ac
--- openssh-SNAP-20030226/configure.ac	Sun Feb 23 22:45:43 2003
+++ openssh/configure.ac	Wed Feb 26 19:43:34 2003
@@ -330,6 +330,7 @@
 			AC_MSG_RESULT(yes)
 			AC_DEFINE(HAVE_OSF_SIA)
 			AC_DEFINE(DISABLE_LOGIN)
+			AC_DEFINE(DISABLE_FD_PASSING)
 			LIBS="$LIBS -lsecurity -ldb -lm -laud"
 		else
 			AC_MSG_RESULT(no)
diff -urN openssh-SNAP-20030226/session.c openssh/session.c
--- openssh-SNAP-20030226/session.c	Sun Feb 23 20:04:02 2003
+++ openssh/session.c	Wed Feb 26 19:43:34 2003
@@ -1320,7 +1320,7 @@
 	 */
 	if (!options.use_login) {
 #ifdef HAVE_OSF_SIA
-		session_setup_sia(pw->pw_name, s->ttyfd == -1 ? NULL : s->tty);
+		session_setup_sia(pw, s->ttyfd == -1 ? NULL : s->tty);
 		if (!check_quietlogin(s, command))
 			do_motd();
 #else /* HAVE_OSF_SIA */




More information about the openssh-unix-dev mailing list