Change get_nt_acl_no_snum() to return an NTSTATUS, not a struct security_descriptor *.
[metze/samba/wip.git] / source3 / smbd / proto.h
index b7bab6ebfc450e523e715d37f7920be7e0ac059e..aae4bd02dbe827f5c80c796a6f5ebfbe52d780dd 100644 (file)
@@ -139,6 +139,9 @@ void msg_close_file(struct messaging_context *msg_ctx,
                    struct server_id server_id,
                    DATA_BLOB *data);
 NTSTATUS delete_all_streams(connection_struct *conn, const char *fname);
+bool recursive_rmdir(TALLOC_CTX *ctx,
+                    connection_struct *conn,
+                    struct smb_filename *smb_dname);
 
 /* The following definitions come from smbd/conn.c  */
 
@@ -157,10 +160,8 @@ void msg_force_tdis(struct messaging_context *msg,
 
 /* The following definitions come from smbd/connection.c  */
 
-bool yield_connection(connection_struct *conn, const char *name);
-int count_current_connections( const char *sharename, bool clear  );
+int count_current_connections(const char *sharename, bool verify);
 bool connections_snum_used(struct smbd_server_connection *unused, int snum);
-bool claim_connection(connection_struct *conn, const char *name);
 
 /* The following definitions come from smbd/dfree.c  */
 
@@ -598,7 +599,10 @@ void reply_nttranss(struct smb_request *req);
 
 NTSTATUS smbd_check_access_rights(struct connection_struct *conn,
                                const struct smb_filename *smb_fname,
+                               bool use_privs,
                                uint32_t access_mask);
+NTSTATUS fd_open(struct connection_struct *conn, files_struct *fsp,
+                int flags, mode_t mode);
 NTSTATUS fd_close(files_struct *fsp);
 void change_file_owner_to_parent(connection_struct *conn,
                                 const char *inherit_from_dir,
@@ -708,9 +712,12 @@ NTSTATUS unpack_nt_owners(connection_struct *conn, uid_t *puser, gid_t *pgrp, ui
 bool current_user_in_group(connection_struct *conn, gid_t gid);
 SMB_ACL_T free_empty_sys_acl(connection_struct *conn, SMB_ACL_T the_acl);
 NTSTATUS posix_fget_nt_acl(struct files_struct *fsp, uint32_t security_info,
+                          TALLOC_CTX *mem_ctx,
                           struct security_descriptor **ppdesc);
 NTSTATUS posix_get_nt_acl(struct connection_struct *conn, const char *name,
-                         uint32_t security_info, struct security_descriptor **ppdesc);
+                         uint32_t security_info,
+                         TALLOC_CTX *mem_ctx,
+                         struct security_descriptor **ppdesc);
 NTSTATUS try_chown(files_struct *fsp, uid_t uid, gid_t gid);
 NTSTATUS append_parent_acl(files_struct *fsp,
                                const struct security_descriptor *pcsd,
@@ -725,11 +732,22 @@ bool set_unix_posix_default_acl(connection_struct *conn, const char *fname,
                                const SMB_STRUCT_STAT *psbuf,
                                uint16 num_def_acls, const char *pdata);
 bool set_unix_posix_acl(connection_struct *conn, files_struct *fsp, const char *fname, uint16 num_acls, const char *pdata);
-struct security_descriptor *get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fname, uint32 security_info_wanted);
+NTSTATUS get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fname, uint32 security_info_wanted,
+                               struct security_descriptor **sd);
 NTSTATUS make_default_filesystem_acl(TALLOC_CTX *ctx,
                                        const char *name,
                                        SMB_STRUCT_STAT *psbuf,
                                        struct security_descriptor **ppdesc);
+int posix_sys_acl_blob_get_file(vfs_handle_struct *handle,
+                               const char *path_p,
+                               TALLOC_CTX *mem_ctx,
+                               char **blob_description,
+                               DATA_BLOB *blob);
+int posix_sys_acl_blob_get_fd(vfs_handle_struct *handle,
+                             files_struct *fsp,
+                             TALLOC_CTX *mem_ctx,
+                             char **blob_description,
+                             DATA_BLOB *blob);
 
 /* The following definitions come from smbd/process.c  */
 
@@ -785,18 +803,8 @@ bool fork_echo_handler(struct smbd_server_connection *sconn);
 
 /* The following definitions come from smbd/quotas.c  */
 
-bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
-bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
-bool disk_quotas(const char *path,
-               uint64_t *bsize,
-               uint64_t *dfree,
-               uint64_t *dsize);
-bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
-bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
 bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
 bool disk_quotas_vxfs(const char *name, char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
-bool disk_quotas(const char *path,uint64_t *bsize,uint64_t *dfree,uint64_t *dsize);
-bool disk_quotas(const char *path,uint64_t *bsize,uint64_t *dfree,uint64_t *dsize);
 
 /* The following definitions come from smbd/reply.c  */
 
@@ -945,6 +953,7 @@ void set_sec_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *groups, const struct
 void set_root_sec_ctx(void);
 bool pop_sec_ctx(void);
 void init_sec_ctx(void);
+const struct security_token *sec_ctx_active_token(void);
 
 /* The following definitions come from smbd/server.c  */
 
@@ -954,11 +963,14 @@ void delete_and_reload_printers(struct tevent_context *ev,
 bool reload_services(struct smbd_server_connection *sconn,
                     bool (*snumused) (struct smbd_server_connection *, int),
                     bool test);
-void exit_server(const char *const explanation);
-void exit_server_cleanly(const char *const explanation);
 NTSTATUS messaging_send_to_children(struct messaging_context *msg_ctx,
                                    uint32_t msg_type, DATA_BLOB* data);
 
+/* The following definitions come from smbd/server_exit.c  */
+
+void smbd_exit_server(const char *reason) _NORETURN_;
+void smbd_exit_server_cleanly(const char *const reason) _NORETURN_;
+
 /* The following definitions come from smbd/service.c  */
 
 bool set_conn_connectpath(connection_struct *conn, const char *connectpath);
@@ -974,6 +986,7 @@ connection_struct *make_connection_smb2(struct smbd_server_connection *sconn,
                                        const char *pdev,
                                        NTSTATUS *pstatus);
 connection_struct *make_connection(struct smbd_server_connection *sconn,
+                                  NTTIME now,
                                   const char *service_in,
                                   const char *pdev, uint64_t vuid,
                                   NTSTATUS *status);
@@ -981,9 +994,10 @@ void close_cnum(connection_struct *conn, uint64_t vuid);
 
 /* The following definitions come from smbd/session.c  */
 struct sessionid;
+struct smbXsrv_session;
 bool session_init(void);
-bool session_claim(struct smbd_server_connection *sconn, struct user_struct *vuser);
-void session_yield(struct user_struct *vuser);
+bool session_claim(struct smbXsrv_session *session);
+void session_yield(struct smbXsrv_session *session);
 int list_sessions(TALLOC_CTX *mem_ctx, struct sessionid **session_list);
 
 /* The following definitions come from smbd/sesssetup.c  */
@@ -1100,17 +1114,9 @@ uint64_t get_current_vuid(connection_struct *conn);
 /* The following definitions come from smbd/utmp.c  */
 
 void sys_utmp_claim(const char *username, const char *hostname,
-                       const char *ip_addr_str,
-                       const char *id_str, int id_num);
+                   const char *id_str, int id_num);
 void sys_utmp_yield(const char *username, const char *hostname,
-                       const char *ip_addr_str,
-                       const char *id_str, int id_num);
-void sys_utmp_yield(const char *username, const char *hostname,
-                       const char *ip_addr_str,
-                       const char *id_str, int id_num);
-void sys_utmp_claim(const char *username, const char *hostname,
-                       const char *ip_addr_str,
-                       const char *id_str, int id_num);
+                   const char *id_str, int id_num);
 
 /* The following definitions come from smbd/vfs.c  */
 
@@ -1160,4 +1166,21 @@ NTSTATUS vfs_streaminfo(connection_struct *conn,
 void *avahi_start_register(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
                           uint16_t port);
 
+/* The following definitions come from smbd/smb2_create.c */
+
+NTSTATUS vfs_default_durable_cookie(struct files_struct *fsp,
+                                   TALLOC_CTX *mem_ctx,
+                                   DATA_BLOB *cookie_blob);
+NTSTATUS vfs_default_durable_disconnect(struct files_struct *fsp,
+                                       const DATA_BLOB old_cookie,
+                                       TALLOC_CTX *mem_ctx,
+                                       DATA_BLOB *new_cookie);
+NTSTATUS vfs_default_durable_reconnect(struct connection_struct *conn,
+                                      struct smb_request *smb1req,
+                                      struct smbXsrv_open *op,
+                                      const DATA_BLOB old_cookie,
+                                      TALLOC_CTX *mem_ctx,
+                                      files_struct **result,
+                                      DATA_BLOB *new_cookie);
+
 #endif /* _SMBD_PROTO_H_ */