~ubuntu-branches/ubuntu/intrepid/libxslt/intrepid

« back to all changes in this revision

Viewing changes to libxslt/security.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-11-19 14:47:49 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20071119144749-w3hx9zj1dpcjwq07
Tags: 1.1.22-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Build a python-libxslt1-dbg package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
#include <ctype.h>
35
35
#endif
36
36
 
 
37
#if defined(WIN32) && !defined(__CYGWIN__)
 
38
#include <windows.h>
 
39
#ifndef INVALID_FILE_ATTRIBUTES
 
40
#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
 
41
#endif
 
42
#endif
 
43
 
37
44
#ifndef HAVE_STAT
38
45
#  ifdef HAVE__STAT
39
46
     /* MS C library seems to define stat and _stat. The definition
267
274
{
268
275
#ifdef HAVE_STAT
269
276
    struct stat stat_buffer;
 
277
#if defined(WIN32) && !defined(__CYGWIN__)
 
278
    DWORD dwAttrs;
 
279
 
 
280
    dwAttrs = GetFileAttributes(path); 
 
281
    if (dwAttrs != INVALID_FILE_ATTRIBUTES) {
 
282
        if (dwAttrs & FILE_ATTRIBUTE_DIRECTORY) {
 
283
            return 2;
 
284
                }
 
285
    }
 
286
#endif
270
287
 
271
288
    if (stat(path, &stat_buffer) == -1)
272
289
        return 0;
362
379
    if ((uri->scheme == NULL) ||
363
380
        (xmlStrEqual(BAD_CAST uri->scheme, BAD_CAST "file"))) {
364
381
 
 
382
#if defined(WIN32) && !defined(__CYGWIN__)
 
383
    if ((uri->path)&&(uri->path[0]=='/')&&
 
384
        (uri->path[1]!='\0')&&(uri->path[2]==':'))
 
385
    ret = xsltCheckWritePath(sec, ctxt, uri->path+1);
 
386
    else
 
387
#endif
 
388
 
365
389
        /*
366
390
         * Check if we are allowed to write this file
367
391
         */