View Single Post
Old 12-27-2007, 12:10 PM  
Yil
Too much time...
 
Join Date: May 2005
Posts: 1,194
Default

Flow: I downloaded nxTools and took a really quick look. I believe it's entirely reasonable to not have the $user variable set in some situations and the script should not assume it's always set...

In particular it looks like the problem pasted in that thread is occurring during a call to "nxClose.tcl LOGIN" called from the FTP_Pre-Command_Event set on the PASS command. This is a somewhat special case for two reasons. As a PRE command no checking on the validity of that command has been performed yet since the script is given the first chance at approval, and second it's occurring before the user has actually logged in and thus guaranteeing a valid user account.

Thus there are at least 2 situations where $user cannot be set.

1) Someone specified a username that doesn't exist.

2) The highly improbably, but nevertheless possible, client issuing a PASS command without ever issuing a USER command.

The PRE command on the PASS event, or for that matter a POST event on the LOGIN event, must check before using $user to make sure it's dealing with a valid login attempt...
Yil is offline   Reply With Quote