Add iconv_convenience argument to size functions.
[kai/samba-autobuild/.git] / source3 / lib / sharesec.c
index b90346ff7eea67f2ae1ea64284537a690f4fa5de..a1d30f1d2b47431eac6ffaf161f84aa956150a1c 100644 (file)
@@ -41,7 +41,7 @@ static bool share_info_db_init(void)
 {
        const char *vstring = "INFO/version";
        int32 vers_id;
+
        if (share_db != NULL) {
                return True;
        }
@@ -53,7 +53,7 @@ static bool share_info_db_init(void)
                        state_path("share_info.tdb"), strerror(errno) ));
                return False;
        }
+
        vers_id = dbwrap_fetch_int32(share_db, vstring);
        if (vers_id == SHARE_DATABASE_VERSION_V2) {
                return true;
@@ -190,7 +190,7 @@ SEC_DESC *get_share_security( TALLOC_CTX *ctx, const char *servicename,
        }
 
        if (psd)
-               *psize = ndr_size_security_descriptor(psd, 0);
+               *psize = ndr_size_security_descriptor(psd, NULL, 0);
 
        return psd;
 }
@@ -252,6 +252,10 @@ bool delete_share_security(const char *servicename)
        char *key;
        NTSTATUS status;
 
+       if (!share_info_db_init()) {
+               return False;
+       }
+
        if (!(key = talloc_asprintf(talloc_tos(), "SECDESC/%s",
                                    servicename))) {
                return False;
@@ -279,7 +283,6 @@ bool share_access_check(const NT_USER_TOKEN *token, const char *sharename,
        NTSTATUS status;
        SEC_DESC *psd = NULL;
        size_t sd_size;
-       bool ret = True;
 
        psd = get_share_security(talloc_tos(), sharename, &sd_size);