s3:mod:vfs_vxfs: use NUMERIC_CMP in vxfs_ace_cmp
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Sun, 7 Apr 2024 03:17:22 +0000 (15:17 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 23 Apr 2024 01:33:29 +0000 (01:33 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15625

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/modules/vfs_vxfs.c

index aae2ca1733749d6fa701da54ceffeac1b5f382be..ecc53d015f2daf840ee91040a49a899769d09275 100644 (file)
@@ -111,13 +111,13 @@ static int vxfs_ace_cmp(const void *ace1, const void *ace2)
        type_a1 = SVAL(ace1, 0);
        type_a2 = SVAL(ace2, 0);
 
-       ret = (type_a1 - type_a2);
-       if (!ret) {
+       ret = NUMERIC_CMP(type_a1, type_a2);
+       if (ret == 0) {
                /* Compare ID under type */
                /* skip perm thus take offset as 4*/
                id_a1 = IVAL(ace1, 4);
                id_a2 = IVAL(ace2, 4);
-               ret = id_a1 - id_a2;
+               ret = NUMERIC_CMP(id_a1, id_a2);
        }
 
        return ret;