Google Groups Home
Help | Sign in
Fix for ns_tmpnam under Windows
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Gustaf Neumann  
View profile
 More options Apr 24, 3:32 am
From: Gustaf Neumann <neum...@WU-WIEN.AC.AT>
Date: Thu, 24 Apr 2008 09:32:52 +0200
Local: Thurs, Apr 24 2008 3:32 am
Subject: [AOLSERVER] Fix for ns_tmpnam under Windows
Dear AOLserver community

There was a problem with "ns_tmpnam", when the aolserver was compiled under
windows (esp. Vista). The Tcl command"ns_tmpnam" is implemented in C
using tmpnam(), which exists under WIN32, but behaves differently
as on unix counterparts and is practically unusable. The problem is
that tmnam() under Windows generates a filename for the root directory
of the
actual drive (at least under Vista, no permissions under normal
conditions) and
ignores the TMP environment variable.

See some background info form Microsoft:
http://msdn2.microsoft.com/en-us/library/hs3e7355(VS.80).aspx

I have commited a patch to CVS head to address this problem.
http://aolserver.cvs.sourceforge.net/aolserver/aolserver/nsd/tclfile....
The patch is local and documents the intended behavior and background in
detail.
Please crosscheck.

best regards
-gustaf neumann

--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <lists...@listserv.aol.com> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dossy Shiobara  
View profile
 More options Apr 24, 8:42 am
From: Dossy Shiobara <do...@PANOPTIC.COM>
Date: Thu, 24 Apr 2008 08:42:44 -0400
Local: Thurs, Apr 24 2008 8:42 am
Subject: Re: [AOLSERVER] Fix for ns_tmpnam under Windows
On 2008.04.24, Gustaf Neumann <neum...@WU-WIEN.AC.AT> wrote:

> I have commited a patch to CVS head to address this problem.
> http://aolserver.cvs.sourceforge.net/aolserver/aolserver/nsd/tclfile....
> The patch is local and documents the intended behavior and background in  
> detail.
> Please crosscheck.

Looks good, Gustaf.  Thanks for the fix!

--
Dossy Shiobara              | do...@panoptic.com | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  "He realized the fastest way to change is to laugh at your own
    folly -- then you can let go and quickly move on." (p. 70)

--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <lists...@listserv.aol.com> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom Jackson  
View profile
 More options Apr 24, 10:08 am
From: Tom Jackson <t...@RMADILO.COM>
Date: Thu, 24 Apr 2008 07:08:02 -0700
Local: Thurs, Apr 24 2008 10:08 am
Subject: Re: [AOLSERVER] Fix for ns_tmpnam under Windows
Isn't there a new safe version of these functions? The link to msdn also
suggests that the replacements are depricated. In general, I think that the
directory where the temp file is created should not be world writable. Some
while back there was a suggestion to replace the C function with a safe
version.

I'll try to find this old info.

tom jackson

On Thursday 24 April 2008 00:32, Gustaf Neumann wrote:

--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <lists...@listserv.aol.com> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom Jackson  
View profile
 More options Apr 24, 10:22 am
From: Tom Jackson <t...@RMADILO.COM>
Date: Thu, 24 Apr 2008 07:22:34 -0700
Local: Thurs, Apr 24 2008 10:22 am
Subject: Re: [AOLSERVER] Fix for ns_tmpnam under Windows
Okay, I found a thread at OpenACS:

http://www.openacs.com/forums/message-view?message_id=64787

I proposed a new config param to set the directory where new files are
created. It used to be possible, and maybe still is, to pass in a query var
when uploading a file, thus allowing users to choose a filename.

tom jackson

On Thursday 24 April 2008 07:08, Tom Jackson wrote:

--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <lists...@listserv.aol.com> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Titi Alailima  
View profile
 More options May 5, 1:02 pm
From: Titi Alailima <t...@MEDTOUCH.COM>
Date: Mon, 5 May 2008 10:02:55 -0700
Local: Mon, May 5 2008 1:02 pm
Subject: Re: [AOLSERVER] Fix for ns_tmpnam under Windows
There is a missing variable declaration in this patch for "i", the for-loop index.  Anyone want to make this fix and commit it?

Titi Ala'ilima
Lead Architect
MedTouch LLC
1100 Massachusetts Avenue
Cambridge, MA 02138
617.621.8670 x309

--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <lists...@listserv.aol.com> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Maurizio Martignano  
View profile
 More options May 5, 1:25 pm
From: Maurizio Martignano <Maurizio.Martign...@ACM.ORG>
Date: Mon, 5 May 2008 19:25:00 +0200
Subject: Re: [AOLSERVER] Fix for ns_tmpnam under Windows

Dear Titi,
        The proper version of the file, properly compiled and tested is the
one attached to this email message.

Hope it helps,
Maurizio

  tclfile.c
36K Download

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom Jackson  
View profile
 More options May 5, 3:08 pm
From: Tom Jackson <t...@RMADILO.COM>
Date: Mon, 5 May 2008 12:08:19 -0700
Local: Mon, May 5 2008 3:08 pm
Subject: Re: [AOLSERVER] Fix for ns_tmpnam under Windows
After Gustaf updated this for WIN32, I started looking at some old problems
with temp files.

I noticed that Tcl core has some internal API for this (temporary files are
used for buffering pipe I/O), which might be able to be used. The core code
also handles file systems which have wide char (I think for the filenames),
and I think it handles end of line conversions, etc. Not sure how important
this is.

Another issue is that [ns_form] and [ns_conn form] have some security issues
related to temporary files. These can't be fixed without changing the API,
but it might be worth keeping in mind.

Any security fix will probably have to use new api such as:

ns_mkstemp templateVar

Example:

set template /path/to/secure/dir/myfileXXXXXX
set fp [ns_mkstemp template] ;# template var is updated
file delete $template ;#(same as ns_unlink $template)

# Use fp to write/read, fp is opened exclusively.
# When $fp is closed file will go away.
# If nsd crashes, the file also goes away.

The file is actually 'unlinked' prior to use, so there is no way to access it,
or even list it from the filesystem.

tom jackson

On Monday 05 May 2008 10:02, Titi Alailima wrote:

--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <lists...@listserv.aol.com> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gustaf Neumann  
View profile
 More options May 6, 3:43 am
From: Gustaf Neumann <neum...@WU-WIEN.AC.AT>
Date: Tue, 6 May 2008 09:43:59 +0200
Local: Tues, May 6 2008 3:43 am
Subject: Re: [AOLSERVER] Fix for ns_tmpnam under Windows
fixed.
-gustaf neumann

Titi Alailima schrieb:

> There is a missing variable declaration in this patch for "i", the for-loop index.  Anyone want to make this fix and commit it?

--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <lists...@listserv.aol.com> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google