if (alarmed)
return -1;
+ /* This currently doesn't work with "." */
+ if (strcmp(path, ".") == 0) {
+ ERROR("\".\" not supported");
+ }
const char *dir = strrchr(path, '/');
if (dir == NULL)
dir = path;
/* Get CNID of Parent and add new childir to CNID database */
ppdid = pdid;
- did = cnid_for_path(&dvolume, to.p_path, &pdid);
+ if ((did = cnid_for_path(&dvolume, to.p_path, &pdid)) == CNID_INVALID) {
+ SLOG("Error resolving CNID for %s", to.p_path);
+ badcp = rval = 1;
+ return -1;
+ }
struct adouble ad;
struct stat st;
- if (stat(to.p_path, &st) != 0) {
+ if (lstat(to.p_path, &st) != 0) {
badcp = rval = 1;
break;
}
/* Get CNID of Parent and add new childir to CNID database */
pdid = did;
- cnid_t cnid = cnid_for_path(&dvolume, to.p_path, &did);
+ cnid_t cnid;
+ if ((cnid = cnid_for_path(&dvolume, to.p_path, &did)) == CNID_INVALID) {
+ SLOG("Error resolving CNID for %s", to.p_path);
+ badcp = rval = 1;
+ return -1;
+ }
struct adouble ad;
struct stat st;
- if (stat(to.p_path, &st) != 0) {
+ if (lstat(to.p_path, &st) != 0) {
badcp = rval = 1;
break;
}