Fix inode generation so nautilus can count total dir size correctly
[samba.git] / source3 / lib / util.c
index 5fe7bce144e94ac3cdde16f41c04ce0be02b0b83..46be349a2c22d0253642eaecc72ea96e35f078af 100644 (file)
@@ -382,6 +382,16 @@ int get_cmdline_auth_info_signing_state(const struct user_auth_info *auth_info)
        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)
 {
@@ -1397,7 +1407,7 @@ uid_t nametouid(const char *name)
        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);
@@ -1987,17 +1997,8 @@ const char *tab_depth(int level, int depth)
 
 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);
 }
 
 /*****************************************************************
@@ -3060,3 +3061,14 @@ const char *strip_hostname(const char *s)
 
        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;
+}