smbd: Pass "file_id" through share_entry_forall
authorVolker Lendecke <vl@samba.org>
Wed, 7 Feb 2018 09:43:11 +0000 (10:43 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 12 Feb 2018 23:26:43 +0000 (00:26 +0100)
It's also in the share_entry, but that is redundant and will go

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/locking/proto.h
source3/locking/share_mode_lock.c
source3/rpc_server/srvsvc/srv_srvsvc_nt.c
source3/utils/status.c

index 33184e0fa0a925230f4a711cd225a48fd6c545ab..671b8327e494f53a71c95f171d0ef047f92e3546 100644 (file)
@@ -210,6 +210,7 @@ int share_mode_forall(int (*fn)(struct file_id fid,
                                void *private_data),
                      void *private_data);
 int share_entry_forall(int (*fn)(const struct share_mode_entry *,
+                                const struct file_id *id,
                                 const char *, const char *,
                                 const char *, void *),
                      void *private_data);
index cee00458079b86bc76a37aa011955b4276521547..fce0c335ec374195890c62d5ef50ce4374a20bab 100644 (file)
@@ -879,6 +879,7 @@ int share_mode_forall(int (*fn)(struct file_id fid,
 
 struct share_entry_forall_state {
        int (*fn)(const struct share_mode_entry *e,
+                 const struct file_id *id,
                  const char *service_path,
                  const char *base_name,
                  const char *stream_name,
@@ -897,6 +898,7 @@ static int share_entry_traverse_fn(struct file_id fid,
                int ret;
 
                ret = state->fn(&data->share_modes[i],
+                               &data->id,
                                data->servicepath,
                                data->base_name,
                                data->stream_name,
@@ -915,6 +917,7 @@ static int share_entry_traverse_fn(struct file_id fid,
 ********************************************************************/
 
 int share_entry_forall(int (*fn)(const struct share_mode_entry *,
+                                const struct file_id *id,
                                 const char *, const char *,
                                 const char *, void *),
                       void *private_data)
index 2ff8e64fccc16ee2a8f8f4c2d13590ec723a6ec8..19e63053ecedede30e835b76312d3a38ebeede2f 100644 (file)
@@ -82,6 +82,7 @@ struct share_conn_stat {
 ********************************************************************/
 
 static int enum_file_fn(const struct share_mode_entry *e,
+                       const struct file_id *id,
                        const char *sharepath,
                        const char *fname,
                        const char *sname,
@@ -173,7 +174,7 @@ static WERROR net_enum_files(TALLOC_CTX *ctx,
        f_enum_cnt.username = username;
        f_enum_cnt.ctr3 = *ctr3;
 
-       share_entry_forall( enum_file_fn, (void *)&f_enum_cnt );
+       share_entry_forall(enum_file_fn, (void *)&f_enum_cnt );
 
        *ctr3 = f_enum_cnt.ctr3;
 
@@ -841,6 +842,7 @@ static WERROR init_srv_sess_info_0(struct pipes_struct *p,
  **********************************************************************/
 
 static int count_sess_files_fn(const struct share_mode_entry *e,
+                              const struct file_id *id,
                               const char *sharepath,
                               const char *fname,
                               const char *sname,
@@ -968,6 +970,7 @@ static WERROR init_srv_sess_info_1(struct pipes_struct *p,
  ********************************************************************/
 
 static int share_file_fn(const struct share_mode_entry *e,
+                        const struct file_id *id,
                         const char *sharepath,
                         const char *fname,
                         const char *sname,
@@ -2699,6 +2702,7 @@ struct enum_file_close_state {
 };
 
 static int enum_file_close_fn(const struct share_mode_entry *e,
+                             const struct file_id *id,
                              const char *sharepath,
                              const char *fname,
                              const char *sname,
index dfb1d921a4230f4af0a2c67c1c4186aa2b81398b..beae85c4d3e4490faef6ce10baaf73ac7af2944f 100644 (file)
@@ -117,6 +117,7 @@ static bool Ucrit_addPid( struct server_id pid )
 }
 
 static int print_share_mode(const struct share_mode_entry *e,
+                           const struct file_id *id,
                            const char *sharepath,
                            const char *fname,
                            const char *sname,