Thomas Baden
2003-Sep-29 21:37 UTC
Bus Error with OpenSSH 3.7.1p2 on Solaris 8, SPARC 64-bit, YASSP
I had a problem much like the one that Matthias Koeppe experienced. I would only get the BUS error when running in a YASSP-modified system, though. The binary worked fine on a non-YASSP host. I applied his change to use a long for the mask, and it works now. Cheers, -Thomas __________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com
Darren Tucker
2003-Sep-29 23:08 UTC
Bus Error with OpenSSH 3.7.1p2 on Solaris 8, SPARC 64-bit, YASSP
Thomas Baden wrote:> > I had a problem much like the one that Matthias Koeppe > experienced. I would only get the BUS error when > running in a YASSP-modified system, though. The > binary worked fine on a non-YASSP host. > > I applied his change to use a long for the mask, and > it works now.I must admit I missed Matthias' original post. The problem as I understand it is that mode_t can be a (32bit) uint, which messes up the (64bit) long format in sscanf in some 64bit configurations. Matthias' original patch is attached, and I don't see a cleaner way to do it except maybe mode_t mask; if (sscanf(var, "%5lo", &(mode_t)mask) == 1) I don't even know if that will fix it. I can't test it. -- Darren Tucker (dtucker at zip.com.au) GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69 Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement. -------------- next part -------------- Index: session.c ==================================================================RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/session.c,v retrieving revision 1.255 diff -u -p -r1.255 session.c --- session.c 22 Sep 2003 11:04:23 -0000 1.255 +++ session.c 29 Sep 2003 22:27:39 -0000 @@ -916,6 +916,7 @@ read_etc_default_login(char ***env, u_in char **tmpenv = NULL, *var; u_int i, tmpenvsize = 0; mode_t mask; + unsigned long long_mask; /* * We don't want to copy the whole file to the child's environment, @@ -934,9 +935,11 @@ read_etc_default_login(char ***env, u_in if (var != NULL) child_set_env(env, envsize, "PATH", var); - if ((var = child_get_env(tmpenv, "UMASK")) != NULL) - if (sscanf(var, "%5lo", &mask) == 1) + if ((var = child_get_env(tmpenv, "UMASK")) != NULL) { + if (sscanf(var, "%5lo", &long_mask) == 1) + mask = (mode_t)long_mask; umask(mask); + } for (i = 0; tmpenv[i] != NULL; i++) xfree(tmpenv[i]);
Apparently Analagous Threads
- Fwd: Re: 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
- Bus Error with openssh 3.7.1p1 on 64-bit Sparc/Solaris
- openssh 3.7p1 bus error on sparcv9
- openssh 3.7.1p2 fault on solaris 9 for sparc when built as 64-bit