--- /dev/null
+<samba:parameter name="log writeable files on exit"
+ context="G"
+ type="boolean"
+ advanced="1" developer="0"
+ xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
+<description>
+ <para>
+ This boolean option controls whether at exit time the server
+ dumps a list of files with debug level 0 that were still open
+ for write. This is an administrative aid to find the files
+ that were potentially corrupt if the network connection died.
+ </para>
+</description>
+
+<value type="default">no</value>
+</samba:parameter>
bool lp_usershare_owner_only(void);
bool lp_disable_netbios(void);
bool lp_reset_on_zero_vc(void);
+bool lp_log_writeable_files_on_exit(void);
bool lp_ms_add_printer_wizard(void);
bool lp_dns_proxy(void);
bool lp_wins_support(void);
int iIdmapCacheTime;
int iIdmapNegativeCacheTime;
bool bResetOnZeroVC;
+ bool bLogWriteableFilesOnExit;
int iKeepalive;
int iminreceivefile;
struct param_opt_struct *param_opt;
.enum_list = NULL,
.flags = FLAG_ADVANCED,
},
+ {
+ .label = "log writeable files on exit",
+ .type = P_BOOL,
+ .p_class = P_GLOBAL,
+ .ptr = &Globals.bLogWriteableFilesOnExit,
+ .special = NULL,
+ .enum_list = NULL,
+ .flags = FLAG_ADVANCED,
+ },
{
.label = "acl compatibility",
.type = P_ENUM,
#endif
Globals.bUnixExtensions = True;
Globals.bResetOnZeroVC = False;
+ Globals.bLogWriteableFilesOnExit = False;
Globals.bCreateKrb5Conf = true;
/* hostname lookups can be very expensive and are broken on
FN_GLOBAL_BOOL(lp_usershare_owner_only, &Globals.bUsershareOwnerOnly)
FN_GLOBAL_BOOL(lp_disable_netbios, &Globals.bDisableNetbios)
FN_GLOBAL_BOOL(lp_reset_on_zero_vc, &Globals.bResetOnZeroVC)
+FN_GLOBAL_BOOL(lp_log_writeable_files_on_exit,
+ &Globals.bLogWriteableFilesOnExit)
FN_GLOBAL_BOOL(lp_ms_add_printer_wizard, &Globals.bMsAddPrinterWizard)
FN_GLOBAL_BOOL(lp_dns_proxy, &Globals.bDNSproxy)
FN_GLOBAL_BOOL(lp_wins_support, &Globals.bWINSsupport)
return(ret);
}
+static struct files_struct *log_writeable_file_fn(
+ struct files_struct *fsp, void *private_data)
+{
+ bool *found = (bool *)private_data;
+ char *path;
+
+ if (!fsp->can_write) {
+ return NULL;
+ }
+ if (!(*found)) {
+ DEBUG(0, ("Writable files open at exit:\n"));
+ *found = true;
+ }
+
+ path = talloc_asprintf(talloc_tos(), "%s/%s", fsp->conn->connectpath,
+ smb_fname_str_dbg(fsp->fsp_name));
+ if (path == NULL) {
+ DEBUGADD(0, ("<NOMEM>\n"));
+ }
+
+ DEBUGADD(0, ("%s\n", path));
+
+ TALLOC_FREE(path);
+ return NULL;
+}
+
/****************************************************************************
Exit the server.
****************************************************************************/
a->free(&sconn->smb1.negprot.auth_context);
}
+ if (lp_log_writeable_files_on_exit()) {
+ bool found = false;
+ files_forall(log_writeable_file_fn, &found);
+ }
+
if (sconn) {
had_open_conn = conn_close_all(sconn);
invalidate_all_vuids(sconn);