From: <jam...@te...> - 2002-06-21 20:24:57
|
OK, replying to myself, but after I fixed the problem with setting the confiuguration I had a simular problem in when running it in execute_dump(). I used the same strategy to fix it. As I was fixing it thouugh, I noticed that at the end after running the dump command the return code from dump was not checked (I would never do that (-;). Anyway, this patch contains the previous change, the new change for the same error in execute_dump, and it contains a suggested fix for not checking the return code. I forgot to mention this is against the 0.980 source with no updates. Here is the new patch: *** redhat-linux-lib.pl Fri Jun 21 16:13:00 2002 --- redhat-linux-lib.pl.orig Fri Jun 21 14:54:52 2002 *************** *** 190,239 **** # Executes a dump and displays the output sub execute_dump { - my $dump_data = shift; local $fh = $_[1]; local ($cmd, $flag); ! ! # ! # Verify we were passed the correct args ! if (!ref($dump_data)) { ! print "<B>Error Call to execute_dump() in redhat-linux-lib.pl with invalid arguments!</B>"; ! return 0 ! } ! ! if ($dump_data->{'huser'}) { ! $flag = " -f '" . $dump_data->{'huser'} . '@' . $dump_data->{'host'} . ! ':' . $dump_data->{'hfile'} . "'"; } ! elsif ($dump_data->{'host'}) { ! $flag = " -f '" . $dump_data->{'host'} . ':' . $dump_data->{'hfile'} . "'"; } else { ! $flag = " -f '" . $dump_data->{'file'} . "'"; } ! if ($dump_data->{'fs'} eq 'xfs') { # xfs backup $cmd = "xfsdump -l $_[0]->{'level'}"; $cmd .= $flag; ! $cmd .= " -L '" . $dump_data->{'label'} . "'" if ($dump_data->{'label'}); ! $cmd .= " -M '" . $dump_data->{'label'} . "'" if ($dump_data->{'label'}); ! $cmd .= " -z '" . $dump_data->{'max'} . "'" if ($dump_data->{'max'}); ! $cmd .= " -A" if ($dump_data->{'noattribs'}); ! $cmd .= " -F" if ($dump_data->{'over'}); ! $cmd .= " -J" if ($dump_data->{'noinvent'}); ! $cmd .= " -o" if ($dump_data->{'overwrite'}); ! $cmd .= " -E -F" if ($dump_data->{'erase'}); ! $cmd .= " '" . $dump_data->{'dir'} . "'"; } else { # ext2/3 backup ! $cmd = "dump -" . $dump_data->{'level'}; $cmd .= $flag; ! $cmd .= " -u" if ($dump_data->{'update'}); ! $cmd .= " -M" if ($dump_data->{'multi'}); ! $cmd .= " -L '" . $dump_data->{'label'} . "'" if ($dump_data->{'label'}); ! $cmd .= " -B " . $dump_data->{'blocks'} if ($dump_data->{'blocks'}); ! $cmd .= " '" . $dump_data->{'dir'} . "'"; } &system_logged("sync"); --- 190,229 ---- # Executes a dump and displays the output sub execute_dump { local $fh = $_[1]; local ($cmd, $flag); ! if ($_[0]->{'huser'}) { ! $flag = " -f '$_[0]->{'huser'}@$_[0]->{'host'}:$_[0]->{'hfile'}'"; } ! elsif ($_[0]->{'host'}) { ! $flag = " -f '$_[0]->{'host'}:$_[0]->{'hfile'}'"; } else { ! $flag = " -f '$_[0]->{'file'}'"; } ! if ($_[0]->{'fs'} eq 'xfs') { # xfs backup $cmd = "xfsdump -l $_[0]->{'level'}"; $cmd .= $flag; ! $cmd .= " -L '$_[0]->{'label'}'" if ($_[0]->{'label'}); ! $cmd .= " -M '$_[0]->{'label'}'" if ($_[0]->{'label'}); ! $cmd .= " -z '$_[0]->{'max'}'" if ($_[0]->{'max'}); ! $cmd .= " -A" if ($_[0]->{'noattribs'}); ! $cmd .= " -F" if ($_[0]->{'over'}); ! $cmd .= " -J" if ($_[0]->{'noinvent'}); ! $cmd .= " -o" if ($_[0]->{'overwrite'}); ! $cmd .= " -E -F" if ($_[0]->{'erase'}); ! $cmd .= " '$_[0]->{'dir'}'"; } else { # ext2/3 backup ! $cmd = "dump -$_[0]->{'level'}"; $cmd .= $flag; ! $cmd .= " -u" if ($_[0]->{'update'}); ! $cmd .= " -M" if ($_[0]->{'multi'}); ! $cmd .= " -L '$_[0]->{'label'}'" if ($_[0]->{'label'}); ! $cmd .= " -B $_[0]->{'blocks'}" if ($_[0]->{'blocks'}); ! $cmd .= " '$_[0]->{'dir'}'"; } &system_logged("sync"); *************** *** 249,285 **** } } close(CMD); - my $rc = $? >> 8; - if($rc != 0) { - print <<EOF; - <B> - <P>ERROR Running dump!</P> - - COMMAND: ${cmd} - RC: ${rc} - EOF - } - } # dump_dest(&dump) sub dump_dest { ! my $dump_data = shift; ! ! if(!ref($dump_data)) { ! return "<B>Error Call to dump_dest() in redhat-linux-lib.pl with invalid arguments!</B>"; ! } ! if ($dump_data->{'file'}) { ! return "<tt>".&html_escape($dump_data->{'file'})."</tt>"; } elsif ($_[0]->{'huser'}) { ! return "<tt>" . &html_escape($dump_data->{'huser'} . '@' . ! $dumpdata->{'host'} . ':' . $dump_data->{'hfile'}) . "</tt>"; } else { ! return "<tt>" . &html_escape($dump_data->{'host'} . ':' . ! $dump_data->{'hfile'}) . "</tt>"; } } --- 239,257 ---- } } close(CMD); } # dump_dest(&dump) sub dump_dest { ! if ($_[0]->{'file'}) { ! return "<tt>".&html_escape($_[0]->{'file'})."</tt>"; } elsif ($_[0]->{'huser'}) { ! return "<tt>".&html_escape("$_[0]->{'huser'}@$_[0]->{'host'}:$_[0]->{'hfile'}")."</tt>"; } else { ! return "<tt>".&html_escape("$_[0]->{'host'}:$_[0]->{'hfile'}")."</tt>"; } } Cheers...james |
From: <jam...@te...> - 2002-06-24 15:04:42
|
Jamie, I downloaded your filesystem update module, and it only has your fix in the first funciton, and not the second one, execute_dump(). And now completely understanding the problem I see that it is also in parse_restore(). Lastly, I really do think some code needs to be at the bottome of execute_dump() to check the return code of the dump command and let the user know if there was an error. Cheers...james |
From: <ra...@si...> - 2002-06-24 19:38:23
|
First, I would like to mention that the Password Module for Usermin can include Solaris as a supported OS, I don't know if this was an oversight. On the otherhand, if there is a bug that I am unaware of which affects Solaris users, it would be nice to know. The other item is in reguards to PAM and authentication of users in Usermin. While recently searching a problem to which a user was connecting via Usermin, but failed an FTP session, I identified that the FTP session was failing because the password had expired. There was no notification in Usermin, however. I am not certain at this time if this is a bug/rfe for Usermin, or a bug/rfe in the PAM module, however, I wanted to make folks on this list aware of this issue. When I can put in the cycles to hunt down what is needed, I will pass on the solution (unless someone else knows the answer already). rf |
From: Jamie C. <jca...@we...> - 2002-06-25 02:16:40
|
ra...@si... wrote: > > First, I would like to mention that the Password Module for Usermin can > include Solaris as a supported OS, I don't know if this was an oversight. > On the otherhand, if there is a bug that I am unaware of which affects > Solaris users, it would be nice to know. I've just tried it on my own solaris system, and it seems to work well. In the next usermin release, the module will use PAM for password changing on Solaris. > The other item is in reguards to PAM and authentication of users in > Usermin. While recently searching a problem to which a user was > connecting via Usermin, but failed an FTP session, I identified that the > FTP session was failing because the password had expired. There was no > notification in Usermin, however. I am not certain at this time if this > is a bug/rfe for Usermin, or a bug/rfe in the PAM module, however, I > wanted to make folks on this list aware of this issue. When I can put in > the cycles to hunt down what is needed, I will pass on the solution > (unless someone else knows the answer already). Normally PAM should check if an account has expired, and if so deny authentication. Usermin never does any such checking itself .. - Jamie |
From: Jamie C. <jca...@we...> - 2002-06-25 02:12:50
|
jam...@te... wrote: > Jamie, > > I downloaded your filesystem update module, and it only has your fix in the > first funciton, and not > the second one, execute_dump(). And now completely understanding the > problem I see that it is > also in parse_restore(). Lastly, I really do think some code needs to be > at the bottome of execute_dump() > to check the return code of the dump command and let the user know if there > was an error. Actually, I found another occurance of the same error when adding code to display a success/failure message, so I've released a new update that fixes both problems. - Jamie |