NIS function library

Source: Internet
Author: User

The full name of nis is network information system, and yp (yellow pages ). Nis or yp allow many different unix machines to have the same system information, such as the same user account and password, so that System Administrators and Users can easily move between different machines, inevitably, there will be security flaws, but security is not discussed here. And about nis Chinese and English books can be found on the market, or can also refer to the http://www.desy.de /~ Sieversm/ypdoku/ypdoku.html.
To use the nis function library, remember to open the yp option when compiling php, that is, add the -- with-yp option.
Yp_get_default_domain: obtains the domain of the machine.
Yp_order: returns the ordinal number of the map.
Yp_master: gets the master of nis.
Yp_match: Get the specified data.
Yp_first: returns the first matched data in the map.
Yp_next: Specify the next data of map.
Yp_errno: gets the error code of the previous yp operation.
Yp_err_string: gets the error string of the previous yp operation.
Yp_get_default_domain
Obtain the machine's domain.
Syntax: string yp_get_default_domain (void );
Return Value: String
Function Type: Network System
Description: This function is used to find the domain of the server. If the execution is successful, the domain string is returned. If the execution fails, false is returned. You do not need to add parameters when executing this function.
Example

Reference: yp_errno () yp_err_string ()
Yp_order
Returns the ordinal number of the map.
Syntax: int yp_order (string domain, string map );
Return Value: integer
Function Type: Network System
Description: This function is used to obtain the ordinal number of a map. It is used after obtaining domain and map. The returned value is the map sequence. If it fails, false is returned.
Example

Reference: yp_get_default_domain () yp_errno () yp_err_string ()
Yp_master
Obtain the master of nis.
Syntax: string yp_master (string domain, string map );
Return Value: String
Function Type: Network System
Description: This function is used to obtain the master machine on the current domain. It is used after obtaining the domain and map.
Reference: yp_get_default_domain () yp_errno () yp_err_string ()
Yp_match
Obtain the specified information.
Syntax: string yp_match (string domain, string map, string key );
Return Value: String
Function Type: Network System
Description: This function is used to obtain the specified data in map in the specified domain. You can specify the user name for the parameter key.
Example
The following example is used to obtain wilson information.
Returns a string similar to the following string.
Wilson: # wilson: 12345: 380: wilson peng:/home/wilson:/bin/bash
Reference: yp_get_default_domain () yp_errno () yp_err_string ()
Yp_first
Returns the first matched data in the map.
Syntax: array yp_first (string domain, string map );
Returned value: Array
Function Type: Network System
Description: This function is used to obtain the index and value of the first returned data in a specified map. The returned data is an array. If the data fails, false is returned.
Example

Reference: yp_get_default_domain () yp_errno () yp_err_string ()
Yp_next
Specify the next data of map.
Syntax: array yp_next (string domain, string map, string key );
Returned value: Array
Function Type: Network System
Description: This function is used to obtain the index and value of the data returned from the specified data on map. The returned data is an array. If the data fails, false is returned.
Example

Reference: yp_get_default_domain () yp_errno () yp_err_string ()
Yp_errno
Obtain the error code of the previous yp operation.
Syntax: int yp_errno (void );
Return Value: integer
Function Type: Network System
Description: This function is used to get the error of the last yp operation.
[Url = javascript:;] Code [/url]
, The code value and meaning can be found in the bold section below.
Code meaning
1. The function parameter is incorrect.
2 rpc error-domain is no longer tied
3. Unable to hold the server on the domain
4. The specified map cannot be found on the domain.
5. The specified index key cannot be found on the map.
6 yp internal error
7. Resource Acquisition Error
8. Specify map
[Url = javascript:;] database [/url]
No data
9 unable to communicate with portmapper
10 unable to communicate with ypbind
11 unable to communicate with ypserv
12 local domain not configured
13 yp Database Error
Version 14 yp does not match
15. brute-force access
16 Data busy
Yp_err_string
Gets the error string of the previous yp operation.
Syntax: string yp_err_string (void );
Return Value: String
Function Type: Network System
Description: This function is used to obtain the error string for the last yp operation. This function does not require parameters.

  1. Configure the NIS server and client in RHEL 5
  2. How to configure an instance for NIS on RHEL
  3. RHEL5.1 Master/Slave NIS server configuration and Testing

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.