2008-05-19 00:58:07 +04:00
/*
* Unix SMB / CIFS implementation .
* collected prototypes header
*
* frozen from " make proto " in May 2008
*
* Copyright ( C ) Michael Adam 2008
*
* 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 _PROTO_H_
# define _PROTO_H_
2015-08-18 14:18:33 +03:00
# include <sys/types.h>
# include <regex.h>
2016-11-11 04:15:20 +03:00
# include "lib/util/access.h"
2024-02-08 14:09:33 +03:00
# include "nsswitch/libwbclient/wbclient.h"
2008-05-19 00:58:07 +04:00
/* The following definitions come from lib/adt_tree.c */
/* The following definitions come from lib/audit.c */
2015-04-25 05:22:21 +03:00
const char * audit_category_str ( uint32_t category ) ;
const char * audit_param_str ( uint32_t category ) ;
const char * audit_description_str ( uint32_t category ) ;
bool get_audit_category_from_param ( const char * param , uint32_t * audit_category ) ;
const char * audit_policy_str ( TALLOC_CTX * mem_ctx , uint32_t policy ) ;
2008-05-19 00:58:07 +04:00
/* The following definitions come from lib/charcnv.c */
void gfree_charcnv ( void ) ;
size_t push_ascii ( void * dest , const char * src , size_t dest_len , int flags ) ;
size_t push_ascii_fstring ( void * dest , const char * src ) ;
size_t push_ascii_nstring ( void * dest , const char * src ) ;
size_t pull_ascii ( char * dest , const void * src , size_t dest_len , size_t src_len , int flags ) ;
size_t pull_ascii_fstring ( char * dest , const void * src ) ;
size_t pull_ascii_nstring ( char * dest , size_t dest_len , const void * src ) ;
2011-03-22 07:30:43 +03:00
size_t push_string_check_fn ( void * dest , const char * src ,
2009-03-17 06:04:43 +03:00
size_t dest_len , int flags ) ;
2015-04-25 05:22:21 +03:00
size_t push_string_base ( const char * base , uint16_t flags2 ,
2009-03-17 06:04:43 +03:00
void * dest , const char * src ,
size_t dest_len , int flags ) ;
2011-03-24 03:42:40 +03:00
size_t pull_string_talloc ( TALLOC_CTX * ctx ,
2008-05-19 00:58:07 +04:00
const void * base_ptr ,
2015-04-25 05:22:21 +03:00
uint16_t smb_flags2 ,
2008-05-19 00:58:07 +04:00
char * * ppdest ,
const void * src ,
size_t src_len ,
int flags ) ;
2011-04-12 10:31:08 +04:00
size_t dos_PutUniCode ( char * dst , const char * src , size_t len , bool null_terminate ) ;
int rpcstr_push_talloc ( TALLOC_CTX * ctx , smb_ucs2_t * * dest , const char * src ) ;
2008-05-19 00:58:07 +04:00
/* The following definitions come from lib/dmallocmsg.c */
void register_dmalloc_msgs ( struct messaging_context * msg_ctx ) ;
/* The following definitions come from lib/dprintf.c */
void display_set_stderr ( void ) ;
/* The following definitions come from lib/errmap_unix.c */
NTSTATUS map_nt_error_from_unix ( int unix_error ) ;
/* The following definitions come from lib/file_id.c */
struct file_id vfs_file_id_from_sbuf ( connection_struct * conn , const SMB_STRUCT_STAT * sbuf ) ;
2020-05-20 18:01:48 +03:00
NTSTATUS vfs_at_fspcwd ( TALLOC_CTX * mem_ctx ,
struct connection_struct * conn ,
struct files_struct * * _fsp ) ;
2020-08-11 11:41:07 +03:00
# include "source3/lib/interface.h"
2008-05-19 00:58:07 +04:00
/* The following definitions come from lib/ldap_debug_handler.c */
void init_ldap_debugging ( void ) ;
/* The following definitions come from lib/ldap_escape.c */
2009-07-10 00:03:52 +04:00
char * escape_ldap_string ( TALLOC_CTX * mem_ctx , const char * s ) ;
2008-05-19 00:58:07 +04:00
char * escape_rdn_val_string_alloc ( const char * s ) ;
/* The following definitions come from lib/ms_fnmatch.c */
int ms_fnmatch ( const char * pattern , const char * string , bool translate_pattern ,
bool is_case_sensitive ) ;
/* The following definitions come from lib/recvfile.c */
ssize_t sys_recvfile ( int fromfd ,
int tofd ,
2012-04-05 08:53:08 +04:00
off_t offset ,
2008-05-19 00:58:07 +04:00
size_t count ) ;
ssize_t sys_recvfile ( int fromfd ,
int tofd ,
2012-04-05 08:53:08 +04:00
off_t offset ,
2008-05-19 00:58:07 +04:00
size_t count ) ;
ssize_t drain_socket ( int sockfd , size_t count ) ;
/* The following definitions come from lib/sendfile.c */
2012-04-05 08:53:08 +04:00
ssize_t sys_sendfile ( int tofd , int fromfd , const DATA_BLOB * header , off_t offset , size_t count ) ;
2008-05-19 00:58:07 +04:00
/* The following definitions come from lib/server_mutex.c */
struct named_mutex * grab_named_mutex ( TALLOC_CTX * mem_ctx , const char * name ,
int timeout ) ;
/* The following definitions come from lib/sharesec.c */
2019-09-17 22:11:59 +03:00
NTSTATUS share_info_db_init ( void ) ;
2010-05-18 12:29:34 +04:00
struct security_descriptor * get_share_security ( TALLOC_CTX * ctx , const char * servicename ,
2008-05-19 00:58:07 +04:00
size_t * psize ) ;
2019-09-18 23:20:35 +03:00
NTSTATUS set_share_security ( const char * share_name ,
struct security_descriptor * psd ) ;
2019-09-18 23:37:32 +03:00
NTSTATUS delete_share_security ( const char * servicename ) ;
2011-07-04 19:02:34 +04:00
bool share_access_check ( const struct security_token * token ,
const char * sharename ,
2015-04-25 05:22:21 +03:00
uint32_t desired_access ,
2011-07-04 19:02:34 +04:00
uint32_t * pgranted ) ;
2010-05-18 12:29:34 +04:00
bool parse_usershare_acl ( TALLOC_CTX * ctx , const char * acl_str , struct security_descriptor * * ppsd ) ;
2008-05-19 00:58:07 +04:00
/* The following definitions come from lib/smbrun.c */
2016-10-12 18:55:15 +03:00
int smbrun_no_sanitize ( const char * cmd , int * outfd , char * const * env ) ;
int smbrun ( const char * cmd , int * outfd , char * const * env ) ;
2008-05-19 00:58:07 +04:00
int smbrunsecret ( const char * cmd , const char * secret ) ;
/* The following definitions come from lib/sysquotas.c */
int sys_get_quota ( const char * path , enum SMB_QUOTA_TYPE qtype , unid_t id , SMB_DISK_QUOTA * dp ) ;
int sys_set_quota ( const char * path , enum SMB_QUOTA_TYPE qtype , unid_t id , SMB_DISK_QUOTA * dp ) ;
2008-11-01 06:59:16 +03:00
/* The following definitions come from lib/sysquotas_*.c */
2008-05-19 00:58:07 +04:00
2008-11-03 19:31:32 +03:00
int sys_get_vfs_quota ( const char * path , const char * bdev , enum SMB_QUOTA_TYPE qtype , unid_t id , SMB_DISK_QUOTA * dp ) ;
int sys_set_vfs_quota ( const char * path , const char * bdev , enum SMB_QUOTA_TYPE qtype , unid_t id , SMB_DISK_QUOTA * dp ) ;
2008-05-19 00:58:07 +04:00
int sys_get_xfs_quota ( const char * path , const char * bdev , enum SMB_QUOTA_TYPE qtype , unid_t id , SMB_DISK_QUOTA * dp ) ;
int sys_set_xfs_quota ( const char * path , const char * bdev , enum SMB_QUOTA_TYPE qtype , unid_t id , SMB_DISK_QUOTA * dp ) ;
2019-02-06 01:52:33 +03:00
int sys_get_jfs2_quota ( const char * path , const char * bdev , enum SMB_QUOTA_TYPE qtype , unid_t id , SMB_DISK_QUOTA * dp ) ;
int sys_set_jfs2_quota ( const char * path , const char * bdev , enum SMB_QUOTA_TYPE qtype , unid_t id , SMB_DISK_QUOTA * dp ) ;
2010-08-06 12:21:09 +04:00
int sys_get_nfs_quota ( const char * path , const char * bdev ,
enum SMB_QUOTA_TYPE qtype ,
unid_t id , SMB_DISK_QUOTA * dp ) ;
int sys_set_nfs_quota ( const char * path , const char * bdev ,
enum SMB_QUOTA_TYPE qtype ,
unid_t id , SMB_DISK_QUOTA * dp ) ;
2008-05-19 00:58:07 +04:00
/* The following definitions come from lib/system.c */
ssize_t sys_send ( int s , const void * msg , size_t len , int flags ) ;
ssize_t sys_recvfrom ( int s , void * buf , size_t len , int flags , struct sockaddr * from , socklen_t * fromlen ) ;
int sys_fcntl_ptr ( int fd , int cmd , void * arg ) ;
2012-06-19 13:34:04 +04:00
int sys_fcntl_long ( int fd , int cmd , long arg ) ;
2019-09-27 08:49:37 +03:00
int sys_fcntl_int ( int fd , int cmd , int arg ) ;
2009-07-09 05:05:30 +04:00
void update_stat_ex_mtime ( struct stat_ex * dst , struct timespec write_ts ) ;
2009-11-18 01:55:02 +03:00
void update_stat_ex_create_time ( struct stat_ex * dst , struct timespec create_time ) ;
2019-08-30 15:49:47 +03:00
void update_stat_ex_from_saved_stat ( struct stat_ex * dst ,
const struct stat_ex * src ) ;
2024-06-25 13:39:09 +03:00
void copy_stat_ex_timestamps ( struct stat_ex * st ,
const struct smb_file_time * ft ) ;
2009-11-27 14:42:39 +03:00
int sys_stat ( const char * fname , SMB_STRUCT_STAT * sbuf ,
bool fake_dir_create_times ) ;
int sys_fstat ( int fd , SMB_STRUCT_STAT * sbuf ,
bool fake_dir_create_times ) ;
int sys_lstat ( const char * fname , SMB_STRUCT_STAT * sbuf ,
bool fake_dir_create_times ) ;
2021-07-13 01:37:20 +03:00
int sys_fstatat ( int fd ,
const char * pathname ,
SMB_STRUCT_STAT * sbuf ,
int flags ,
bool fake_dir_create_times ) ;
2012-04-05 08:53:08 +04:00
int sys_posix_fallocate ( int fd , off_t offset , off_t len ) ;
2015-02-09 20:21:59 +03:00
int sys_fallocate ( int fd , uint32_t mode , off_t offset , off_t len ) ;
2012-03-28 06:22:03 +04:00
DIR * sys_fdopendir ( int fd ) ;
2008-05-19 00:58:07 +04:00
int sys_mknod ( const char * path , mode_t mode , SMB_DEV_T dev ) ;
2019-08-21 02:28:18 +03:00
int sys_mknodat ( int dirfd , const char * path , mode_t mode , SMB_DEV_T dev ) ;
2011-06-01 03:14:04 +04:00
char * sys_getwd ( void ) ;
2008-05-19 00:58:07 +04:00
void set_effective_capability ( enum smbd_capability capability ) ;
void drop_effective_capability ( enum smbd_capability capability ) ;
long sys_random ( void ) ;
void sys_srandom ( unsigned int seed ) ;
2018-10-05 11:35:40 +03:00
int getgroups_max ( void ) ;
int setgroups_max ( void ) ;
2008-05-19 00:58:07 +04:00
int sys_getgroups ( int setlen , gid_t * gidset ) ;
int sys_setgroups ( gid_t UNUSED ( primary_gid ) , int setlen , gid_t * gidset ) ;
2015-04-25 05:22:21 +03:00
uint32_t unix_dev_major ( SMB_DEV_T dev ) ;
uint32_t unix_dev_minor ( SMB_DEV_T dev ) ;
2016-01-19 00:34:06 +03:00
char * sys_realpath ( const char * path ) ;
2012-01-07 02:55:30 +04:00
#if 0
2012-01-06 03:48:24 +04:00
int sys_get_number_of_cores ( void ) ;
2012-01-07 02:55:30 +04:00
# endif
2011-06-03 19:27:13 +04:00
2023-10-15 12:39:32 +03:00
struct sys_proc_fd_path_buf {
char buf [ 35 ] ; /* "/proc/self/fd/" + strlen(2^64) + 0-terminator */
} ;
2020-09-30 15:45:34 +03:00
bool sys_have_proc_fds ( void ) ;
2023-10-15 12:39:32 +03:00
char * sys_proc_fd_path ( int fd , struct sys_proc_fd_path_buf * buf ) ;
2020-09-30 15:45:34 +03:00
2011-06-03 19:27:13 +04:00
struct stat ;
void init_stat_ex_from_stat ( struct stat_ex * dst ,
const struct stat * src ,
bool fake_dir_create_times ) ;
2008-05-19 00:58:07 +04:00
/* The following definitions come from lib/system_smbd.c */
bool getgroups_unix_user ( TALLOC_CTX * mem_ctx , const char * user ,
gid_t primary_gid ,
2011-02-21 12:30:28 +03:00
gid_t * * ret_groups , uint32_t * p_ngroups ) ;
2008-05-19 00:58:07 +04:00
/* The following definitions come from lib/time.c */
2010-05-21 04:38:04 +04:00
uint32_t convert_time_t_to_uint32_t ( time_t t ) ;
time_t convert_uint32_t_to_time_t ( uint32_t u ) ;
2008-05-19 00:58:07 +04:00
bool nt_time_is_zero ( const NTTIME * nt ) ;
time_t generalized_to_unix_time ( const char * str ) ;
int get_server_zone_offset ( void ) ;
int set_server_zone_offset ( time_t t ) ;
2009-11-19 13:50:13 +03:00
char * timeval_string ( TALLOC_CTX * ctx , const struct timeval * tp , bool hires ) ;
2008-05-19 00:58:07 +04:00
char * current_timestring ( TALLOC_CTX * ctx , bool hires ) ;
void srv_put_dos_date ( char * buf , int offset , time_t unixdate ) ;
2023-11-26 17:17:45 +03:00
void srv_put_dos_date2_ts ( char * buf , int offset , struct timespec unix_ts ) ;
2008-05-19 00:58:07 +04:00
void srv_put_dos_date3 ( char * buf , int offset , time_t unixdate ) ;
2009-08-25 07:57:37 +04:00
void round_timespec ( enum timestamp_set_resolution res , struct timespec * ts ) ;
void put_long_date_timespec ( enum timestamp_set_resolution res , char * p , struct timespec ts ) ;
2019-11-29 18:28:54 +03:00
void put_long_date_full_timespec ( enum timestamp_set_resolution res ,
char * p ,
const struct timespec * ts ) ;
2019-12-05 17:26:07 +03:00
struct timespec pull_long_date_full_timespec ( const char * p ) ;
2008-05-19 00:58:07 +04:00
void put_long_date ( char * p , time_t t ) ;
void dos_filetime_timespec ( struct timespec * tsp ) ;
2010-08-05 15:06:11 +04:00
time_t make_unix_date ( const void * date_ptr , int zone_offset ) ;
2009-05-06 03:28:44 +04:00
time_t make_unix_date2 ( const void * date_ptr , int zone_offset ) ;
2009-05-06 07:59:22 +04:00
time_t make_unix_date3 ( const void * date_ptr , int zone_offset ) ;
2008-05-19 00:58:07 +04:00
time_t srv_make_unix_date ( const void * date_ptr ) ;
time_t srv_make_unix_date2 ( const void * date_ptr ) ;
time_t srv_make_unix_date3 ( const void * date_ptr ) ;
2023-10-04 14:25:21 +03:00
struct timespec interpret_long_date ( NTTIME nt ) ;
2008-05-19 00:58:07 +04:00
void TimeInit ( void ) ;
void get_process_uptime ( struct timeval * ret_time ) ;
2010-04-22 14:33:29 +04:00
void get_startup_time ( struct timeval * ret_time ) ;
2008-05-19 00:58:07 +04:00
time_t nt_time_to_unix_abs ( const NTTIME * nt ) ;
void unix_to_nt_time_abs ( NTTIME * nt , time_t t ) ;
const char * time_to_asc ( const time_t t ) ;
const char * display_time ( NTTIME nttime ) ;
bool nt_time_is_set ( const NTTIME * nt ) ;
/* The following definitions come from lib/username.c */
2010-10-20 19:16:23 +04:00
void flush_pwnam_cache ( void ) ;
2008-05-19 00:58:07 +04:00
char * get_user_home_dir ( TALLOC_CTX * mem_ctx , const char * user ) ;
struct passwd * Get_Pwnam_alloc ( TALLOC_CTX * mem_ctx , const char * user ) ;
2010-05-17 10:25:26 +04:00
/* The following definitions come from lib/util_names.c */
2010-05-26 05:11:08 +04:00
const char * get_global_sam_name ( void ) ;
2016-01-21 14:40:33 +03:00
const char * my_sam_name ( void ) ;
2021-01-11 18:15:15 +03:00
bool is_allowed_domain ( const char * domain_name ) ;
2010-05-17 10:25:26 +04:00
2008-05-19 00:58:07 +04:00
/* The following definitions come from lib/util.c */
2009-11-23 18:33:26 +03:00
void set_Protocol ( enum protocol_types p ) ;
2008-05-19 00:58:07 +04:00
void gfree_all ( void ) ;
2009-11-27 15:17:05 +03:00
bool file_exist_stat ( const char * fname , SMB_STRUCT_STAT * sbuf ,
bool fake_dir_create_times ) ;
2008-05-19 00:58:07 +04:00
bool socket_exist ( const char * fname ) ;
2009-01-27 02:39:40 +03:00
uint64_t get_file_size_stat ( const SMB_STRUCT_STAT * sbuf ) ;
2012-07-09 23:26:56 +04:00
bool check_same_dev_ino ( const SMB_STRUCT_STAT * sbuf1 ,
const SMB_STRUCT_STAT * sbuf2 ) ;
bool check_same_stat ( const SMB_STRUCT_STAT * sbuf1 ,
const SMB_STRUCT_STAT * sbuf2 ) ;
2011-05-05 21:41:59 +04:00
void show_msg ( const char * buf ) ;
2008-05-19 00:58:07 +04:00
int set_message_bcc ( char * buf , int num_bytes ) ;
2015-05-14 03:26:01 +03:00
ssize_t message_push_blob ( uint8_t * * outbuf , DATA_BLOB blob ) ;
2008-05-19 00:58:07 +04:00
char * unix_clean_name ( TALLOC_CTX * ctx , const char * s ) ;
char * clean_name ( TALLOC_CTX * ctx , const char * s ) ;
2012-04-05 08:53:08 +04:00
ssize_t write_data_at_offset ( int fd , const char * buffer , size_t N , off_t pos ) ;
2012-03-15 19:29:27 +04:00
NTSTATUS init_before_fork ( void ) ;
2021-04-27 19:03:57 +03:00
int parent_watch_fd ( void ) ;
2009-05-06 01:18:50 +04:00
NTSTATUS reinit_after_fork ( struct messaging_context * msg_ctx ,
2013-02-18 13:00:26 +04:00
struct tevent_context * ev_ctx ,
2022-12-03 19:04:33 +03:00
bool parent_longlived ) ;
2015-04-22 12:57:24 +03:00
NTSTATUS smbd_reinit_after_fork ( struct messaging_context * msg_ctx ,
struct tevent_context * ev_ctx ,
2022-12-03 18:59:39 +03:00
bool parent_longlived ) ;
2008-05-19 00:58:07 +04:00
void * malloc_ ( size_t size ) ;
void * Realloc ( void * p , size_t size , bool free_old_on_error ) ;
void add_to_large_array ( TALLOC_CTX * mem_ctx , size_t element_size ,
2015-04-25 05:22:21 +03:00
void * element , void * _array , uint32_t * num_elements ,
2008-05-19 00:58:07 +04:00
ssize_t * array_size ) ;
2009-02-13 12:56:34 +03:00
char * get_myname ( TALLOC_CTX * ctx ) ;
2008-05-19 00:58:07 +04:00
char * get_mydnsdomname ( TALLOC_CTX * ctx ) ;
char * automount_lookup ( TALLOC_CTX * ctx , const char * user_name ) ;
char * automount_lookup ( TALLOC_CTX * ctx , const char * user_name ) ;
bool process_exists ( const struct server_id pid ) ;
const char * uidtoname ( uid_t uid ) ;
char * gidtoname ( gid_t gid ) ;
uid_t nametouid ( const char * name ) ;
gid_t nametogid ( const char * name ) ;
2011-03-22 08:17:39 +03:00
void smb_panic_s3 ( const char * why ) ;
2023-12-13 09:57:46 +03:00
void log_panic_action ( const char * msg ) ;
2012-03-28 06:22:03 +04:00
const char * readdirname ( DIR * p ) ;
2024-01-20 21:12:09 +03:00
bool is_in_path ( const char * name ,
struct name_compare_entry * namelist ,
bool case_sensitive ) ;
2024-02-07 10:46:43 +03:00
bool token_contains_name ( TALLOC_CTX * mem_ctx ,
const char * username ,
const char * domain ,
const char * sharename ,
const struct security_token * token ,
smbd: return errors from token_contains_name()
Invalid names in "valid users", "invalid users", "read list", "write list",
"veto files" and "hide files" are logged and ignored, but a failure to contact
winbind or a DC from winbind, or a memory allocation failure, now all trigger a
failure of the tree connect.
Manually tested with smbclient with the following hack in winbindd:
---8<---
$ git di
source3/winbindd/winbindd_cache.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c
index c889489dbbbc..8ccf0a28e11a 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -1821,6 +1821,13 @@ NTSTATUS wb_cache_name_to_sid(struct winbindd_domain *domain,
ZERO_STRUCTP(sid);
*type = SID_NAME_UNKNOWN;
+ if (strequal(name, "unknown")) {
+ return NT_STATUS_OK;
+ }
+ if (strequal(name, "iotimeout")) {
+ return NT_STATUS_IO_TIMEOUT;
+ }
+
status = wcache_name_to_sid(domain, domain_name, name, sid, type);
if (!NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
return status;
---8<---
veto files = ../unknown/file1/../slow/file2
$ bin/smbclient -U slow%x //localhost/test -c quit
$
In the log:
[2024/03/04 15:21:33.659356, 1, pid=977167, effective(0, 0), real(0, 0)] ../../source3/lib/util_namearray.c:128(token_contains_name)
token_contains_name: lookup_name 'unknown' failed
veto files = ../iotimeout/file1/../slow/file2
$ bin/smbclient -U slow%x //localhost/test -c quit
tree connect failed: NT_STATUS_LOGON_FAILURE
$
[2024/03/04 15:22:15.655811, 0, pid=977177, effective(0, 0), real(0, 0)] ../../source3/lib/util_namearray.c:131(token_contains_name)
token_contains_name: lookup_name 'iotimeout' failed NT_STATUS_NO_SUCH_DOMAIN
[2024/03/04 15:22:15.655846, 1, pid=977177, effective(0, 0), real(0, 0)] ../../source3/smbd/uid.c:381(change_to_user_impersonate)
change_to_user_impersonate: SMB user slow (unix user slow) not permitted access to share test.
[2024/03/04 15:22:15.655855, 0, pid=977177, effective(0, 0), real(0, 0)] ../../source3/smbd/smb2_service.c:689(make_connection_snum)
make_connection_snum: Can't become connected user!
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-02-02 10:10:54 +03:00
const char * name ,
bool * match ) ;
2024-07-30 14:07:22 +03:00
bool append_to_namearray ( TALLOC_CTX * mem_ctx ,
const char * namelist_in ,
struct name_compare_entry * * _name_array ) ;
2024-02-07 13:40:29 +03:00
bool set_namearray ( TALLOC_CTX * mem_ctx ,
2024-01-20 14:58:52 +03:00
const char * namelist ,
struct name_compare_entry * * _name_array ) ;
2012-04-05 08:53:08 +04:00
bool fcntl_lock ( int fd , int op , off_t offset , off_t count , int type ) ;
2016-05-12 21:57:36 +03:00
bool fcntl_getlock ( int fd , int op , off_t * poffset , off_t * pcount , int * ptype , pid_t * ppid ) ;
2019-01-30 20:45:34 +03:00
int map_process_lock_to_ofd_lock ( int op ) ;
2008-05-19 00:58:07 +04:00
bool is_myname ( const char * s ) ;
void ra_lanman_string ( const char * native_lanman ) ;
const char * get_remote_arch_str ( void ) ;
2016-04-13 18:55:11 +03:00
enum remote_arch_types get_remote_arch_from_str ( const char * remote_arch_string ) ;
2008-05-19 00:58:07 +04:00
void set_remote_arch ( enum remote_arch_types type ) ;
enum remote_arch_types get_remote_arch ( void ) ;
2016-04-13 18:42:55 +03:00
bool remote_arch_cache_update ( const struct GUID * client_guid ) ;
bool remote_arch_cache_delete ( const struct GUID * client_guid ) ;
2008-05-19 00:58:07 +04:00
int str_checksum ( const char * s ) ;
void zero_free ( void * p , size_t size ) ;
int set_maxfiles ( int requested_max ) ;
void * smb_xmalloc_array ( size_t size , unsigned int count ) ;
char * myhostname ( void ) ;
2011-06-09 09:27:53 +04:00
char * myhostname_upper ( void ) ;
2015-12-13 18:32:52 +03:00
# include "lib/util_path.h"
2008-12-24 15:51:47 +03:00
bool parent_dirname ( TALLOC_CTX * mem_ctx , const char * dir , char * * parent ,
const char * * name ) ;
2008-05-19 00:58:07 +04:00
bool ms_has_wild ( const char * s ) ;
bool ms_has_wild_w ( const smb_ucs2_t * s ) ;
2009-11-23 18:34:07 +03:00
bool mask_match ( const char * string , const char * pattern , bool is_case_sensitive ) ;
2009-11-23 18:34:00 +03:00
bool mask_match_list ( const char * string , char * * list , int listLen , bool is_case_sensitive ) ;
2016-11-11 21:35:01 +03:00
# include "lib/util/unix_match.h"
2015-11-06 18:59:44 +03:00
# include "lib/util_procid.h"
2008-05-19 00:58:07 +04:00
struct server_id interpret_pid ( const char * pid_string ) ;
bool is_offset_safe ( const char * buf_base , size_t buf_len , char * ptr , size_t off ) ;
char * get_safe_str_ptr ( const char * buf_base , size_t buf_len , char * ptr , size_t off ) ;
2016-09-20 20:51:15 +03:00
bool split_domain_user ( TALLOC_CTX * mem_ctx ,
2008-05-19 00:58:07 +04:00
const char * full_name ,
char * * domain ,
char * * user ) ;
const char * strip_hostname ( const char * s ) ;
2010-10-18 12:09:57 +04:00
bool any_nt_status_not_ok ( NTSTATUS err1 , NTSTATUS err2 , NTSTATUS * result ) ;
2011-02-08 14:55:02 +03:00
int timeval_to_msec ( struct timeval t ) ;
2011-04-30 00:34:56 +04:00
char * valid_share_pathname ( TALLOC_CTX * ctx , const char * dos_pathname ) ;
2011-07-29 18:14:39 +04:00
bool is_executable ( const char * fname ) ;
2011-07-29 18:36:58 +04:00
bool map_open_params_to_ntcreate ( const char * smb_base_fname ,
int deny_mode , int open_func ,
2015-04-25 05:22:21 +03:00
uint32_t * paccess_mask ,
uint32_t * pshare_mode ,
uint32_t * pcreate_disposition ,
uint32_t * pcreate_options ,
2011-07-29 18:36:58 +04:00
uint32_t * pprivate_flags ) ;
2012-07-04 02:32:10 +04:00
struct security_unix_token * copy_unix_token ( TALLOC_CTX * ctx , const struct security_unix_token * tok ) ;
2018-03-16 21:01:20 +03:00
struct security_unix_token * root_unix_token ( TALLOC_CTX * mem_ctx ) ;
2019-01-09 19:04:34 +03:00
char * utok_string ( TALLOC_CTX * mem_ctx , const struct security_unix_token * tok ) ;
2013-11-13 03:32:42 +04:00
bool dir_check_ftype ( uint32_t mode , uint32_t dirtype ) ;
2008-05-19 00:58:07 +04:00
2011-03-18 18:05:55 +03:00
/* The following definitions come from lib/util_builtin.c */
2015-04-25 05:22:21 +03:00
bool lookup_builtin_rid ( TALLOC_CTX * mem_ctx , uint32_t rid , const char * * name ) ;
bool lookup_builtin_name ( const char * name , uint32_t * rid ) ;
2011-03-18 18:05:55 +03:00
const char * builtin_domain_name ( void ) ;
bool sid_check_is_builtin ( const struct dom_sid * sid ) ;
bool sid_check_is_in_builtin ( const struct dom_sid * sid ) ;
2012-01-17 16:59:56 +04:00
bool sid_check_is_wellknown_builtin ( const struct dom_sid * sid ) ;
2011-03-18 18:05:55 +03:00
2008-05-19 00:58:07 +04:00
/* The following definitions come from lib/util_nscd.c */
void smb_nscd_flush_user_cache ( void ) ;
void smb_nscd_flush_group_cache ( void ) ;
/* The following definitions come from lib/util_nttoken.c */
2023-09-15 03:08:20 +03:00
NTSTATUS merge_with_system_token ( TALLOC_CTX * mem_ctx ,
const struct security_token * token_1 ,
struct security_token * * token_out ) ;
2010-08-26 16:08:22 +04:00
bool token_sid_in_ace ( const struct security_token * token , const struct security_ace * ace ) ;
2008-05-19 00:58:07 +04:00
/* The following definitions come from lib/util_sec.c */
void sec_init ( void ) ;
uid_t sec_initial_uid ( void ) ;
gid_t sec_initial_gid ( void ) ;
2013-11-06 21:00:31 +04:00
bool root_mode ( void ) ;
2008-05-19 00:58:07 +04:00
bool non_root_mode ( void ) ;
void gain_root_privilege ( void ) ;
void gain_root_group_privilege ( void ) ;
void set_effective_uid ( uid_t uid ) ;
void set_effective_gid ( gid_t gid ) ;
void save_re_uid ( void ) ;
void restore_re_uid_fromroot ( void ) ;
void restore_re_uid ( void ) ;
void save_re_gid ( void ) ;
void restore_re_gid ( void ) ;
int set_re_uid ( void ) ;
void become_user_permanently ( uid_t uid , gid_t gid ) ;
2012-07-11 03:56:20 +04:00
int set_thread_credentials ( uid_t uid ,
gid_t gid ,
size_t setlen ,
const gid_t * gidset ) ;
2008-05-19 00:58:07 +04:00
bool is_setuid_root ( void ) ;
/* The following definitions come from lib/util_sid.c */
2010-05-21 05:25:01 +04:00
char * sid_to_fstring ( fstring sidstr_out , const struct dom_sid * sid ) ;
2015-08-26 11:52:44 +03:00
bool sid_linearize ( uint8_t * outbuf , size_t len , const struct dom_sid * sid ) ;
2010-05-21 05:25:01 +04:00
bool non_mappable_sid ( struct dom_sid * sid ) ;
2015-05-08 13:06:23 +03:00
char * sid_binstring_hex_talloc ( TALLOC_CTX * mem_ctx , const struct dom_sid * sid ) ;
2011-03-25 04:27:24 +03:00
struct netr_SamInfo3 ;
2008-05-19 00:58:07 +04:00
NTSTATUS sid_array_from_info3 ( TALLOC_CTX * mem_ctx ,
const struct netr_SamInfo3 * info3 ,
2010-05-21 05:25:01 +04:00
struct dom_sid * * user_sids ,
2010-08-26 14:54:13 +04:00
uint32_t * num_user_sids ,
2012-07-21 04:12:09 +04:00
bool include_user_group_rid ) ;
2023-04-18 13:09:45 +03:00
bool security_token_find_npa_flags ( const struct security_token * token ,
uint32_t * _flags ) ;
2023-04-18 15:32:20 +03:00
void security_token_del_npa_flags ( struct security_token * token ) ;
2008-05-19 00:58:07 +04:00
/* The following definitions come from lib/util_sock.c */
2008-10-23 21:53:15 +04:00
bool is_broadcast_addr ( const struct sockaddr * pss ) ;
2008-05-19 00:58:07 +04:00
bool is_loopback_ip_v4 ( struct in_addr ip ) ;
2008-10-23 21:53:15 +04:00
bool is_loopback_addr ( const struct sockaddr * pss ) ;
2011-02-27 11:57:18 +03:00
bool is_zero_addr ( const struct sockaddr_storage * pss ) ;
2008-05-19 00:58:07 +04:00
void zero_ip_v4 ( struct in_addr * ip ) ;
void in_addr_to_sockaddr_storage ( struct sockaddr_storage * ss ,
struct in_addr ip ) ;
2008-10-23 21:53:15 +04:00
bool same_net ( const struct sockaddr * ip1 ,
const struct sockaddr * ip2 ,
const struct sockaddr * mask ) ;
2008-12-03 10:29:57 +03:00
bool sockaddr_equal ( const struct sockaddr * ip1 ,
2008-10-23 21:53:15 +04:00
const struct sockaddr * ip2 ) ;
bool is_address_any ( const struct sockaddr * psa ) ;
2008-05-19 00:58:07 +04:00
uint16_t get_sockaddr_port ( const struct sockaddr_storage * pss ) ;
char * print_sockaddr ( char * dest ,
size_t destlen ,
const struct sockaddr_storage * psa ) ;
char * print_canonical_sockaddr ( TALLOC_CTX * ctx ,
const struct sockaddr_storage * pss ) ;
bool is_a_socket ( int fd ) ;
void set_socket_options ( int fd , const char * options ) ;
2009-09-07 08:38:50 +04:00
NTSTATUS read_fd_with_timeout ( int fd , char * buf ,
2008-05-19 00:58:07 +04:00
size_t mincnt , size_t maxcnt ,
unsigned int time_out ,
size_t * size_ret ) ;
2014-11-19 17:06:49 +03:00
NTSTATUS read_data_ntstatus ( int fd , char * buffer , size_t N ) ;
2014-11-19 17:21:17 +03:00
2008-05-19 00:58:07 +04:00
NTSTATUS read_smb_length_return_keepalive ( int fd , char * inbuf ,
unsigned int timeout ,
size_t * len ) ;
2008-05-28 20:31:42 +04:00
NTSTATUS receive_smb_raw ( int fd ,
char * buffer ,
size_t buflen ,
unsigned int timeout ,
size_t maxlen ,
size_t * p_len ) ;
2021-02-12 23:27:19 +03:00
int open_socket_in (
int type ,
const struct sockaddr_storage * paddr ,
uint16_t port ,
bool rebind ) ;
2009-01-03 21:50:05 +03:00
NTSTATUS open_socket_out ( const struct sockaddr_storage * pss , uint16_t port ,
int timeout , int * pfd ) ;
2009-02-26 14:34:39 +03:00
struct tevent_req * open_socket_out_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 13:00:26 +04:00
struct tevent_context * ev ,
2009-02-26 14:34:39 +03:00
const struct sockaddr_storage * pss ,
uint16_t port ,
int timeout ) ;
NTSTATUS open_socket_out_recv ( struct tevent_req * req , int * pfd ) ;
2009-03-16 21:15:26 +03:00
struct tevent_req * open_socket_out_defer_send ( TALLOC_CTX * mem_ctx ,
2013-02-18 13:00:26 +04:00
struct tevent_context * ev ,
2009-03-16 21:15:26 +03:00
struct timeval wait_time ,
const struct sockaddr_storage * pss ,
uint16_t port ,
int timeout ) ;
NTSTATUS open_socket_out_defer_recv ( struct tevent_req * req , int * pfd ) ;
2008-05-19 00:58:07 +04:00
const char * get_peer_addr ( int fd , char * addr , size_t addr_len ) ;
2011-06-08 16:50:20 +04:00
struct tsocket_address ;
int get_remote_hostname ( const struct tsocket_address * remote_address ,
char * * name ,
TALLOC_CTX * mem_ctx ) ;
2008-05-19 00:58:07 +04:00
int create_pipe_sock ( const char * socket_dir ,
const char * socket_name ,
mode_t dir_perms ) ;
const char * get_mydnsfullname ( void ) ;
bool is_myname_or_ipaddr ( const char * s ) ;
2011-02-07 18:55:16 +03:00
int poll_one_fd ( int fd , int events , int timeout , int * revents ) ;
2011-02-08 19:33:59 +03:00
int poll_intr_one_fd ( int fd , int events , int timeout , int * revents ) ;
2008-05-19 00:58:07 +04:00
/* The following definitions come from lib/util_str.c */
bool next_token ( const char * * ptr , char * buff , const char * sep , size_t bufsize ) ;
bool strnequal ( const char * s1 , const char * s2 , size_t n ) ;
bool strcsequal ( const char * s1 , const char * s2 ) ;
char * skip_string ( const char * base , size_t len , char * buf ) ;
size_t str_charnum ( const char * s ) ;
bool trim_char ( char * s , char cfront , char cback ) ;
bool strhasupper ( const char * s ) ;
bool strhaslower ( const char * s ) ;
bool in_list ( const char * s , const char * list , bool casesensitive ) ;
char * realloc_string_sub2 ( char * string ,
const char * pattern ,
const char * insert ,
bool remove_unsafe_characters ,
bool allow_trailing_dollar ) ;
char * realloc_string_sub ( char * string ,
const char * pattern ,
const char * insert ) ;
void all_string_sub ( char * s , const char * pattern , const char * insert , size_t len ) ;
char * string_truncate ( char * s , unsigned int length ) ;
2012-08-09 02:56:58 +04:00
bool strlower_m ( char * s ) ;
2012-08-08 23:16:40 +04:00
bool strupper_m ( char * s ) ;
2008-05-19 00:58:07 +04:00
int fstr_sprintf ( fstring s , const char * fmt , . . . ) ;
2008-10-25 15:50:25 +04:00
2008-10-14 03:59:36 +04:00
uint64_t STR_TO_SMB_BIG_UINT ( const char * nptr , const char * * entptr ) ;
2011-04-30 06:52:11 +04:00
uint64_t conv_str_size ( const char * str ) ;
2016-08-08 07:16:29 +03:00
char * talloc_asprintf_strupper_m ( TALLOC_CTX * t , const char * fmt , . . . )
PRINTF_ATTRIBUTE ( 2 , 3 ) ;
char * talloc_asprintf_strlower_m ( TALLOC_CTX * t , const char * fmt , . . . )
PRINTF_ATTRIBUTE ( 2 , 3 ) ;
2008-05-19 00:58:07 +04:00
bool validate_net_name ( const char * name ,
const char * invalid_chars ,
int max_len ) ;
char * escape_shell_string ( const char * src ) ;
2013-12-29 16:56:44 +04:00
ssize_t full_path_tos ( const char * dir , const char * name ,
char * tmpbuf , size_t tmpbuf_len ,
char * * pdst , char * * to_free ) ;
2008-05-19 00:58:07 +04:00
/* The following definitions come from lib/version.c */
const char * samba_version_string ( void ) ;
2023-12-14 13:35:19 +03:00
const char * samba_copyright_string ( void ) ;
2008-05-19 00:58:07 +04:00
/* The following definitions come from lib/wins_srv.c */
bool wins_srv_is_dead ( struct in_addr wins_ip , struct in_addr src_ip ) ;
void wins_srv_alive ( struct in_addr wins_ip , struct in_addr src_ip ) ;
void wins_srv_died ( struct in_addr wins_ip , struct in_addr src_ip ) ;
unsigned wins_srv_count ( void ) ;
char * * wins_srv_tags ( void ) ;
void wins_srv_tags_free ( char * * list ) ;
struct in_addr wins_srv_ip_tag ( const char * tag , struct in_addr src_ip ) ;
2011-06-12 16:07:22 +04:00
bool wins_server_tag_ips ( const char * tag , TALLOC_CTX * mem_ctx ,
2020-09-08 23:37:59 +03:00
struct in_addr * * pservers , size_t * pnum_servers ) ;
2008-05-19 00:58:07 +04:00
unsigned wins_srv_count_tag ( const char * tag ) ;
/* The following definitions come from libsmb/conncache.c */
NTSTATUS check_negative_conn_cache ( const char * domain , const char * server ) ;
void add_failed_connection_entry ( const char * domain , const char * server , NTSTATUS result ) ;
void flush_negative_conn_cache_for_domain ( const char * domain ) ;
/* The following definitions come from libsmb/errormap.c */
2015-05-14 03:26:01 +03:00
NTSTATUS dos_to_ntstatus ( uint8_t eclass , uint32_t ecode ) ;
2024-02-08 14:09:33 +03:00
NTSTATUS map_nt_error_from_wbcErr ( wbcErr wbc_err ) ;
2008-05-19 00:58:07 +04:00
/* The following definitions come from libsmb/namecache.c */
2020-08-27 22:17:07 +03:00
bool namecache_store ( const char * name ,
2020-08-27 21:45:17 +03:00
int name_type ,
size_t num_names ,
struct samba_sockaddr * sa_list ) ;
2020-08-27 01:42:15 +03:00
bool namecache_fetch ( TALLOC_CTX * ctx ,
const char * name ,
2008-05-19 00:58:07 +04:00
int name_type ,
2020-08-27 01:42:15 +03:00
struct samba_sockaddr * * sa_list ,
size_t * num_names ) ;
2008-05-19 00:58:07 +04:00
bool namecache_delete ( const char * name , int name_type ) ;
void namecache_flush ( void ) ;
bool namecache_status_store ( const char * keyname , int keyname_type ,
int name_type , const struct sockaddr_storage * keyip ,
const char * srvname ) ;
bool namecache_status_fetch ( const char * keyname ,
int keyname_type ,
int name_type ,
const struct sockaddr_storage * keyip ,
char * srvname_out ) ;
/* The following definitions come from libsmb/namequery_dc.c */
bool get_dc_name ( const char * domain ,
const char * realm ,
fstring srv_name ,
struct sockaddr_storage * ss_out ) ;
/* The following definitions come from libsmb/smberr.c */
2015-05-14 03:26:01 +03:00
const char * smb_dos_err_name ( uint8_t e_class , uint16_t num ) ;
2008-05-19 00:58:07 +04:00
const char * get_dos_error_msg ( WERROR result ) ;
2015-05-14 03:26:01 +03:00
const char * smb_dos_err_class ( uint8_t e_class ) ;
2008-05-19 00:58:07 +04:00
WERROR map_werror_from_unix ( int error ) ;
/* The following definitions come from libsmb/trusts_util.c */
2013-09-15 15:19:52 +04:00
struct netlogon_creds_cli_context ;
struct messaging_context ;
struct dcerpc_binding_handle ;
2016-08-23 13:12:35 +03:00
char * trust_pw_new_value ( TALLOC_CTX * mem_ctx ,
enum netr_SchannelType sec_channel_type ,
int security ) ;
2013-09-15 15:19:52 +04:00
NTSTATUS trust_pw_change ( struct netlogon_creds_cli_context * context ,
struct messaging_context * msg_ctx ,
struct dcerpc_binding_handle * b ,
const char * domain ,
2017-05-22 16:36:29 +03:00
const char * dcname ,
2013-09-15 15:19:52 +04:00
bool force ) ;
2008-05-19 00:58:07 +04:00
2010-03-01 18:18:23 +03:00
/* The following definitions come from lib/sessionid_tdb.c */
2011-03-19 02:47:12 +03:00
struct sessionid ;
2011-08-17 12:33:58 +04:00
NTSTATUS sessionid_traverse_read ( int ( * fn ) ( const char * key ,
struct sessionid * session ,
void * private_data ) ,
void * private_data ) ;
2010-03-01 18:18:23 +03:00
2009-03-20 16:55:05 +03:00
/* The following definitions come from lib/avahi.c */
struct AvahiPoll * tevent_avahi_poll ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ) ;
2011-02-26 02:28:38 +03:00
/* The following definitions come from libsmb/smbsock_connect.c */
2010-12-12 20:55:06 +03:00
struct tevent_req * smbsock_connect_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
const struct sockaddr_storage * addr ,
2010-12-23 17:20:22 +03:00
uint16_t port ,
2010-12-12 20:55:06 +03:00
const char * called_name ,
2010-12-23 17:20:22 +03:00
int called_type ,
const char * calling_name ,
int calling_type ) ;
2010-12-12 20:55:06 +03:00
NTSTATUS smbsock_connect_recv ( struct tevent_req * req , int * sock ,
2010-12-23 17:20:22 +03:00
uint16_t * ret_port ) ;
NTSTATUS smbsock_connect ( const struct sockaddr_storage * addr , uint16_t port ,
const char * called_name , int called_type ,
const char * calling_name , int calling_type ,
2011-04-17 22:16:07 +04:00
int * pfd , uint16_t * ret_port , int sec_timeout ) ;
2010-12-12 20:55:06 +03:00
2010-12-13 19:17:51 +03:00
struct tevent_req * smbsock_any_connect_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
const struct sockaddr_storage * addrs ,
const char * * called_names ,
2010-12-23 17:20:22 +03:00
int * called_types ,
const char * * calling_names ,
int * calling_types ,
size_t num_addrs , uint16_t port ) ;
2010-12-13 19:17:51 +03:00
NTSTATUS smbsock_any_connect_recv ( struct tevent_req * req , int * pfd ,
2010-12-23 17:20:22 +03:00
size_t * chosen_index , uint16_t * chosen_port ) ;
2010-12-13 19:17:51 +03:00
NTSTATUS smbsock_any_connect ( const struct sockaddr_storage * addrs ,
2010-12-23 17:20:22 +03:00
const char * * called_names ,
int * called_types ,
const char * * calling_names ,
int * calling_types ,
size_t num_addrs ,
uint16_t port ,
2011-04-17 22:16:07 +04:00
int sec_timeout ,
2010-12-23 17:20:22 +03:00
int * pfd , size_t * chosen_index ,
uint16_t * chosen_port ) ;
2010-12-13 19:17:51 +03:00
2011-03-23 01:20:49 +03:00
/* The following definitions come from lib/util_wellknown.c */
bool sid_check_is_wellknown_domain ( const struct dom_sid * sid , const char * * name ) ;
bool sid_check_is_in_wellknown_domain ( const struct dom_sid * sid ) ;
bool lookup_wellknown_sid ( TALLOC_CTX * mem_ctx , const struct dom_sid * sid ,
const char * * domain , const char * * name ) ;
bool lookup_wellknown_name ( TALLOC_CTX * mem_ctx , const char * name ,
struct dom_sid * sid , const char * * domain ) ;
2011-03-22 23:45:44 +03:00
/* The following definitions come from lib/filename_util.c */
NTSTATUS get_full_smb_filename ( TALLOC_CTX * ctx , const struct smb_filename * smb_fname ,
char * * full_name ) ;
2013-04-11 19:01:22 +04:00
struct smb_filename * synthetic_smb_fname ( TALLOC_CTX * mem_ctx ,
const char * base_name ,
const char * stream_name ,
2016-03-19 07:19:38 +03:00
const SMB_STRUCT_STAT * psbuf ,
2020-04-30 12:48:32 +03:00
NTTIME twrp ,
2016-03-19 07:19:38 +03:00
uint32_t flags ) ;
2024-01-02 14:49:14 +03:00
NTSTATUS safe_symlink_target_path ( TALLOC_CTX * mem_ctx ,
const char * connectpath ,
2024-01-02 15:25:25 +03:00
const char * dir ,
2024-01-02 14:49:14 +03:00
const char * target ,
size_t unparsed ,
char * * _relative ) ;
2021-12-08 09:08:10 +03:00
NTSTATUS filename_convert_dirfsp (
TALLOC_CTX * ctx ,
connection_struct * conn ,
const char * name_in ,
uint32_t ucf_flags ,
NTTIME twrp ,
struct files_struct * * pdirfsp ,
struct smb_filename * * psmb_name_rel ) ;
2023-06-22 15:46:01 +03:00
char * full_path_from_dirfsp_at_basename ( TALLOC_CTX * mem_ctx ,
const struct files_struct * dirfsp ,
const char * at_base_name ) ;
2020-04-14 18:44:37 +03:00
struct smb_filename * full_path_from_dirfsp_atname (
TALLOC_CTX * mem_ctx ,
const struct files_struct * dirfsp ,
const struct smb_filename * atname ) ;
2013-04-12 13:06:45 +04:00
struct smb_filename * synthetic_smb_fname_split ( TALLOC_CTX * ctx ,
2016-03-10 03:00:47 +03:00
const char * fname ,
bool posix_path ) ;
2011-03-22 23:45:44 +03:00
const char * smb_fname_str_dbg ( const struct smb_filename * smb_fname ) ;
const char * fsp_str_dbg ( const struct files_struct * fsp ) ;
2012-06-13 19:58:54 +04:00
const char * fsp_fnum_dbg ( const struct files_struct * fsp ) ;
2013-04-11 17:24:55 +04:00
struct smb_filename * cp_smb_filename ( TALLOC_CTX * mem_ctx ,
const struct smb_filename * in ) ;
2017-05-30 21:46:49 +03:00
struct smb_filename * cp_smb_filename_nostream ( TALLOC_CTX * mem_ctx ,
const struct smb_filename * in ) ;
2011-03-22 23:45:44 +03:00
bool is_ntfs_stream_smb_fname ( const struct smb_filename * smb_fname ) ;
bool is_ntfs_default_stream_smb_fname ( const struct smb_filename * smb_fname ) ;
2019-09-26 20:05:40 +03:00
bool is_named_stream ( const struct smb_filename * smb_fname ) ;
2013-07-10 02:50:47 +04:00
bool is_invalid_windows_ea_name ( const char * name ) ;
bool ea_list_has_invalid_name ( struct ea_list * ea_list ) ;
2016-03-10 01:56:49 +03:00
bool split_stream_filename ( TALLOC_CTX * ctx ,
const char * filename_in ,
char * * filename_out ,
char * * streamname_out ) ;
2011-03-22 23:45:44 +03:00
2011-03-19 02:47:12 +03:00
/* The following definitions come from lib/dummyroot.c */
void become_root ( void ) ;
void unbecome_root ( void ) ;
2013-10-23 13:02:39 +04:00
/* The following definitions come from lib/smbd_shim.c */
2011-03-19 02:47:12 +03:00
int find_service ( TALLOC_CTX * ctx , const char * service_in , char * * p_service_out ) ;
2022-10-21 17:45:35 +03:00
bool lp_allow_local_address (
int snum , const struct tsocket_address * local_address ) ;
2011-03-19 02:47:12 +03:00
bool change_to_root_user ( void ) ;
2013-10-23 13:02:39 +04:00
bool become_authenticated_pipe_user ( struct auth_session_info * session_info ) ;
bool unbecome_authenticated_pipe_user ( void ) ;
2011-03-19 02:47:12 +03:00
void contend_level2_oplocks_begin ( files_struct * fsp ,
enum level2_contention_type type ) ;
void contend_level2_oplocks_end ( files_struct * fsp ,
enum level2_contention_type type ) ;
2019-01-11 14:47:40 +03:00
/* The following definitions come from lib/per_thread_cwd.c */
void per_thread_cwd_check ( void ) ;
bool per_thread_cwd_supported ( void ) ;
void per_thread_cwd_disable ( void ) ;
void per_thread_cwd_activate ( void ) ;
2008-05-19 00:58:07 +04:00
# endif /* _PROTO_H_ */