fstring dev;
int ret;
bool on_err_call_dis_hook = false;
+ bool on_err_call_profile_unref = false;
uid_t effuid;
gid_t effgid;
NTSTATUS status;
goto err_root_exit;
}
+ /* Initialize per-share profiling */
+ if (lp_smbd_profiling_share(snum)) {
+ smbprofile_persvc_mkref(snum,
+ lp_const_servicename(snum),
+ sconn->remote_hostname);
+ on_err_call_profile_unref = true;
+ }
+
/* ROOT Activities: */
/* explicitly check widelinks here so that we can correctly warn
* in the logs. */
/* Call VFS disconnect hook */
SMB_VFS_DISCONNECT(conn);
}
+ if (on_err_call_profile_unref) {
+ smbprofile_persvc_unref(snum);
+ }
return status;
}
/* Call VFS disconnect hook */
SMB_VFS_DISCONNECT(conn);
+ /* Cleanup per-share profiling */
+ if (lp_smbd_profiling_share(SNUM(conn))) {
+ smbprofile_persvc_unref(SNUM(conn));
+ }
+
/* execute any "postexec = " line */
if (*lp_postexec(talloc_tos(), lp_sub, SNUM(conn)) &&
change_to_user_and_service(conn, vuid)) {