The prototypes were spread across 3 different files.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
int find_service(TALLOC_CTX *ctx, const char *service_in, char **p_service_out);
bool lp_allow_local_address(
int snum, const struct tsocket_address *local_address);
-NTSTATUS can_delete_directory_fsp(files_struct *fsp);
bool change_to_root_user(void);
bool become_authenticated_pipe_user(struct auth_session_info *session_info);
bool unbecome_authenticated_pipe_user(void);
#include "smbd/smbd.h"
#include "lib/util/tevent_ntstatus.h"
#include "lib/util/smb_strtox.h"
+#include "source3/smbd/dir.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_VFS
#include "hash_inode.h"
#include "lib/adouble.h"
#include "lib/util_macstreams.h"
+#include "source3/smbd/dir.h"
/*
* Enhanced OS X and Netatalk compatibility
#include "includes.h"
#include "smbd/smbd.h"
#include "ntioctl.h"
+#include "source3/smbd/dir.h"
/*
Please read the VFS module Samba-HowTo-Collection.
#include "includes.h"
#include "smbd/smbd.h"
#include "system/filesys.h"
+#include "source3/smbd/dir.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_VFS
#include "includes.h"
#include "system/filesys.h"
#include "smbd/smbd.h"
+#include "source3/smbd/dir.h"
/*
#include "messages.h"
#include "../librpc/gen_ndr/open_files.h"
#include "lib/util/tevent_ntstatus.h"
+#include "source3/smbd/dir.h"
/****************************************************************************
Run a file if it is a magic script.
#include "../librpc/gen_ndr/open_files.h"
#include "lib/util/string_wrappers.h"
#include "libcli/smb/reparse.h"
+#include "source3/smbd/dir.h"
/*
This module implements directory related functions for Samba.
--- /dev/null
+/*
+ * Unix SMB/Netbios implementation.
+ *
+ * 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/>.
+ */
+
+#ifndef _SOURCE3_SMBD_DIR_H_
+#define _SOURCE3_SMBD_DIR_H_
+
+#include "includes.h"
+
+struct smb_Dir;
+struct dptr_struct;
+
+NTSTATUS can_delete_directory_fsp(files_struct *fsp);
+struct files_struct *dir_hnd_fetch_fsp(struct smb_Dir *dir_hnd);
+uint16_t dptr_attr(struct smbd_server_connection *sconn, int key);
+bool dptr_case_sensitive(struct dptr_struct *dptr);
+void dptr_closecnum(connection_struct *conn);
+void dptr_CloseDir(files_struct *fsp);
+NTSTATUS dptr_create(connection_struct *conn,
+ struct smb_request *req,
+ files_struct *fsp,
+ bool old_handle,
+ const char *wcard,
+ uint32_t attr,
+ struct dptr_struct **dptr_ret);
+int dptr_dnum(struct dptr_struct *dptr);
+files_struct *dptr_fetch_lanman2_fsp(struct smbd_server_connection *sconn,
+ int dptr_num);
+unsigned int dptr_FileNumber(struct dptr_struct *dptr);
+bool dptr_get_priv(struct dptr_struct *dptr);
+bool dptr_has_wild(struct dptr_struct *dptr);
+const char *dptr_path(struct smbd_server_connection *sconn, int key);
+char *dptr_ReadDirName(TALLOC_CTX *ctx, struct dptr_struct *dptr);
+void dptr_RewindDir(struct dptr_struct *dptr);
+void dptr_set_priv(struct dptr_struct *dptr);
+const char *dptr_wcard(struct smbd_server_connection *sconn, int key);
+bool have_file_open_below(connection_struct *conn,
+ const struct smb_filename *name);
+bool init_dptrs(struct smbd_server_connection *sconn);
+bool is_visible_fsp(files_struct *fsp);
+NTSTATUS OpenDir(TALLOC_CTX *mem_ctx,
+ connection_struct *conn,
+ const struct smb_filename *smb_dname,
+ const char *mask,
+ uint32_t attr,
+ struct smb_Dir **_dir_hnd);
+NTSTATUS OpenDir_from_pathref(TALLOC_CTX *mem_ctx,
+ struct files_struct *dirfsp,
+ const char *mask,
+ uint32_t attr,
+ struct smb_Dir **_dir_hnd);
+const char *ReadDirName(struct smb_Dir *dir_hnd, char **talloced);
+void RewindDir(struct smb_Dir *dir_hnd);
+bool smbd_dirptr_get_entry(TALLOC_CTX *ctx,
+ struct dptr_struct *dirptr,
+ const char *mask,
+ uint32_t dirtype,
+ bool dont_descend,
+ bool ask_sharemode,
+ bool get_dosmode,
+ bool (*match_fn)(TALLOC_CTX *ctx,
+ void *private_data,
+ const char *dname,
+ const char *mask,
+ char **_fname),
+ void *private_data,
+ char **_fname,
+ struct smb_filename **_smb_fname,
+ uint32_t *_mode);
+char *smbd_dirptr_get_last_name_sent(struct dptr_struct *dirptr);
+void smbd_dirptr_push_overflow(struct dptr_struct *dirptr,
+ char **_fname,
+ struct smb_filename **_smb_fname,
+ uint32_t mode);
+void smbd_dirptr_set_last_name_sent(struct dptr_struct *dirptr, char **_fname);
+#endif
#include "../libcli/security/security.h"
#include "../librpc/gen_ndr/ndr_security.h"
#include "smbd/smbd.h"
+#include "source3/smbd/dir.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_ACLS
#include "smbd/smbd.h"
#include "smbd/globals.h"
#include "libcli/smb/reparse.h"
+#include "source3/smbd/dir.h"
uint32_t ucf_flags_from_smb_request(struct smb_request *req)
{
char **ppdata,
int *ret_data_len);
-bool smbd_dirptr_get_entry(TALLOC_CTX *ctx,
- struct dptr_struct *dirptr,
- const char *mask,
- uint32_t dirtype,
- bool dont_descend,
- bool ask_sharemode,
- bool get_dosmode,
- bool (*match_fn)(TALLOC_CTX *ctx,
- void *private_data,
- const char *dname,
- const char *mask,
- char **_fname),
- void *private_data,
- char **_fname,
- struct smb_filename **_smb_fname,
- uint32_t *_mode);
-void smbd_dirptr_push_overflow(struct dptr_struct *dirptr,
- char **_fname,
- struct smb_filename **_smb_fname,
- uint32_t mode);
-void smbd_dirptr_set_last_name_sent(struct dptr_struct *dirptr,
- char **_fname);
-char *smbd_dirptr_get_last_name_sent(struct dptr_struct *dirptr);
-
NTSTATUS smbd_dirptr_lanman2_entry(TALLOC_CTX *ctx,
connection_struct *conn,
struct dptr_struct *dirptr,
#include "lib/tsocket/tsocket.h"
#include "lib/global_contexts.h"
#include "source3/lib/substitute.h"
+#include "source3/smbd/dir.h"
/**********************************************************************
Parse a DFS pathname of the form(s)
#include "locking/leases_db.h"
#include "librpc/gen_ndr/ndr_leases_db.h"
#include "lib/util/time_basic.h"
+#include "source3/smbd/dir.h"
extern const struct generic_mapping file_generic_mapping;
/* The following definitions come from smbd/dir.c */
-bool init_dptrs(struct smbd_server_connection *sconn);
-const char *dptr_path(struct smbd_server_connection *sconn, int key);
-const char *dptr_wcard(struct smbd_server_connection *sconn, int key);
-uint16_t dptr_attr(struct smbd_server_connection *sconn, int key);
-void dptr_closecnum(connection_struct *conn);
-NTSTATUS dptr_create(connection_struct *conn,
- struct smb_request *req,
- files_struct *fsp,
- bool old_handle,
- const char *wcard,
- uint32_t attr,
- struct dptr_struct **dptr_ret);
-void dptr_CloseDir(files_struct *fsp);
-void dptr_RewindDir(struct dptr_struct *dptr);
-unsigned int dptr_FileNumber(struct dptr_struct *dptr);
-bool dptr_has_wild(struct dptr_struct *dptr);
-int dptr_dnum(struct dptr_struct *dptr);
-bool dptr_get_priv(struct dptr_struct *dptr);
-void dptr_set_priv(struct dptr_struct *dptr);
-bool dptr_case_sensitive(struct dptr_struct *dptr);
-char *dptr_ReadDirName(TALLOC_CTX *ctx, struct dptr_struct *dptr);
-struct smb_Dir;
-struct files_struct *dir_hnd_fetch_fsp(struct smb_Dir *dir_hnd);
-files_struct *dptr_fetch_lanman2_fsp(struct smbd_server_connection *sconn,
- int dptr_num);
-struct smb_Dir;
-bool is_visible_fsp(files_struct *fsp);
-NTSTATUS OpenDir(TALLOC_CTX *mem_ctx,
- connection_struct *conn,
- const struct smb_filename *smb_dname,
- const char *mask,
- uint32_t attr,
- struct smb_Dir **_dir_hnd);
-NTSTATUS OpenDir_from_pathref(TALLOC_CTX *mem_ctx,
- struct files_struct *dirfsp,
- const char *mask,
- uint32_t attr,
- struct smb_Dir **_dir_hnd);
-const char *ReadDirName(struct smb_Dir *dir_hnd, char **talloced);
-void RewindDir(struct smb_Dir *dir_hnd);
NTSTATUS can_delete_directory(struct connection_struct *conn,
const char *dirname);
-bool have_file_open_below(connection_struct *conn,
- const struct smb_filename *name);
/* The following definitions come from smbd/dmapi.c */
#include "lib/util/string_wrappers.h"
#include "source3/printing/rap_jobid.h"
#include "source3/lib/substitute.h"
+#include "source3/smbd/dir.h"
/****************************************************************************
Check if we have a correct fsp pointing to a file. Basic check for open fsp.
#include "lib/util/string_wrappers.h"
#include "source3/lib/substitute.h"
#include "source3/lib/adouble.h"
+#include "source3/smbd/dir.h"
#define DIR_ENTRY_SAFETY_MARGIN 4096
#include "libcli/smb/smbXcli_base.h"
#include "lib/util/time_basic.h"
#include "source3/lib/substitute.h"
+#include "source3/smbd/dir.h"
/* Internal message queue for deferred opens. */
struct pending_message_list {
#include "../lib/util/tevent_ntstatus.h"
#include "system/filesys.h"
#include "lib/pthreadpool/pthreadpool_tevent.h"
+#include "source3/smbd/dir.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_SMB2
#include "lib/util/string_wrappers.h"
#include "source3/printing/rap_jobid.h"
#include "source3/lib/substitute.h"
+#include "source3/smbd/dir.h"
/****************************************************************************
Ensure we check the path in *exactly* the same way as W2K for a findfirst/findnext
#include "lib/util/string_wrappers.h"
#include "source3/lib/substitute.h"
#include "source3/lib/adouble.h"
+#include "source3/smbd/dir.h"
#define DIR_ENTRY_SAFETY_MARGIN 4096
#include "../lib/util/util_pw.h"
#include "libcli/security/security.h"
#include "passdb/machine_sid.h"
+#include "source3/smbd/dir.h"
static const char *null_string = "";