s3:rpc_client: implement bind time feature negotiation
[metze/samba-autobuild/.git] / libgpo / gpo_util.c
index e90b9a3f244e7317335785e2ea890e12631283e0..0c72340033ca1caffd9871eebf5601febdeb9b6f 100644 (file)
@@ -467,127 +467,6 @@ NTSTATUS gpo_process_gpo_list(TALLOC_CTX *mem_ctx,
        return status;
 }
 
-
-/****************************************************************
- check wether the version number in a GROUP_POLICY_OBJECT match those of the
- locally stored version. If not, fetch the required policy via CIFS
-****************************************************************/
-
-NTSTATUS check_refresh_gpo(ADS_STRUCT *ads,
-                          TALLOC_CTX *mem_ctx,
-                           const char *cache_dir,
-                          uint32_t flags,
-                          const struct GROUP_POLICY_OBJECT *gpo)
-{
-       NTSTATUS result;
-       char *server = NULL;
-       char *share = NULL;
-       char *nt_path = NULL;
-       char *unix_path = NULL;
-       uint32_t sysvol_gpt_version = 0;
-       char *display_name = NULL;
-
-       result = gpo_explode_filesyspath(mem_ctx, cache_dir, gpo->file_sys_path,
-                                        &server, &share, &nt_path, &unix_path);
-
-       if (!NT_STATUS_IS_OK(result)) {
-               goto out;
-       }
-
-       result = gpo_get_sysvol_gpt_version(mem_ctx,
-                                           unix_path,
-                                           &sysvol_gpt_version,
-                                           &display_name);
-       if (!NT_STATUS_IS_OK(result) &&
-           !NT_STATUS_EQUAL(result, NT_STATUS_NO_SUCH_FILE)) {
-               DEBUG(10,("check_refresh_gpo: "
-                       "failed to get local gpt version: %s\n",
-                       nt_errstr(result)));
-               goto out;
-       }
-
-       DEBUG(10,("check_refresh_gpo: versions gpo %d sysvol %d\n",
-               gpo->version, sysvol_gpt_version));
-
-       /* FIXME: handle GPO_INFO_FLAG_FORCED_REFRESH from flags */
-
-       while (gpo->version > sysvol_gpt_version) {
-
-               DEBUG(1,("check_refresh_gpo: need to refresh GPO\n"));
-
-               result = gpo_fetch_files(mem_ctx, ads, cache_dir, gpo);
-               if (!NT_STATUS_IS_OK(result)) {
-                       goto out;
-               }
-
-               result = gpo_get_sysvol_gpt_version(mem_ctx,
-                                                   unix_path,
-                                                   &sysvol_gpt_version,
-                                                   &display_name);
-               if (!NT_STATUS_IS_OK(result)) {
-                       DEBUG(10,("check_refresh_gpo: "
-                               "failed to get local gpt version: %s\n",
-                               nt_errstr(result)));
-                       goto out;
-               }
-
-               if (gpo->version == sysvol_gpt_version) {
-                       break;
-               }
-       }
-
-       DEBUG(10,("Name:\t\t\t%s (%s)\n", gpo->display_name, gpo->name));
-       DEBUGADD(10,("sysvol GPT version:\t%d (user: %d, machine: %d)\n",
-               sysvol_gpt_version,
-               GPO_VERSION_USER(sysvol_gpt_version),
-               GPO_VERSION_MACHINE(sysvol_gpt_version)));
-       DEBUGADD(10,("LDAP GPO version:\t%d (user: %d, machine: %d)\n",
-               gpo->version,
-               GPO_VERSION_USER(gpo->version),
-               GPO_VERSION_MACHINE(gpo->version)));
-       DEBUGADD(10,("LDAP GPO link:\t\t%s\n", gpo->link));
-
-       result = NT_STATUS_OK;
-
- out:
-       return result;
-
-}
-
-/****************************************************************
- check wether the version numbers in the gpo_list match the locally stored, if
- not, go and get each required GPO via CIFS
- ****************************************************************/
-
-NTSTATUS check_refresh_gpo_list(ADS_STRUCT *ads,
-                               TALLOC_CTX *mem_ctx,
-                               const char *cache_dir,
-                               uint32_t flags,
-                               const struct GROUP_POLICY_OBJECT *gpo_list)
-{
-       NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
-       const struct GROUP_POLICY_OBJECT *gpo;
-
-       if (!gpo_list) {
-               return NT_STATUS_INVALID_PARAMETER;
-       }
-
-       for (gpo = gpo_list; gpo; gpo = gpo->next) {
-
-               result = check_refresh_gpo(ads, mem_ctx, cache_dir, flags, gpo);
-               if (!NT_STATUS_IS_OK(result)) {
-                       goto out;
-               }
-       }
-
-       result = NT_STATUS_OK;
-
- out:
-       /* FIXME close cli connection */
-
-       return result;
-}
-
 /****************************************************************
 ****************************************************************/
 
@@ -699,8 +578,8 @@ ADS_STATUS gp_get_machine_token(ADS_STRUCT *ads,
        if (!ADS_ERR_OK(status)) {
                return status;
        }
-       ntstatus = merge_nt_token(mem_ctx, ad_token, get_system_token(),
-                                 token);
+       ntstatus = merge_with_system_token(mem_ctx, ad_token,
+                                          token);
        if (!NT_STATUS_IS_OK(ntstatus)) {
                return ADS_ERROR_NT(ntstatus);
        }