Branch: Tag:

2004-05-13

2004-05-13 18:11:06 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Fixed locking bug in copy_file().

Rev: server/modules/filesystems/filesystem.pike:1.141

7:   inherit "module";   inherit "socket";    - constant cvs_version= "$Id: filesystem.pike,v 1.140 2004/05/13 17:39:33 mast Exp $"; + constant cvs_version= "$Id: filesystem.pike,v 1.141 2004/05/13 18:11:06 grubba Exp $";   constant thread_safe=1;      #include <module.h>
1465:    TRACE_LEAVE("COPY: Put not allowed.");    return Roxen.http_status(405, "Not allowed.");    } -  mapping|int(0..1) res = write_access(combine_path(dest, "../"), 0, id); +  mapping|int(0..1) res = write_access(dest, 0, id) || +  write_access(combine_path(dest, "../"), 0, id);    if (mappingp(res)) return res;    string dest_path = path + dest;    catch { dest_path = decode_path(dest_path); };
1558:    break;    }    } -  else { -  if (res = write_access(dest, 0, id)) { -  SIMPLE_TRACE_LEAVE("COPY: Write access to file %O denied.", dest); -  return res; -  } -  } +        if (source_st->isdir) {    mkdirs++;