On Thu, Jul 12, 2007 at 12:49:20AM +0200, Peter Stuge wrote:
- mkdirp((const char *) dirname(path), 0755);
I don't think lar should mkdir -p implicitly. Just open() and perror() or print strerror(errno) in case of failure.
Sorry. Since we don't store directories in lar it should indeed mkdir -p implicitly. But I think a bit of sanity would be nice here since a lar could otherwise be used to overwrite arbitrary system files.
I'll make a patch for mkdirp() that ensures the directory to be created is actually below the current directory (and also improve the return-to-cwd code in mkdir() a bit while at it) if there's interest. Would that be the right place to put it?
//Peter