関数 | |
NTSTATUS | ads_gpo_explode_filesyspath (ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, const char *file_sys_path, char **server, char **service, char **nt_path, char **unix_path) |
NTSTATUS | ads_gpo_prepare_local_store (ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, const char *unix_path) |
NTSTATUS | ads_fetch_gpo_files (ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, struct cli_state *cli, struct GROUP_POLICY_OBJECT *gpo) |
NTSTATUS | ads_gpo_get_sysvol_gpt_version (ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, const char *unix_path, uint32 *sysvol_version, char **display_name) |
NTSTATUS ads_gpo_explode_filesyspath | ( | ADS_STRUCT * | ads, | |
TALLOC_CTX * | mem_ctx, | |||
const char * | file_sys_path, | |||
char ** | server, | |||
char ** | service, | |||
char ** | nt_path, | |||
char ** | unix_path | |||
) |
gpo_fetch.c の 27 行で定義されています。
参照先 lock_path()・next_token()・pstring_sub()・talloc_asprintf()・talloc_strdup().
参照元 ads_fetch_gpo_files()・check_refresh_gpo()・net_ads_gpo_refresh().
00034 { 00035 fstring tok; 00036 pstring path; 00037 00038 *server = NULL; 00039 *service = NULL; 00040 *nt_path = NULL; 00041 *unix_path = NULL; 00042 00043 if (!next_token(&file_sys_path, tok, "\\", sizeof(tok))) { 00044 return NT_STATUS_INVALID_PARAMETER; 00045 } 00046 00047 if ((*server = talloc_strdup(mem_ctx, tok)) == NULL) { 00048 return NT_STATUS_NO_MEMORY; 00049 } 00050 00051 if (!next_token(&file_sys_path, tok, "\\", sizeof(tok))) { 00052 return NT_STATUS_INVALID_PARAMETER; 00053 } 00054 00055 if ((*service = talloc_strdup(mem_ctx, tok)) == NULL) { 00056 return NT_STATUS_NO_MEMORY; 00057 } 00058 00059 if ((*nt_path = talloc_asprintf(mem_ctx, "\\%s", file_sys_path)) == NULL) { 00060 return NT_STATUS_NO_MEMORY; 00061 } 00062 00063 pstrcpy(path, lock_path(GPO_CACHE_DIR)); 00064 pstrcat(path, "/"); 00065 pstrcat(path, file_sys_path); 00066 pstring_sub(path, "\\", "/"); 00067 00068 if ((*unix_path = talloc_strdup(mem_ctx, path)) == NULL) { 00069 return NT_STATUS_NO_MEMORY; 00070 } 00071 00072 return NT_STATUS_OK; 00073 }
NTSTATUS ads_gpo_prepare_local_store | ( | ADS_STRUCT * | ads, | |
TALLOC_CTX * | mem_ctx, | |||
const char * | unix_path | |||
) |
gpo_fetch.c の 79 行で定義されています。
参照先 errno・lock_path()・next_token()・strequal()・talloc_asprintf_append()・talloc_strdup().
00082 { 00083 const char *top_dir = lock_path(GPO_CACHE_DIR); 00084 char *current_dir; 00085 fstring tok; 00086 00087 current_dir = talloc_strdup(mem_ctx, top_dir); 00088 NT_STATUS_HAVE_NO_MEMORY(current_dir); 00089 00090 if ((mkdir(top_dir, 0644)) < 0 && errno != EEXIST) { 00091 return NT_STATUS_ACCESS_DENIED; 00092 } 00093 00094 while (next_token(&unix_path, tok, "/", sizeof(tok))) { 00095 00096 if (strequal(tok, GPO_CACHE_DIR)) { 00097 break; 00098 } 00099 } 00100 00101 while (next_token(&unix_path, tok, "/", sizeof(tok))) { 00102 00103 current_dir = talloc_asprintf_append(current_dir, "/%s", tok); 00104 NT_STATUS_HAVE_NO_MEMORY(current_dir); 00105 00106 if ((mkdir(current_dir, 0644)) < 0 && errno != EEXIST) { 00107 return NT_STATUS_ACCESS_DENIED; 00108 } 00109 } 00110 00111 return NT_STATUS_OK; 00112 }
NTSTATUS ads_fetch_gpo_files | ( | ADS_STRUCT * | ads, | |
TALLOC_CTX * | mem_ctx, | |||
struct cli_state * | cli, | |||
struct GROUP_POLICY_OBJECT * | gpo | |||
) |
gpo_fetch.c の 118 行で定義されています。
参照先 ads_gpo_explode_filesyspath()・ads_gpo_prepare_local_store()・cli・GROUP_POLICY_OBJECT::file_sys_path・gpo_copy_file()・gpo_sync_directories()・result・server・talloc_asprintf().
参照元 check_refresh_gpo().
00122 { 00123 NTSTATUS result; 00124 char *server, *service, *nt_path, *unix_path, *nt_ini_path, *unix_ini_path; 00125 00126 result = ads_gpo_explode_filesyspath(ads, mem_ctx, gpo->file_sys_path, 00127 &server, &service, &nt_path, &unix_path); 00128 if (!NT_STATUS_IS_OK(result)) { 00129 goto out; 00130 } 00131 00132 result = ads_gpo_prepare_local_store(ads, mem_ctx, unix_path); 00133 if (!NT_STATUS_IS_OK(result)) { 00134 goto out; 00135 } 00136 00137 unix_ini_path = talloc_asprintf(mem_ctx, "%s/%s", unix_path, GPT_INI); 00138 nt_ini_path = talloc_asprintf(mem_ctx, "%s\\%s", nt_path, GPT_INI); 00139 if (!unix_path || !nt_ini_path) { 00140 result = NT_STATUS_NO_MEMORY; 00141 goto out; 00142 } 00143 00144 result = gpo_copy_file(mem_ctx, cli, nt_ini_path, unix_ini_path); 00145 if (!NT_STATUS_IS_OK(result)) { 00146 goto out; 00147 } 00148 00149 result = gpo_sync_directories(mem_ctx, cli, nt_path, unix_path); 00150 if (!NT_STATUS_IS_OK(result)) { 00151 goto out; 00152 } 00153 00154 result = NT_STATUS_OK; 00155 00156 out: 00157 return result; 00158 }
NTSTATUS ads_gpo_get_sysvol_gpt_version | ( | ADS_STRUCT * | ads, | |
TALLOC_CTX * | mem_ctx, | |||
const char * | unix_path, | |||
uint32 * | sysvol_version, | |||
char ** | display_name | |||
) |
gpo_fetch.c の 164 行で定義されています。
参照先 name・nt_errstr()・parse_gpt_ini()・status・talloc_asprintf()・talloc_strdup().
参照元 check_refresh_gpo().
00169 { 00170 NTSTATUS status; 00171 uint32 version; 00172 char *local_path = NULL; 00173 char *name = NULL; 00174 00175 local_path = talloc_asprintf(mem_ctx, "%s/%s", unix_path, GPT_INI); 00176 NT_STATUS_HAVE_NO_MEMORY(local_path); 00177 00178 status = parse_gpt_ini(mem_ctx, local_path, &version, &name); 00179 if (!NT_STATUS_IS_OK(status)) { 00180 DEBUG(10,("ads_gpo_get_sysvol_gpt_version: failed to parse ini [%s]: %s\n", 00181 unix_path, nt_errstr(status))); 00182 return status; 00183 } 00184 00185 if (sysvol_version) { 00186 *sysvol_version = version; 00187 } 00188 00189 if (name && *display_name) { 00190 *display_name = talloc_strdup(mem_ctx, name); 00191 NT_STATUS_HAVE_NO_MEMORY(*display_name); 00192 } 00193 00194 return NT_STATUS_OK; 00195 }