]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
param: Simplify check_ad_dc_required_mods()
authorVolker Lendecke <vl@samba.org>
Mon, 9 Feb 2026 12:00:22 +0000 (13:00 +0100)
committerAnoop C S <anoopcs@samba.org>
Sun, 15 Feb 2026 10:42:34 +0000 (10:42 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
source3/param/loadparm.c

index d7652661d570d1f620a5dccbcbb3a5cbc92df0f0..652b5aa0e354233282a351cd4fda037028f6fbad 100644 (file)
@@ -2838,27 +2838,22 @@ static bool do_parameter(const char *pszParmName, const char *pszParmValue,
        }
 }
 
-
-static const char *ad_dc_req_vfs_mods[] = {"dfs_samba4", "acl_xattr", NULL};
-
 /*
  * check that @vfs_objects includes all vfs modules required by an AD DC.
  */
 static bool check_ad_dc_required_mods(const char **vfs_objects)
 {
-       int i;
-       int j;
-       int got_req;
+       static const char *ad_dc_req_vfs_mods[] = {"dfs_samba4", "acl_xattr"};
+       size_t i, j;
+
+       for (i = 0; i < ARRAY_SIZE(ad_dc_req_vfs_mods); i++) {
 
-       for (i = 0; ad_dc_req_vfs_mods[i] != NULL; i++) {
-               got_req = false;
                for (j = 0; vfs_objects[j] != NULL; j++) {
                        if (!strwicmp(ad_dc_req_vfs_mods[i], vfs_objects[j])) {
-                               got_req = true;
                                break;
                        }
                }
-               if (!got_req) {
+               if (vfs_objects[j] == NULL) {
                        DEBUG(0, ("vfs objects specified without required AD "
                                  "DC module: %s\n", ad_dc_req_vfs_mods[i]));
                        return false;