Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
afpd: Log an error when directory has invalid did, GitHub #1893
Browse files Browse the repository at this point in the history
rdmark committed Jan 18, 2025
1 parent 379cef3 commit 365dce2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions etc/afpd/dircache.c
Original file line number Diff line number Diff line change
@@ -434,6 +434,10 @@ int dircache_add(const struct vol *vol,
struct dir key;
hnode_t *hn;

LOG(log_error, logtype_afpd,
"dircache_add(): did:%u is less than the allowed %d. Data in \"%s\" may be invalid.",
ntohl(dir->d_did), CNID_START, cfrombstr(dir->d_u_name));

AFP_ASSERT(dir);
AFP_ASSERT(ntohl(dir->d_pdid) >= 2);
AFP_ASSERT(ntohl(dir->d_did) >= CNID_START);

0 comments on commit 365dce2

Please sign in to comment.