summaryrefslogtreecommitdiff
path: root/source3/libgpo/gpo_filesync.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2007-08-14 15:17:50 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:29:43 -0500
commit36a85969f92fe976a3e698d590b5a102e0593fc2 (patch)
treea362ee6d8ff2914e9b28dc30392e0a4d33a44cb5 /source3/libgpo/gpo_filesync.c
parent73b3ae9c55c5c1b3d20c69ce3571d066556881ed (diff)
downloadsamba-36a85969f92fe976a3e698d590b5a102e0593fc2.tar.gz
samba-36a85969f92fe976a3e698d590b5a102e0593fc2.tar.bz2
samba-36a85969f92fe976a3e698d590b5a102e0593fc2.zip
r24416: Some more minor edits for libgpo, mostly reformatting and moving of functions.
Guenther (This used to be commit 3e240672b431b7132dfb2bdd46198ab758eadd0b)
Diffstat (limited to 'source3/libgpo/gpo_filesync.c')
-rw-r--r--source3/libgpo/gpo_filesync.c45
1 files changed, 26 insertions, 19 deletions
diff --git a/source3/libgpo/gpo_filesync.c b/source3/libgpo/gpo_filesync.c
index e3996f444f..cb49dcbda7 100644
--- a/source3/libgpo/gpo_filesync.c
+++ b/source3/libgpo/gpo_filesync.c
@@ -1,18 +1,18 @@
-/*
+/*
* Unix SMB/CIFS implementation.
* Group Policy Object Support
* Copyright (C) Guenther Deschner 2006
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
@@ -25,13 +25,13 @@ struct sync_context {
char *remote_path;
char *local_path;
pstring mask;
- uint16 attribute;
+ uint16_t attribute;
};
static void gpo_sync_func(const char *mnt,
- file_info *info,
- const char *mask,
- void *state);
+ file_info *info,
+ const char *mask,
+ void *state);
NTSTATUS gpo_copy_file(TALLOC_CTX *mem_ctx,
struct cli_state *cli,
@@ -56,7 +56,7 @@ NTSTATUS gpo_copy_file(TALLOC_CTX *mem_ctx,
result = map_nt_error_from_unix(errno);
goto out;
}
-
+
if ((data = (char *)SMB_MALLOC(read_size)) == NULL) {
result = NT_STATUS_NO_MEMORY;
goto out;
@@ -111,8 +111,12 @@ static BOOL gpo_sync_files(struct sync_context *ctx)
{
DEBUG(3,("calling cli_list with mask: %s\n", ctx->mask));
- if (cli_list(ctx->cli, ctx->mask, ctx->attribute, gpo_sync_func, ctx) == -1) {
- DEBUG(1,("listing [%s] failed with error: %s\n",
+ if (cli_list(ctx->cli,
+ ctx->mask,
+ ctx->attribute,
+ gpo_sync_func,
+ ctx) == -1) {
+ DEBUG(1,("listing [%s] failed with error: %s\n",
ctx->mask, cli_errstr(ctx->cli)));
return False;
}
@@ -141,7 +145,7 @@ static void gpo_sync_func(const char *mnt,
return;
}
- DEBUG(5,("gpo_sync_func: got mask: [%s], name: [%s]\n",
+ DEBUG(5,("gpo_sync_func: got mask: [%s], name: [%s]\n",
mask, info->name));
if (info->mode & aDIR) {
@@ -158,12 +162,13 @@ static void gpo_sync_func(const char *mnt,
result = gpo_copy_dir(unix_dir);
if (!NT_STATUS_IS_OK(result)) {
- DEBUG(1,("failed to copy dir: %s\n", nt_errstr(result)));
+ DEBUG(1,("failed to copy dir: %s\n",
+ nt_errstr(result)));
}
old_nt_dir = ctx->remote_path;
ctx->remote_path = nt_dir;
-
+
old_unix_dir = ctx->local_path;
ctx->local_path = talloc_strdup(ctx->mem_ctx, unix_dir);
@@ -189,9 +194,11 @@ static void gpo_sync_func(const char *mnt,
fstrcat(unix_filename, "/");
fstrcat(unix_filename, info->name);
- result = gpo_copy_file(ctx->mem_ctx, ctx->cli, nt_filename, unix_filename);
+ result = gpo_copy_file(ctx->mem_ctx, ctx->cli,
+ nt_filename, unix_filename);
if (!NT_STATUS_IS_OK(result)) {
- DEBUG(1,("failed to copy file: %s\n", nt_errstr(result)));
+ DEBUG(1,("failed to copy file: %s\n",
+ nt_errstr(result)));
}
}
@@ -200,9 +207,9 @@ static void gpo_sync_func(const char *mnt,
list a remote directory and download recursivly
****************************************************************/
-NTSTATUS gpo_sync_directories(TALLOC_CTX *mem_ctx,
- struct cli_state *cli,
- const char *nt_path,
+NTSTATUS gpo_sync_directories(TALLOC_CTX *mem_ctx,
+ struct cli_state *cli,
+ const char *nt_path,
const char *local_path)
{
struct sync_context ctx;