Branch: Tag:

2018-03-21

2018-03-21 16:15:40 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Filesystem: Fixed return codes from MKCOL, PUT, MOVE.

Fixes [WS-226] and some of [WS-228].

1014:    /* FALL_THROUGH */    case "MKDIR":   #if 1 -  return make_collection(f, id); +  mixed ret = make_collection(f, id); +  if (ret) return ret; +  if (id->misc->error_code) { +  return Roxen.http_status(id->misc->error_code); +  } +  return 0;   #else /* !1 */    if(!query("put"))    {
1174:    int err = to->errno();    privs = 0;    TRACE_LEAVE("PUT: Open failed"); -  return errno_to_status (err, 1, id); +  mixed ret = errno_to_status (err, 1, id); +  if (ret) return ret; +  if (id->misc->error_code) { +  return Roxen.http_status(id->misc->error_code);    } -  +  return 0; +  }       // FIXME: Race-condition.    string msg = safe_chmod(norm_f, 0666 & ~(id->misc->umask || 022));
1488:    if(!code)    {    SIMPLE_TRACE_LEAVE("MOVE: Move failed (%s)", strerror (err_code)); -  return errno_to_status (err_code, 1, id); +  mixed ret = errno_to_status (err_code, 1, id); +  if (ret) return ret; +  if (id->misc->error_code) { +  return Roxen.http_status(id->misc->error_code);    } -  +  return 0; +  }    TRACE_LEAVE("MOVE: Success");    TRACE_LEAVE("Success");    if (size != -1) return Roxen.http_status(204);