Porting socket app SunOS 4.1.3 -> SunOS 5.3 ???

Porting socket app SunOS 4.1.3 -> SunOS 5.3 ???

Post by Keijo Niku » Sat, 26 Nov 1994 06:28:52



I'm having difficulties on SunOS 5.3 with socket app that works fine on SunOS
4.1.3. The application compiles fine (with some warnings) but no sockets can
be created when the app is run. When I studied the warnings I noticed that
there are differences in SunOS 4.1.3 (== Solaris 1.x ???) and SunOS 5.3 (==
Solaris 2.3) sockets libraries.

Is there any check list for modifications or compatibility library to link
with? I would appreciate any help.

-Keijo

--
                        address   Merikoskenkatu 9 B 41, 90500 OULU, FINLAND
                        voice     +358-81-537 2470 or +358-81-343 930
Keijo Nikula            fax       +358-81-537 2338

                        x.400     /S=knikula/OU=stekt/O=oulu/ADMD=fumail/C=fi/

 
 
 

Porting socket app SunOS 4.1.3 -> SunOS 5.3 ???

Post by Casper H.S. D » Sat, 26 Nov 1994 06:44:50



>I'm having difficulties on SunOS 5.3 with socket app that works fine on SunOS
>4.1.3. The application compiles fine (with some warnings) but no sockets can
>be created when the app is run. When I studied the warnings I noticed that
>there are differences in SunOS 4.1.3 (== Solaris 1.x ???) and SunOS 5.3 (==
>Solaris 2.3) sockets libraries.

What problems do you have exactly?

When compiling sockets app on Solaris 2.x you should keep in mind:

        - listen(s, n) now works as documented, not as implemented in BSD
          [ BSD uses n' = n * 3/2 + 1 ]
        - all socket structures must be completely zeroed and then filled
          in correctly.  Solaris 2.x does error checking, BSD sockets often
          do not.
        - all constants should be included from the header files, and not
          filled in by hand.   They have changed.
        - setsockopt may give you some trouble.  (BSD setsockopt sort-of
          operates in a DWIM mode.)
        - UDP sockets won't return errors when a ICMP port unreach is returned.

Casper

 
 
 

Porting socket app SunOS 4.1.3 -> SunOS 5.3 ???

Post by Matt Wet » Sat, 26 Nov 1994 07:15:22





>>I'm having difficulties on SunOS 5.3 with socket app that works fine on SunOS
>>4.1.3. The application compiles fine (with some warnings) but no sockets can
>>be created when the app is run. When I studied the warnings I noticed that
>>there are differences in SunOS 4.1.3 (== Solaris 1.x ???) and SunOS 5.3 (==
>>Solaris 2.3) sockets libraries.

>What problems do you have exactly?

>When compiling sockets app on Solaris 2.x you should keep in mind:

>    - listen(s, n) now works as documented, not as implemented in BSD
>      [ BSD uses n' = n * 3/2 + 1 ]
>    - all socket structures must be completely zeroed and then filled
>      in correctly.  Solaris 2.x does error checking, BSD sockets often
>      do not.
>    - all constants should be included from the header files, and not
>      filled in by hand.   They have changed.
>    - setsockopt may give you some trouble.  (BSD setsockopt sort-of
>      operates in a DWIM mode.)
>    - UDP sockets won't return errors when a ICMP port unreach is returned.

>Casper

Here are problems I've run into:
        setsockopt(SOL_SOCKET, SO_REUSEADDR, 0, 0)
works on SunOS4, not SunOS5.  Use
        one = 1;
        setsockopt(SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one))

--

 
 
 

Porting socket app SunOS 4.1.3 -> SunOS 5.3 ???

Post by Casper H.S. D » Sat, 26 Nov 1994 07:39:01



>Here are problems I've run into:
>    setsockopt(SOL_SOCKET, SO_REUSEADDR, 0, 0)
>works on SunOS4, not SunOS5.  Use
>    one = 1;
>    setsockopt(SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one))

This seems to have been common usage, however the manual page of
setsockopt suggests otherwise.

(Switching SO_REUSEADDR on would require a parameter with the value one,
it isn't in the sunos 4 call)

Casper

 
 
 

1. Migrating user information from SunOS 4 to Solaris 2.3 (SunOS 5.3

Has anyone come up with a relatively straightforward process for migrating
user (password and home directory) information from SunOS 4 (/etc files or
NIS maps) to Solaris 2.3 (NIS+)?  This process is proving to be a real
pain, and the manuals are so far from user-friendly that they might as well
be written in Japanese.

I've been able to import the /etc/passwd information using nisaddent.  This
doesn't seem to set up the passwords properly, though; running 'nispasswd'
explicitly on each user seems to be required before it's possible to log
in.

Once this has been done, logins seem to work fine on the NIS+ server or
client machines, but it's still not possible for a user to change his
password - nispasswd just says 'Sorry'.  So I went and added the user to
the credentials table with 'nisaddcred' (local and des entries), and now
nispasswd works.

Here's the process I've worked out so far:

        # cat old-passwd-file | nisaddent passwd
        [repeat the following lines for every user in the passwd file]
        # nispasswd user-name  
        # nisaddcred -p userid -P username.domain. local

All of these commands are documented in the NIS+ manual, but never all in
one place.  Surely there's a better way than this tedious procedure.

Once I've done this, I can't view the user information using admintool.
When I try to view a user in the User Account Manager window, I get the
error "Error code is 202, failure mode is CLEAN.  Error -2130640896
converting expiration date from internal format."  This suggests something
wrong the password expiration fields in the passwd table, but I would have
expected that NIS+ would have at least provided valid defaults.

Thanks for your help,
-Jason

=======================================================================

   CTP, Inc.   304 Vassar St.   Cambridge MA 02139     (617)374-8223
=======================================================================

2. USB with 2.4.3-ac{1,3,7} without devfs

3. SunOS 5.3 (Solaris 5.3) Patch Report

4. PROBLEM: serial port driver grabs occupied port

5. SunOS 5.3 Server sockets?

6. Is Unicode ever going to replace ASCII?

7. reading *.gz files with Lynx ?

8. SOCKET PROGRAMMING (SunOS 4 vs SunOS 5) QUESTION...

9. HP-UX to SunOS port: Unix socket not a socket??

10. Porting from SunOS (4.1) to Solaris (SunOS 5.5.1)

11. SunOS 5.3 getsockopt() not meaningful ?