fixed plug-ins directory initialization for extremely restricted guest users with no directory listing access to the temporary directory

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3909 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2005-02-18 13:39:42 +00:00
parent 18a03a5eb5
commit a7e4a69bb4
3 changed files with 9 additions and 2 deletions

View file

@ -3216,8 +3216,8 @@ again:
// GetTempFileName $0
ret=add_entry_direct(EW_GETTEMPFILENAME, var_zero, add_string("$TEMP"));
if (ret != PS_OK) return ret;
// Delete $0 - the temp file created
ret=add_entry_direct(EW_DELETEFILE, zero_offset);
// Delete $0 [simple, nothing that could clash with special temp permissions]
ret=add_entry_direct(EW_DELETEFILE, zero_offset, DEL_SIMPLE);
if (ret != PS_OK) return ret;
// CraeteDirectory $0 - a dir instead of that temp file
ret=add_entry_direct(EW_CREATEDIR, zero_offset);

View file

@ -442,6 +442,7 @@ typedef struct {
#define DEL_DIR 1
#define DEL_RECURSE 2
#define DEL_REBOOT 4
#define DEL_SIMPLE 8
// $0..$9, $INSTDIR, etc are encoded as ASCII bytes starting from this value.
// Added by ramon 3 jun 2003

View file

@ -103,6 +103,12 @@ void NSISCALL myDelete(char *buf, int flags)
char *fn;
int valid_dir=is_valid_instpath(buf);
if ((flags & DEL_SIMPLE))
{
g_exec_flags.exec_error += !DeleteFile(buf);
return;
}
#ifdef NSIS_SUPPORT_RMDIR
if (!(flags & DEL_DIR) || (valid_dir && (flags & DEL_RECURSE)))
#endif//NSIS_SUPPORT_RMDIR