Matthias Koeppe
2003-Sep-25 16:54 UTC
Bus Error with openssh 3.7.1p1 on 64-bit Sparc/Solaris
I compiled openssh 3.7.1p1 on Solaris 9 with the Forte compiler in
64-bit mode. After authentication, a forked child of sshd dies with a
Bus Error in `read_etc_default_login' (session.c).
The reason is the use of `sscanf' with control string "%5lo" on a
`mode_t' value. On Solaris in 64-bit mode, `mode_t' is an `unsigned
int' (32 bits), whereas `long' is 64 bits.
Here is a change that fixed the problem for me. You might want to fix
it in cleaner way, however.
Regards,
Matthias
diff -u /home/mkoeppe/s/ATTIC/openssh-3.7.1p1/session.c\~
/home/mkoeppe/s/ATTIC/openssh-3.7.1p1/session.c
--- /home/mkoeppe/s/ATTIC/openssh-3.7.1p1/session.c~ Tue Sep 16 03:52:19 2003
+++ /home/mkoeppe/s/ATTIC/openssh-3.7.1p1/session.c Thu Sep 25 18:50:00 2003
@@ -915,6 +915,7 @@
u_int i;
size_t tmpenvsize = 0;
mode_t mask;
+ unsigned long long_mask;
/*
* We don't want to copy the whole file to the child's environment,
@@ -931,8 +932,10 @@
child_set_env(env, envsize, "PATH", var);
if ((var = child_get_env(tmpenv, "UMASK")) != NULL)
- if (sscanf(var, "%5lo", &mask) == 1)
+ if (sscanf(var, "%5lo", &long_mask) == 1) {
+ mask = (mode_t) long_mask;
umask(mask);
+ }
for (i = 0; tmpenv[i] != NULL; i++)
xfree(tmpenv[i]);
--
Matthias Koeppe -- http://www.math.uni-magdeburg.de/~mkoeppe
On Thu, 25 Sep 2003, Matthias Koeppe wrote:> I compiled openssh 3.7.1p1 on Solaris 9 with the Forte compiler in > 64-bit mode. After authentication, a forked child of sshd dies with a > Bus Error in `read_etc_default_login' (session.c).I think that was fixed in 3.7.1p2 -- Tim Rice Multitalents (707) 887-1469 tim at multitalents.net
Possibly Parallel Threads
- Bus Error with OpenSSH 3.7.1p2 on Solaris 8, SPARC 64-bit, YASSP
- Fwd: Re: Bus Error with OpenSSH 3.7.1p2 on Solaris 8, SPARC 64-bit, YASSP
- openssh 3.7p1 bus error on sparcv9
- Fwd: Re: Bus Error with OpenSSH 3.7.1p2 on Solaris 8, SPARC 64-bit
- Problem with enabling /etc/default(s)/login on Cygwin