← Back to team overview

freenx-team team mailing list archive

Re: Samba shares working?

 

Hi,

On Tuesday 28 April 2009, Marcelo Boveto Shima wrote:
>  - I put the patch in the code FreeNX code style and commented.
>  - If you try to mount a folder and share a printer, on one of them the fds
>    will already be closed, so I moved the code to inside the function. (Am I
>    wrong?)
>  - Reduced to 5 the counter of the close loop, FreeNX uses till fd 4.
>
> Can you test the attached patch?


finally I had some time to test the patch. There is one problem with closing 
the fds till 4 because there is at least one more fd 6 (maybe opened by 
nxagent?). To be save I think it is better to close all fds up to 254. You 
don't know what will be changed in the future...

Furthermore after discussing this problem with my collegue Louis Fluk (who by 
the way was of great help in debugging this stuff!) we think the first patch 
with the double fork was the most accurate one:
- If you move the trap inside the function there is the (theoretical?)
  possibilty that the function is already terminated.
- If you don't do the double fork, the "trap" can affect the main function
  what could cause other unpredictable things.
- Closing the file handles could be moved inside the function but it "feels"
  more reasonable to close them before you call the function.


Thilo


-- 
Thilo Uttendorfer
Linux Information Systems AG
Putzbrunner Str. 71, 81739 München

t.uttendorfer@xxxxxxxxxxxx, http://www.linux-ag.com



References