s3: Make a few open utility functions non-static
authorTim Prouty <tprouty@samba.org>
Thu, 30 Oct 2008 00:28:19 +0000 (17:28 -0700)
committerTim Prouty <tprouty@samba.org>
Tue, 9 Dec 2008 22:51:47 +0000 (14:51 -0800)
This allows vfs modules that implement SMB_VFS_CREATE_FILE to access
some of the useful utility functions.

source3/include/proto.h
source3/smbd/dosmode.c
source3/smbd/open.c

index ed79ad03ec3e42ca31ee214309c11ae31ab79c77..9de64d018c2afa06e8f974fb09118e1ed8f6a84d 100644 (file)
@@ -7821,6 +7821,7 @@ bool dns_register_smbd_reply(struct dns_reg_state *dns_state,
 mode_t unix_mode(connection_struct *conn, int dosmode, const char *fname,
                 const char *inherit_from_dir);
 uint32 dos_mode_msdfs(connection_struct *conn, const char *path,SMB_STRUCT_STAT *sbuf);
+int dos_attributes_to_stat_dos_flags(uint32_t dosmode);
 uint32 dos_mode(connection_struct *conn, const char *path,SMB_STRUCT_STAT *sbuf);
 int file_set_dosmode(connection_struct *conn, const char *fname,
                     uint32 dosmode, SMB_STRUCT_STAT *st,
@@ -8097,6 +8098,34 @@ NTSTATUS smb1_file_se_access_check(const struct security_descriptor *sd,
                           uint32_t access_desired,
                           uint32_t *access_granted);
 NTSTATUS fd_close(files_struct *fsp);
+void change_file_owner_to_parent(connection_struct *conn,
+                                const char *inherit_from_dir,
+                                files_struct *fsp);
+NTSTATUS change_dir_owner_to_parent(connection_struct *conn,
+                                   const char *inherit_from_dir,
+                                   const char *fname,
+                                   SMB_STRUCT_STAT *psbuf);
+bool is_executable(const char *fname);
+bool is_stat_open(uint32 access_mask);
+bool request_timed_out(struct timeval request_time,
+                      struct timeval timeout);
+bool open_match_attributes(connection_struct *conn,
+                          const char *path,
+                          uint32 old_dos_attr,
+                          uint32 new_dos_attr,
+                          mode_t existing_unx_mode,
+                          mode_t new_unx_mode,
+                          mode_t *returned_unx_mode);
+NTSTATUS fcb_or_dos_open(struct smb_request *req,
+                        connection_struct *conn,
+                        files_struct *fsp_to_dup_into,
+                        const char *fname,
+                        struct file_id id,
+                        uint16 file_pid,
+                        uint16 vuid,
+                        uint32 access_mask,
+                        uint32 share_access,
+                        uint32 create_options);
 bool map_open_params_to_ntcreate(const char *fname, int deny_mode, int open_func,
                                 uint32 *paccess_mask,
                                 uint32 *pshare_mode,
@@ -8112,6 +8141,9 @@ void msg_file_was_renamed(struct messaging_context *msg,
                          uint32_t msg_type,
                          struct server_id server_id,
                          DATA_BLOB *data);
+struct case_semantics_state;
+struct case_semantics_state *set_posix_case_semantics(TALLOC_CTX *mem_ctx,
+                                                     connection_struct *conn);
 NTSTATUS create_file_default(connection_struct *conn,
                             struct smb_request *req,
                             uint16_t root_dir_fid,
index 954cd5a4d27c0f102bd80ec8add71fc9d50e94ca..de0748236966020fdbab46e2341659652667ccb8 100644 (file)
@@ -353,7 +353,7 @@ uint32 dos_mode_msdfs(connection_struct *conn, const char *path,SMB_STRUCT_STAT
  Convert dos attributes (FILE_ATTRIBUTE_*) to dos stat flags (UF_*)
 ****************************************************************************/
 
-static int dos_attributes_to_stat_dos_flags(uint32_t dosmode)
+int dos_attributes_to_stat_dos_flags(uint32_t dosmode)
 {
        uint32_t dos_stat_flags = 0;
 
index 41a1fb371d5bdfdd78676d5be1043f3cfe8080fd..5bd28862e109f781c473ad0f3d7ab8153ea798e1 100644 (file)
@@ -159,7 +159,7 @@ NTSTATUS fd_close(files_struct *fsp)
  Do this by fd if possible.
 ****************************************************************************/
 
-static void change_file_owner_to_parent(connection_struct *conn,
+void change_file_owner_to_parent(connection_struct *conn,
                                        const char *inherit_from_dir,
                                        files_struct *fsp)
 {
@@ -190,7 +190,7 @@ static void change_file_owner_to_parent(connection_struct *conn,
                  (unsigned int)parent_st.st_uid ));
 }
 
-static NTSTATUS change_dir_owner_to_parent(connection_struct *conn,
+NTSTATUS change_dir_owner_to_parent(connection_struct *conn,
                                       const char *inherit_from_dir,
                                       const char *fname,
                                       SMB_STRUCT_STAT *psbuf)
@@ -499,7 +499,7 @@ static NTSTATUS open_file(files_struct *fsp,
  Return True if the filename is one of the special executable types.
 ********************************************************************/
 
-static bool is_executable(const char *fname)
+bool is_executable(const char *fname)
 {
        if ((fname = strrchr_m(fname,'.'))) {
                if (strequal(fname,".com") ||
@@ -661,7 +661,7 @@ static void validate_my_share_entries(int num,
 }
 #endif
 
-static bool is_stat_open(uint32 access_mask)
+bool is_stat_open(uint32 access_mask)
 {
        return (access_mask &&
                ((access_mask & ~(SYNCHRONIZE_ACCESS| FILE_READ_ATTRIBUTES|
@@ -862,8 +862,8 @@ static bool delay_for_oplocks(struct share_mode_lock *lck,
        return True;
 }
 
-static bool request_timed_out(struct timeval request_time,
-                             struct timeval timeout)
+bool request_timed_out(struct timeval request_time,
+                      struct timeval timeout)
 {
        struct timeval now, end_time;
        GetTimeOfDay(&now);
@@ -928,13 +928,13 @@ static void defer_open(struct share_mode_lock *lck,
  On overwrite open ensure that the attributes match.
 ****************************************************************************/
 
-static bool open_match_attributes(connection_struct *conn,
-                                 const char *path,
-                                 uint32 old_dos_attr,
-                                 uint32 new_dos_attr,
-                                 mode_t existing_unx_mode,
-                                 mode_t new_unx_mode,
-                                 mode_t *returned_unx_mode)
+bool open_match_attributes(connection_struct *conn,
+                          const char *path,
+                          uint32 old_dos_attr,
+                          uint32 new_dos_attr,
+                          mode_t existing_unx_mode,
+                          mode_t new_unx_mode,
+                          mode_t *returned_unx_mode)
 {
        uint32 noarch_old_dos_attr, noarch_new_dos_attr;
 
@@ -978,7 +978,7 @@ static bool open_match_attributes(connection_struct *conn,
  Try and find a duplicated file handle.
 ****************************************************************************/
 
-static NTSTATUS fcb_or_dos_open(struct smb_request *req,
+NTSTATUS fcb_or_dos_open(struct smb_request *req,
                                     connection_struct *conn,
                                     files_struct *fsp_to_dup_into,
                                     const char *fname,
@@ -2562,8 +2562,8 @@ static int restore_case_semantics(struct case_semantics_state *state)
 /****************************************************************************
  Save case semantics.
 ****************************************************************************/
-static struct case_semantics_state *set_posix_case_semantics(TALLOC_CTX *mem_ctx,
-                                                            connection_struct *conn)
+struct case_semantics_state *set_posix_case_semantics(TALLOC_CTX *mem_ctx,
+                                                     connection_struct *conn)
 {
        struct case_semantics_state *result;