X-File with cgi variables and Net::NIS

  • Thread starter V?ktu Pons i Colomer
  • Start date
V

V?ktu Pons i Colomer

Hi all, I've searching for a solution for that but no luck, so I'm in
the need of asking :(

I've this piece of code:

elsif ($operacio eq 'AfegirUid'){
tie %hash, 'Net::NIS','passwd','domain.com' or die "Can't tie
passwd: $yperr\n";
warn "---$memberUid---","\n";
my $valor = $hash{$memberUid};
if (defined($valor)) {

$memberUid is passed as a cgi parameter with:

my $memberUid=$q->param(memberUid);

The problem is that this code is broken with this error:
---francescf---
Unable to find 'francescf' in passwd.byname. Reason: args to yp
function are bad at /dev/fd/5 line 174

As you may have noticed, the value for $memberUid is francescf

But if I do that:

elsif ($operacio eq 'AfegirUid'){
tie %hash, 'Net::NIS','passwd','domain.com' or die "Can't tie
passwd: $yperr\n";
$memberUid="francescf";
warn "---$memberUid---","\n";
my $valor = $hash{$memberUid};
if (defined($valor)) {

it prints the same in the log, ---francescf---, but it works and give
no error!!!

Can't see the diference between the two codes, because $memberUid is
well filled with the parameter...

Any help will be appreciated! Thanks a lot in advance!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,159
Messages
2,570,884
Members
47,419
Latest member
ArturoBres

Latest Threads

Top