/* The following definitions come from lib/ldap_escape.c */
-char *escape_ldap_string_alloc(const char *s);
+char *escape_ldap_string(TALLOC_CTX *mem_ctx, const char *s);
char *escape_rdn_val_string_alloc(const char *s);
/* The following definitions come from lib/module.c */
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);
int sys_fcntl_long(int fd, int cmd, long arg);
+void update_stat_ex_mtime(struct stat_ex *dst, struct timespec write_ts);
int sys_stat(const char *fname,SMB_STRUCT_STAT *sbuf);
int sys_fstat(int fd,SMB_STRUCT_STAT *sbuf);
int sys_lstat(const char *fname,SMB_STRUCT_STAT *sbuf);
void *_talloc_array_zeronull(const void *ctx, size_t el_size, unsigned count, const char *name);
void *_talloc_zero_array_zeronull(const void *ctx, size_t el_size, unsigned count, const char *name);
void *talloc_zeronull(const void *context, size_t size, const char *name);
-NTSTATUS split_ntfs_stream_name(TALLOC_CTX *mem_ctx, const char *fname,
- char **pbase, char **pstream);
bool is_valid_policy_hnd(const struct policy_handle *hnd);
bool policy_hnd_equal(const struct policy_handle *hnd1,
const struct policy_handle *hnd2);
bool cli_NetWkstaUserLogoff(struct cli_state *cli, const char *user, const char *workstation);
int cli_NetPrintQEnum(struct cli_state *cli,
void (*qfn)(const char*,uint16,uint16,uint16,const char*,const char*,const char*,const char*,const char*,uint16,uint16),
- void (*jfn)(uint16,const char*,const char*,const char*,const char*,uint16,uint16,const char*,uint,uint,const char*));
+ void (*jfn)(uint16,const char*,const char*,const char*,const char*,uint16,uint16,const char*,uint_t,uint_t,const char*));
int cli_NetPrintQGetInfo(struct cli_state *cli, const char *printer,
void (*qfn)(const char*,uint16,uint16,uint16,const char*,const char*,const char*,const char*,const char*,uint16,uint16),
- void (*jfn)(uint16,const char*,const char*,const char*,const char*,uint16,uint16,const char*,uint,uint,const char*));
+ void (*jfn)(uint16,const char*,const char*,const char*,const char*,uint16,uint16,const char*,uint_t,uint_t,const char*));
int cli_RNetServiceEnum(struct cli_state *cli, void (*fn)(const char *, const char *, void *), void *state);
-int cli_NetSessionEnum(struct cli_state *cli, void (*fn)(char *, char *, uint16, uint16, uint16, uint, uint, uint, char *));
+int cli_NetSessionEnum(struct cli_state *cli, void (*fn)(char *, char *, uint16, uint16, uint16, uint_t, uint_t, uint_t, char *));
int cli_NetSessionGetInfo(struct cli_state *cli, const char *workstation,
- void (*fn)(const char *, const char *, uint16, uint16, uint16, uint, uint, uint, const char *));
+ void (*fn)(const char *, const char *, uint16, uint16, uint16, uint_t, uint_t, uint_t, const char *));
int cli_NetSessionDel(struct cli_state *cli, const char *workstation);
int cli_NetConnectionEnum(struct cli_state *cli, const char *qualifier,
void (*fn)(uint16_t conid, uint16_t contype,
struct share_mode_lock *get_share_mode_lock(TALLOC_CTX *mem_ctx,
const struct file_id id,
const char *servicepath,
- const char *fname,
+ const struct smb_filename *smb_fname,
const struct timespec *old_write_time);
struct share_mode_lock *fetch_share_mode_unlocked(TALLOC_CTX *mem_ctx,
- const struct file_id id,
- const char *servicepath,
- const char *fname);
+ const struct file_id id);
bool rename_share_filename(struct messaging_context *msg_ctx,
struct share_mode_lock *lck,
const char *servicepath,
- const char *newname);
+ const struct smb_filename *smb_fname);
void get_file_infos(struct file_id id,
bool *delete_on_close,
struct timespec *write_time);
/* The following definitions come from smbd/dosmode.c */
-mode_t unix_mode(connection_struct *conn, int dosmode, const char *fname,
+mode_t unix_mode(connection_struct *conn, int dosmode,
+ const struct smb_filename *smb_fname,
const char *inherit_from_dir);
-uint32 dos_mode_msdfs(connection_struct *conn, const char *path, const SMB_STRUCT_STAT *sbuf);
+uint32 dos_mode_msdfs(connection_struct *conn,
+ const struct smb_filename *smb_fname);
int dos_attributes_to_stat_dos_flags(uint32_t dosmode);
-uint32 dos_mode(connection_struct *conn, const char *path, const SMB_STRUCT_STAT *sbuf);
-int file_set_dosmode(connection_struct *conn, const char *fname,
- uint32 dosmode, SMB_STRUCT_STAT *st,
- const char *parent_dir,
- bool newfile);
-int file_ntimes(connection_struct *conn, const char *fname,
- struct smb_file_time *ft, const SMB_STRUCT_STAT *psbuf);
-bool set_sticky_write_time_path(connection_struct *conn, const char *fname,
- struct file_id fileid, const struct timespec mtime);
-bool set_sticky_write_time_fsp(struct files_struct *fsp, const struct timespec mtime);
+uint32 dos_mode(connection_struct *conn, const struct smb_filename *smb_fname);
+int file_set_dosmode(connection_struct *conn, struct smb_filename *smb_fname,
+ uint32 dosmode, const char *parent_dir, bool newfile);
+int file_ntimes(connection_struct *conn, const struct smb_filename *smb_fname,
+ struct smb_file_time *ft);
+bool set_sticky_write_time_path(struct file_id fileid, struct timespec mtime);
+bool set_sticky_write_time_fsp(struct files_struct *fsp,
+ struct timespec mtime);
bool update_write_time(struct files_struct *fsp);
/* The following definitions come from smbd/error.c */
void reply_both_error(struct smb_request *req, uint8 eclass, uint32 ecode,
NTSTATUS status, int line, const char *file);
void reply_openerror(struct smb_request *req, NTSTATUS status);
-void reply_unix_error(struct smb_request *req, uint8 defclass, uint32 defcode,
- NTSTATUS defstatus, int line, const char *file);
/* The following definitions come from smbd/fake_file.c */
struct smb_request *req, NTSTATUS nt_error,
char *params, int paramsize,
char *pdata, int datasize);
-bool is_ntfs_stream_name(const char *fname);
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);
void reply_ntcreate_and_X(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,
+ const struct smb_filename *smb_fname,
struct file_id id,
uint16 file_pid,
uint16 vuid,
uint32 *pcreate_disposition,
uint32 *pcreate_options);
NTSTATUS open_file_fchmod(struct smb_request *req, connection_struct *conn,
- const char *fname,
- SMB_STRUCT_STAT *psbuf, files_struct **result);
+ struct smb_filename *smb_fname,
+ files_struct **result);
NTSTATUS close_file_fchmod(struct smb_request *req, files_struct *fsp);
NTSTATUS create_directory(connection_struct *conn, struct smb_request *req,
struct smb_filename *smb_dname);
SEC_DESC **ppdesc);
NTSTATUS posix_get_nt_acl(struct connection_struct *conn, const char *name,
uint32_t security_info, SEC_DESC **ppdesc);
-int try_chown(connection_struct *conn, const char *fname, uid_t uid, gid_t gid);
+int try_chown(connection_struct *conn, struct smb_filename *smb_fname,
+ uid_t uid, gid_t gid);
NTSTATUS append_parent_acl(files_struct *fsp,
const SEC_DESC *pcsd,
SEC_DESC **pp_new_sd);
const struct smb_filename *smb_fname_new);
NTSTATUS smb_set_file_time(connection_struct *conn,
files_struct *fsp,
- const char *fname,
- const SMB_STRUCT_STAT *psbuf,
+ const struct smb_filename *smb_fname,
struct smb_file_time *ft,
bool setting_write_time);
void reply_findclose(struct smb_request *req);