return auth_info->signing_state;
}
+void set_cmdline_auth_info_use_ccache(struct user_auth_info *auth_info, bool b)
+{
+ auth_info->use_ccache = b;
+}
+
+bool get_cmdline_auth_info_use_ccache(const struct user_auth_info *auth_info)
+{
+ return auth_info->use_ccache;
+}
+
void set_cmdline_auth_info_use_kerberos(struct user_auth_info *auth_info,
bool b)
{
Check if a file exists - call vfs_file_exist for samba files.
********************************************************************/
-bool file_exist_stat(const char *fname,SMB_STRUCT_STAT *sbuf)
+bool file_exist_stat(const char *fname,SMB_STRUCT_STAT *sbuf,
+ bool fake_dir_create_times)
{
SMB_STRUCT_STAT st;
if (!sbuf)
sbuf = &st;
- if (sys_stat(fname, sbuf, lp_fake_dir_create_times()) != 0)
+ if (sys_stat(fname, sbuf, fake_dir_create_times) != 0)
return(False);
return((S_ISREG(sbuf->st_ex_mode)) || (S_ISFIFO(sbuf->st_ex_mode)));
bool socket_exist(const char *fname)
{
SMB_STRUCT_STAT st;
- if (sys_stat(fname, &st, lp_fake_dir_create_times()) != 0)
+ if (sys_stat(fname, &st, false) != 0)
return(False);
return S_ISSOCK(st.st_ex_mode);
}
-/*******************************************************************
- Check if a directory exists.
-********************************************************************/
-
-bool directory_exist_stat(char *dname,SMB_STRUCT_STAT *st)
-{
- SMB_STRUCT_STAT st2;
- bool ret;
-
- if (!st)
- st = &st2;
-
- if (sys_stat(dname, st, lp_fake_dir_create_times()) != 0)
- return(False);
-
- ret = S_ISDIR(st->st_ex_mode);
- if(!ret)
- errno = ENOTDIR;
- return ret;
-}
-
/*******************************************************************
Returns the size in bytes of the named given the stat struct.
********************************************************************/
{
SMB_STRUCT_STAT buf;
buf.st_ex_size = 0;
- if (sys_stat(file_name, &buf, lp_fake_dir_create_times()) != 0)
+ if (sys_stat(file_name, &buf, false) != 0)
return (SMB_OFF_T)-1;
return get_file_size_stat(&buf);
}
char *p;
uid_t u;
- pass = getpwnam_alloc(talloc_autofree_context(), name);
+ pass = Get_Pwnam_alloc(talloc_autofree_context(), name);
if (pass) {
u = pass->pw_uid;
TALLOC_FREE(pass);
int str_checksum(const char *s)
{
- int res = 0;
- int c;
- int i=0;
-
- while(*s) {
- c = *s;
- res ^= (c << (i % 15)) ^ (c >> (15-(i%15)));
- s++;
- i++;
- }
- return(res);
+ TDB_DATA key = string_tdb_data(s);
+ return jenkins_hash(&key);
}
/*****************************************************************
return s;
}
+
+bool tevent_req_poll_ntstatus(struct tevent_req *req,
+ struct tevent_context *ev,
+ NTSTATUS *status)
+{
+ bool ret = tevent_req_poll(req, ev);
+ if (!ret) {
+ *status = map_nt_error_from_unix(errno);
+ }
+ return ret;
+}