From 26bcbf6e3542fb350045888473a6e25d661ff6fa Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Sun, 20 Jun 2010 20:23:56 +0200 Subject: s4:libpolicy - Solaris compatibility fix --- source4/lib/policy/gp_filesys.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source4/lib') diff --git a/source4/lib/policy/gp_filesys.c b/source4/lib/policy/gp_filesys.c index 78b5c336ea..51bdbfd2d6 100644 --- a/source4/lib/policy/gp_filesys.c +++ b/source4/lib/policy/gp_filesys.c @@ -402,6 +402,7 @@ static NTSTATUS push_recursive (struct gp_context *gp_ctx, const char *local_pat int local_fd, remote_fd; int buf[1024]; int nread, total_read; + struct stat s; dir = opendir(local_path); while ((dirent = readdir(dir)) != NULL) { @@ -418,7 +419,10 @@ static NTSTATUS push_recursive (struct gp_context *gp_ctx, const char *local_pat remote_path, dirent->d_name); NT_STATUS_HAVE_NO_MEMORY(entry_remote_path); - if (dirent->d_type == DT_DIR) { + if (stat(dirent->d_name, &s) != 0) { + return NT_STATUS_UNSUCCESSFUL; + } + if (s.st_mode & S_IFDIR) { DEBUG(6, ("Pushing directory %s to %s on sysvol\n", entry_local_path, entry_remote_path)); smbcli_mkdir(gp_ctx->cli->tree, entry_remote_path); -- cgit