lib/param: Fix default of logon home to match s3
[sfrench/samba-autobuild/.git] / lib / param / loadparm.c
index 933afcb83f2fc7f69ee10abca389ca865e91c644..35666c339459168b4ff2673b375fcc588cc72411 100644 (file)
@@ -783,7 +783,7 @@ bool lpcfg_add_printer(struct loadparm_context *lp_ctx,
        /* entry (if/when the 'available' keyword is implemented!).    */
 
        /* the printer name is set to the service name. */
-       lpcfg_string_set(service, &service->szPrintername, pszPrintername);
+       lpcfg_string_set(service, &service->_printername, pszPrintername);
        lpcfg_string_set(service, &service->comment, comment);
        service->browseable = default_service->browseable;
        /* Printers cannot be read_only. */
@@ -2063,7 +2063,7 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx)
        myname = get_myname(lp_ctx);
        lpcfg_do_global_parameter(lp_ctx, "netbios name", myname);
        talloc_free(myname);
-       lpcfg_do_global_parameter(lp_ctx, "name resolve order", "wins host bcast");
+       lpcfg_do_global_parameter(lp_ctx, "name resolve order", "lmhosts wins host bcast");
 
        lpcfg_do_global_parameter(lp_ctx, "fstype", "NTFS");
 
@@ -2364,6 +2364,18 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx)
 
        lpcfg_do_global_parameter(lp_ctx, "usershare owner only", "yes");
 
+       lpcfg_do_global_parameter(lp_ctx, "-valid", "yes");
+
+       lpcfg_do_global_parameter_var(lp_ctx, "usershare path", "%s/usershares", get_dyn_STATEDIR());
+
+#ifdef DEVELOPER
+       lpcfg_do_global_parameter_var(lp_ctx, "panic action", "/bin/sleep 999999999");
+#endif
+
+       lpcfg_do_global_parameter(lp_ctx, "smb passwd file", get_dyn_SMB_PASSWD_FILE());
+
+       lpcfg_do_global_parameter(lp_ctx, "logon home", "\\\\%N\\%U");
+
        for (i = 0; parm_table[i].label; i++) {
                if (!(lp_ctx->flags[i] & FLAG_CMDLINE)) {
                        lp_ctx->flags[i] |= FLAG_DEFAULT;
@@ -2649,13 +2661,13 @@ const char *lpcfg_volume_label(struct loadparm_service *service, struct loadparm
 }
 
 /**
- * If we are PDC then prefer us as DMB
+ * Return the correct printer name.
  */
 const char *lpcfg_printername(struct loadparm_service *service, struct loadparm_service *sDefault)
 {
        const char *ret;
-       ret = lp_string((const char *)((service != NULL && service->szPrintername != NULL) ?
-                                      service->szPrintername : sDefault->szPrintername));
+       ret = lp_string((const char *)((service != NULL && service->_printername != NULL) ?
+                                      service->_printername : sDefault->_printername));
        if (ret == NULL || (ret != NULL && *ret == '\0'))
                ret = lpcfg_servicename(service);