Bug 197255 - [PATCH] net/samba41: testparm_command in rc script doesn't use samba_server_config from rc.conf
Summary: [PATCH] net/samba41: testparm_command in rc script doesn't use samba_server_c...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Timur I. Bakeyev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-01 21:52 UTC by guyyur
Modified: 2015-02-24 23:49 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (timur)


Attachments
patch for samba_server.in (2.74 KB, patch)
2015-02-01 21:52 UTC, guyyur
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description guyyur 2015-02-01 21:52:16 UTC
Created attachment 152457 [details]
patch for samba_server.in

Description:
A samba_server_config statement in rc.conf is ignored and the default
is used by samba_server rc script because it specifies testparm_command
after samba_server_config is set to $samba_server_config_default and
before load_rc_config sets it from rc.conf.

Attached patch to:
1. move load_rc_config for "samba_server" to before
   checking samba_server_role.
2. move setting samba_server_config, testparm_command
   to after doing load_rc_config for "samba_server".
3. fix winbindd being started when winbindd_enable is unset and
   samba_server_idmap is not specified in config file.
   (comment at start of script "You need to enable winbindd separately")


# grep samba_server /etc/rc.conf
samba_server_enable="YES"
samba_server_config="/usr/local/etc/smb.conf"


# sh -x /usr/local/etc/rc.d/samba_server start
+ . /etc/rc.subr
+ : 28915
+ export RC_PID
+ [ -z '' ]
+ _rc_subr_loaded=YES
...
+ name=samba_server
+ rcvar=samba_server_enable
+ samba_server_config_default=/usr/local/etc/smb4.conf
+ samba_server_config=/usr/local/etc/smb4.conf
+ samba_server_configfile_arg=--configfile=/usr/local/etc/smb4.conf
+ testparm_command='/usr/local/bin/testparm --suppress-prompt --verbose /usr/local/etc/smb4.conf'
...
+ load_rc_config samba_server
...
+ samba_server_enable=YES
+ samba_server_config=/usr/local/etc/smb.conf
...
+ [ winbindd = winbindd ]
+ /usr/local/bin/testparm --suppress-prompt --verbose /usr/local/etc/smb4.conf '--parameter-name=idmap uid'
+ samba_server_idmap=''
+ [ -n '' ]
+ eval 'winbindd_enable=${winbindd_enable-YES}'
+ winbindd_enable=YES
+ eval 'winbindd_enable=${winbindd_enable:-NO}'
+ winbindd_enable=YES
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2015-02-01 21:52:16 UTC
Auto-assigned to maintainer timur@FreeBSD.org
Comment 2 Timur I. Bakeyev freebsd_committer freebsd_triage 2015-02-24 23:49:05 UTC
Thank you for the patch!

I've committed it to the recent versions of samba4* with some small modifications.

With regards,
Timur Bakeyev