]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
dsdb: audit: replace local min() with libreplace MIN()
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 27 Aug 2025 04:02:56 +0000 (16:02 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Wed, 3 Sep 2025 02:13:40 +0000 (02:13 +0000)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
source4/dsdb/samdb/ldb_modules/audit_log.c
source4/dsdb/samdb/ldb_modules/audit_util.c

index 7cc3ff67d77e82f79c9835cc02fc864b4cbf2324..08d11141d299c1e5e7ff9cdb232b9f5bc77f16ec 100644 (file)
@@ -65,8 +65,6 @@
  */
 #define MAX_LENGTH 1024
 
-#define min(a, b) (((a)>(b))?(b):(a))
-
 /*
  * Private data for the module, stored in the ldb_module private data
  */
@@ -881,7 +879,7 @@ static char *log_attributes(
                        }
 
                        v = message->elements[i].values[j];
-                       length = min(MAX_LENGTH, v.length);
+                       length = MIN(MAX_LENGTH, v.length);
                        use_b64_encode = ldb_should_b64_encode(ldb, &v);
                        if (use_b64_encode) {
                                const char *encoded = ldb_base64_encode(
index 8fe7d8332d2fc6dda4f5ff1d1488d5339089eaf6..ea212469995d88ac3a1486229d3d33960defefb0 100644 (file)
@@ -36,8 +36,6 @@
 
 #define MAX_LENGTH 1024
 
-#define min(a, b) (((a)>(b))?(b):(a))
-
 /*
  * List of attributes considered secret or confidential the values of these
  * attributes should not be displayed in log messages.
@@ -488,7 +486,7 @@ static int dsdb_audit_add_ldb_value(struct json_object *array,
        }
 
        base64 = ldb_should_b64_encode(NULL, &lv);
-       len = min(lv.length, MAX_LENGTH);
+       len = MIN(lv.length, MAX_LENGTH);
        value = json_new_object();
        if (json_is_invalid(&value)) {
                goto failure;