|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-04-10 03:11 UTC] tex at cselt1 dot polito dot it
// Found NIS Domain
$domain = yp_get_default_domain();
if(!$domain) {
error("NIS Error","No NIS Domain found");
exit();
}
if ($debug==1) {
$output .= "NIS Domain: <STRONG>" . $domain . "</STRONG>\n";
$output .="<BR>\n";
}
// Find first entry in NIS passwd table
$entry = yp_first($domain, "passwd.byname");
if(!$entry) {
error("NIS Error","No entry in passewd NIS table");
exit();
}
$key=$entry["key"];
$value=$entry["value"];
$output .= "Key: ".$key."<BR>\n";
$output .= Value: ".$value."<BR>\n";
$row = yp_next($domain,"passwd.byname","");
if(!$entry) {
echo yp_errno() . ": " . yp_err_string();
}
$key=$row["key"];
$value=$row["value"];
$output .= Key: ".$key."<BR>\n"; // No data return
$output .= "Value: ".$value."<BR>\n"; // No data return
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 11:00:02 2025 UTC |
Luca Tessitore <tessitore@athena.polito.it> sent in a patch that seems to fix this, shall we get it into 4.0.2 as a last minute fix or wait 'til after 4.0.2 release? (manual will need a fix in yp_first() and yp_next(), too) ============================================================== RCS file: /repository/php4/ext/yp/yp.c,v retrieving revision 1.14 diff -u -b -w -B -r1.14 yp.c --- yp.c 2000/06/05 19:47:45 1.14 +++ yp.c 2000/08/25 12:37:09 @@ -151,7 +151,7 @@ RETURN_FALSE; } array_init(return_value); - add_assoc_string(return_value,"key",outkey,1); + add_assoc_stringl(return_value,"key",outkey,outkeylen,1); add_assoc_string(return_value,"value",outval,1); } /* }}} */ @@ -176,7 +176,8 @@ } array_init(return_value); - add_assoc_string(return_value,outkey,outval,1); + add_assoc_stringl(return_value,"key",outkey,outkeylen,1); + add_assoc_string(return_value,"value",outval,1); } /* }}} */