summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2023-04-26 08:30:38 +0200
committerAndreas Schneider <asn@cryptomilk.org>2023-04-27 08:32:37 +0000
commita269ab4a9b5c75e41ecb0cba4cfd13d1f1aa2737 (patch)
tree985a2ba1e0d4406638e0b8ed350c02fe3bc7e2f0 /source3
parente38f864017a06cab61ad878db8bca02b26f2e0d5 (diff)
downloadsamba-a269ab4a9b5c75e41ecb0cba4cfd13d1f1aa2737.tar.gz
s3:lib: Move ad_unpack() debug message to notice level
We should give a good warning message one level above. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/adouble.c54
1 files changed, 34 insertions, 20 deletions
diff --git a/source3/lib/adouble.c b/source3/lib/adouble.c
index 062c73ec758..0a53542d41b 100644
--- a/source3/lib/adouble.c
+++ b/source3/lib/adouble.c
@@ -967,14 +967,14 @@ static bool ad_unpack(struct adouble *ad, const size_t nentries,
*/
if (bufsize < (AD_HEADER_LEN + (AD_ENTRY_LEN * nentries))) {
- DEBUG(1, ("bad size\n"));
+ DBG_NOTICE("Bad size\n");
return false;
}
ad->ad_magic = RIVAL(ad->ad_data, 0);
ad->ad_version = RIVAL(ad->ad_data, ADEDOFF_VERSION);
if ((ad->ad_magic != AD_MAGIC) || (ad->ad_version != AD_VERSION)) {
- DEBUG(1, ("wrong magic or version\n"));
+ DBG_NOTICE("Wrong magic or version\n");
return false;
}
@@ -982,8 +982,7 @@ static bool ad_unpack(struct adouble *ad, const size_t nentries,
adentries = RSVAL(ad->ad_data, ADEDOFF_NENTRIES);
if (adentries != nentries) {
- DEBUG(1, ("invalid number of entries: %zu\n",
- adentries));
+ DBG_NOTICE("Invalid number of entries: %zu\n", adentries);
return false;
}
@@ -995,7 +994,7 @@ static bool ad_unpack(struct adouble *ad, const size_t nentries,
len = RIVAL(ad->ad_data, AD_HEADER_LEN + (i * AD_ENTRY_LEN) + 8);
if (!eid || eid >= ADEID_MAX) {
- DEBUG(1, ("bogus eid %d\n", eid));
+ DBG_NOTICE("Bogus eid %d\n", eid);
return false;
}
@@ -1005,16 +1004,22 @@ static bool ad_unpack(struct adouble *ad, const size_t nentries,
* ensure the specified offset is within that bound
*/
if ((off > bufsize) && (eid != ADEID_RFORK)) {
- DEBUG(1, ("bogus eid %d: off: %" PRIu32 ", len: %" PRIu32 "\n",
- eid, off, len));
+ DBG_NOTICE("Fogus eid %d: off: %" PRIu32
+ ", len: %" PRIu32 "\n",
+ eid,
+ off,
+ len);
return false;
}
ok = ad_entry_check_size(eid, bufsize, off, len);
if (!ok) {
- DBG_ERR("bogus eid [%"PRIu32"] bufsize [%zu] "
- "off [%"PRIu32"] len [%"PRIu32"]\n",
- eid, bufsize, off, len);
+ DBG_NOTICE("bogus eid [%" PRIu32 "] bufsize [%zu] "
+ "off [%" PRIu32 "] len [%" PRIu32 "]\n",
+ eid,
+ bufsize,
+ off,
+ len);
return false;
}
@@ -1022,8 +1027,11 @@ static bool ad_unpack(struct adouble *ad, const size_t nentries,
* That would be obviously broken
*/
if (off > filesize) {
- DEBUG(1, ("bogus eid %d: off: %" PRIu32 ", len: %" PRIu32 "\n",
- eid, off, len));
+ DBG_NOTICE("Bogus eid %d: off: %" PRIu32
+ ", len: %" PRIu32 "\n",
+ eid,
+ off,
+ len);
return false;
}
@@ -1032,9 +1040,11 @@ static bool ad_unpack(struct adouble *ad, const size_t nentries,
* filesize.
*/
if (off + len < off) {
- DEBUG(1, ("offset wrap in eid %d: off: %" PRIu32
- ", len: %" PRIu32 "\n",
- eid, off, len));
+ DBG_NOTICE("offset wrap in eid %d: off: %" PRIu32
+ ", len: %" PRIu32 "\n",
+ eid,
+ off,
+ len);
return false;
}
@@ -1045,9 +1055,11 @@ static bool ad_unpack(struct adouble *ad, const size_t nentries,
* out.
*/
if (eid != ADEID_RFORK) {
- DEBUG(1, ("bogus eid %d: off: %" PRIu32
- ", len: %" PRIu32 "\n",
- eid, off, len));
+ DBG_NOTICE("Bogus eid %d: off: %" PRIu32
+ ", len: %" PRIu32 "\n",
+ eid,
+ off,
+ len);
return false;
}
@@ -1056,8 +1068,10 @@ static bool ad_unpack(struct adouble *ad, const size_t nentries,
* the size to entryoffset - filesize.
*/
len = filesize - off;
- DEBUG(1, ("Limiting ADEID_RFORK: off: %" PRIu32
- ", len: %" PRIu32 "\n", off, len));
+ DBG_NOTICE("Limiting ADEID_RFORK: off: %" PRIu32
+ ", len: %" PRIu32 "\n",
+ off,
+ len);
}
ad->ad_eid[eid].ade_off = off;