Sorry for answering myself, but I only realized this is the same kind of
bug as the previous one, but more convoluted.

the "replace" script does the right only if *both* the
SunOS5/i386-5.10/i86 and SunOS5/i386-5.10/amd64 directories are present.
If not, it assumes it can replace the binaries directly. This is
obviously an insufficient check.

The "buildsunos" script is the one supposed to create those directories
in the first place.
Again, the check is insufficient. If that one fails, it assumes 32 bit
only, and won't create architecture subdirectories:

        if [ $solrev -ge 10 ] && /bin/optisa sparcv8plus amd64 > /dev/null

However, I'm running S10 on a 32 bit processor, so that check will fail
(no amd64), but the i86/ and amd64/ subdirectories are *still* both needed.

I think the check should only be on the version of Solaris and the
ability of the compiler to generate both i86 and amd64 binaries. And in
any case, even if amd64 binaries are not possible, it should always use
an i86/ subdirectory, not . , and the "replace" script should, too.

Of course, this issue does not exist on SPARC, since there's no 32 bit
SPARC supported by S10.

Laurent


Laurent Blume a écrit :
> I've tried replacing S10U4 IPF by Darren's (since I'm badly hit by the
> NAT issue). I used the SunOS5/replace script as advised in a previous post.
> 
> Right afterwards, I got an interesting problem:
> # w
> no rules loaded
> 
> A whole bunch of files were not what they used to be:
> [...]
> -r-xr-xr-x  73 root     bin      2025368 sept. 25 18:16 nohup
> -r-xr-xr-x  73 root     bin      2025368 sept. 25 18:16 newtask
> -r-xr-xr-x  73 root     bin      2025368 sept. 25 18:16 mdb
> -r-xr-xr-x  73 root     bin      2025368 sept. 25 18:16 gcore
> -r-xr-xr-x  73 root     bin      2025368 sept. 25 18:16 cputrack
> -r-xr-xr-x  73 root     bin      2025368 sept. 25 18:16 adb
> 
> 
> All those files are actually stubs, that run isaexec(3C) to choose
> between i86/<file> or amd64/<file>.
> 
> # pkgchk -lp /usr/sbin/ipf
> Pathname: /usr/sbin/ipf
> Type: linked file
> Source of link: ../../usr/lib/isaexec
> 
> The "replace" script use cp to overwrite that stub, and since it's also
> used by many other files, it has a very nasty side-effect of replacing
> many things by IP Filter:
> 
> $ SunOS5/replace
> i386-5.10
> UPDATE /usr/sbin  ipf:ipf.exe
> /bin/cp i386-5.10//ipf.exe /usr/sbin//ipf
> UPDATE /usr/sbin  ipfs
> /bin/cp i386-5.10//ipfs /usr/sbin//ipfs
> UPDATE /usr/sbin  ipfstat
> /bin/cp i386-5.10//ipfstat /usr/sbin//ipfstat
> UPDATE /usr/sbin  ipmon
> /bin/cp i386-5.10//ipmon /usr/sbin//ipmon
> UPDATE /usr/sbin  ipnat
> /bin/cp i386-5.10//ipnat /usr/sbin//ipnat
> UPDATE /usr/sbin  ippool
> /bin/cp i386-5.10//ippool /usr/sbin//ippool
> 
> 
> The targets of that script should be the real executables, ie:
> -r-xr-xr-x   1 root     bin   57288 août 14 19:24 /usr/sbin/amd64/ipmon
> -r-xr-xr-x   1 root     bin   45048 août 14 19:24 /usr/sbin/i86/ipmon
> 
> Luckily, it's not difficult to switch back to the stub if it's still
> available:
> 
> # cp -p ~laurent/isaexec /usr/sbin/ipf
> 
> # w
>   6:44pm  actif  2:26,  3 utilisateurs, charge moyenne : 0,05, 0,05, 0,09
> User     tty           login@  idle   JCPU   PCPU  what
> laurent  pts/1         6:01pm            1         w
> laurent  pts/2         4:30pm  1:46      8      8  -bash
> laurent  pts/3         6:22pm     6     19         -bash
> laurent  pts/4         6:38pm     5                -bash
> 
> Laurent


-- 
/ Leader de Projet & Communauté    | I'm working, but not speaking for
\ G11N   http://fr.opensolaris.org | Bull Services http://www.bull.com
/ FOSUG  http://guses.org          |

Reply via email to