pdf-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pdf-devel] Filesystem module and temporary files.


From: jemarch
Subject: [pdf-devel] Filesystem module and temporary files.
Date: Wed, 03 Feb 2010 21:55:33 +0100
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/23.1.91 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

   Hi.

   I made a change in the filesystem module that modifies its public
   API.  The filesystem function pdf_fsys_get_temp_path_name
   introduces a security hole, since no one guarantees that a
   filesystem item with the returned name is not created by other
   application.

   So I removed pdf_fsys_get_temp_path_name and introduced a new function
   pdf_fsys_file_open_tmp:

    -- Function: pdf_status_t pdf_fsys_file_open_tmp (const pdf_fsys_t
          FILESYSTEM, pdf_fsys_file_t *FILE)
     Create a temporary file in FILESYSTEM and open it.

     The temporary file is opened with mode PDF_FSYS_OPEN_MODE_RW and stored
     in FILE.  The file will be automatically deleted when it is closed.  The
     filesystem implementation may also delete the file when the client
     application exits, but it is not guaranteed.
     

    *Parameters*

         FILESYSTEM
               A filesystem. If `NULL' the default filesystem is used.

         FILE
               The output file variable.

    *Returns*
          A PDF status value:
         `PDF_OK'
               The file was successfully opened and stored in the FILE
               variable.  If the filesystem implementation does not support
               this functionality then NULL is stored in FILE.

         `PDF_ENOMEM'
               Not enough memory.

         `PDF_ERROR'
               It was not possible to create the temporary file.

   I updated the documentation and the disk filesystem implementation.

   I also imported the stdio-safer related functions from gnulib and used them
   in the disk filesystem, along with a general gnulib update.

-- 
Jose E. Marchesi  <address@hidden>
                  http://www.jemarch.net
GNU Project       http://www.gnu.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]