RE: gethostname returns loginname on "Pather Server" version
RE: gethostname returns loginname on "Pather Server" version
- Subject: RE: gethostname returns loginname on "Pather Server" version
- From: Sanjay Arora <email@hidden>
- Date: Fri, 6 Feb 2004 15:52:17 +0530
'hostname' command returns "admin".
Following is the code snippet i am trying.
hinfo = gethostname(name,255);
hinfo2 = gethostbyname(name)
inaddr = (in_addr*)hinfo2->h_addr;
*addr = inaddr->s_addr;
the name returned is "admin" and gethostbyname fails thereafter.
Regards
Sanjay
-----Original Message-----
From: Justin Walker [
mailto:email@hidden]
Sent: Friday, February 06, 2004 12:46 PM
To: email@hidden
Subject: Re: gethostname returns loginname on "Pather Server" version
On Thursday, February 5, 2004, at 09:54 PM, Sanjay Arora wrote:
>
Well that means I would need to change my code for "Panther Server"
>
version.
>
But we would still be interested to know why a standard API like
>
gethostname would behave differently on "Panther Server" and all other
>
MacOS
>
versions.
That is a very good question. I have some as well:
Have you tried the 'hostname' command to verify that it returns
something sensible?
Does this happen on all Mac OS X Server boxes (of those you have access
to) running 10.3?
Does this odd behavior occur on code compiled on the server, or do you
compile it elsewhere and try it on the server?
To add to Quinn's comments, I don't see how getting the host name from
'gethostname()' is going to lead you to an IP address. All this does
is to return what was set by 'sethostname()', and that can be almost
any sequence of bits, totally unrelated to the DNS or other name
resolution scheme in use where your customers are.
Regards,
Justin
--
/~\ The ASCII Justin C. Walker, Curmudgeon-at-Large
\ / Ribbon Campaign
X Help cure HTML Email
/ \
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.