HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Gethostbyname fails in NIS+ environment
Operating System - HP-UX
1835296
Members
2590
Online
110078
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2002 07:50 AM
11-25-2002 07:50 AM
Gethostbyname fails in NIS+ environment
Hi All,
If I run a program that calls gethostbyname in a NIS+ environment it correctly returns a pointer to the correct hostent structure if I run the program as root but it returns NULL I run it as a 'normal' user.
I checked with tusc and I see that there is a permission denied error on the open of the file
/var/nis/NIS_SHARED_DIRCACHE
And subsequently on the file
/var/nis/NIS_COLD_START
We changed the security mask to allow everybody to read the files, but still have the same problem. (I tusc I see the files are opened READONLY)
So my questions
- What should be the default security mask for these files
- Why does ping (as a normal user) succeed in retrieving the ip adress and a program calling gethostbyname not
- What else could cause this problem
Any help will be greatly appreciated.
Johan Harmsen
If I run a program that calls gethostbyname in a NIS+ environment it correctly returns a pointer to the correct hostent structure if I run the program as root but it returns NULL I run it as a 'normal' user.
I checked with tusc and I see that there is a permission denied error on the open of the file
/var/nis/NIS_SHARED_DIRCACHE
And subsequently on the file
/var/nis/NIS_COLD_START
We changed the security mask to allow everybody to read the files, but still have the same problem. (I tusc I see the files are opened READONLY)
So my questions
- What should be the default security mask for these files
- Why does ping (as a normal user) succeed in retrieving the ip adress and a program calling gethostbyname not
- What else could cause this problem
Any help will be greatly appreciated.
Johan Harmsen
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2002 08:09 AM
11-25-2002 08:09 AM
Re: Gethostbyname fails in NIS+ environment
Ping works because even when it's run as a non-root user, it's running with the effective UID of 0 because it's a setuid program owned by root.
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2002 09:14 AM
11-25-2002 09:14 AM
Re: Gethostbyname fails in NIS+ environment
Are you running nsd?
http://www.mcsr.olemiss.edu/cgi-bin/man-cgi?nsd+1
mentions that you can set permissions for several files:
mode The mode attribute controls the permissions of the cache files
created by nsd. This should be set to an octal integer value, the
default is 0666 and is modified by the nsd processes umask.
owner
The owner attribute controls the owner of the cache files created by
nsd. This should be set to an integer user ID, and the default is
0.
group
The group attribute controls the group of the cache files created by
nsd. This should be set to an integer group ID and the default is
0.
Ron
http://www.mcsr.olemiss.edu/cgi-bin/man-cgi?nsd+1
mentions that you can set permissions for several files:
mode The mode attribute controls the permissions of the cache files
created by nsd. This should be set to an octal integer value, the
default is 0666 and is modified by the nsd processes umask.
owner
The owner attribute controls the owner of the cache files created by
nsd. This should be set to an integer user ID, and the default is
0.
group
The group attribute controls the group of the cache files created by
nsd. This should be set to an integer group ID and the default is
0.
Ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2002 04:31 AM
11-26-2002 04:31 AM
Re: Gethostbyname fails in NIS+ environment
Thanks for your help !
Turned out that I completely overlooked the obvious (like with ping...). There was no search permission on the /var/nis directory. Just wondering why a default NIS+ installation does not allow this
Turned out that I completely overlooked the obvious (like with ping...). There was no search permission on the /var/nis directory. Just wondering why a default NIS+ installation does not allow this
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP