<string id="POL_F19C445A_AFD5_51B6_B87A_E42499C3C5D8_Help">This is the interval in s till tombstone records are deleted from the WINS database. Defaults to 1 day.</string>\r
<string id="POL_8CF1FEA3_BD3E_53C0_9F73_34050187A91E">wreplsrv:verify_interval</string>\r
<string id="POL_8CF1FEA3_BD3E_53C0_9F73_34050187A91E_Help">This is the interval in s till we verify active replica records with the owning WINS server. Unfortunately not implemented yet. Defaults to 24 days.</string>\r
+ <string id="CAT_9DEF582D_447A_47E9_A1F5_363558D03FA9">Messages</string>\r
+ <string id="POL_38DA04F0_3FD6_4425_8924_1CEEA685FD07">Message of the day</string>\r
+ <string id="POL_38DA04F0_3FD6_4425_8924_1CEEA685FD07_Help"> The contents of /etc/motd are displayed after a successful login but just before it executes the login shell.</string>\r
</stringTable>\r
<presentationTable>\r
<presentation id="POL_9320E11F_AC80_4A7D_A5C8_1C0F3F727061">\r
<defaultValue>2073600</defaultValue>\r
</textBox>\r
</presentation>\r
+ <presentation id="POL_38DA04F0_3FD6_4425_8924_1CEEA685FD07">\r
+ <textBox refId="TXT_609C208A_3B4D_48F1_8A15_C0DF08EAD4D6">\r
+ <label>Message of the day</label>\r
+ </textBox>\r
+ </presentation>\r
</presentationTable>\r
</resources>\r
</policyDefinitionResources>\r
<category name="CAT_2B6D622C_5721_4C23_A2D6_5C70D6E059BA" displayName="$(string.CAT_2B6D622C_5721_4C23_A2D6_5C70D6E059BA)">\r
<parentCategory ref="CAT_7D8D7DC8_5A9D_4BE1_8227_F09CDD5AFFC6" />\r
</category>\r
+ <category name="CAT_9DEF582D_447A_47E9_A1F5_363558D03FA9" displayName="$(string.CAT_9DEF582D_447A_47E9_A1F5_363558D03FA9)">\r
+ <parentCategory ref="CAT_7D8D7DC8_5A9D_4BE1_8227_F09CDD5AFFC6" />\r
+ </category>\r
<category displayName="$(string.CAT_10827749_64ED_5052_87F7_E81AD421856A)" name="CAT_10827749_64ED_5052_87F7_E81AD421856A">\r
<parentCategory ref="CAT_3338C1DD_8A00_4273_8547_158D8B8C19E9"/>\r
</category>\r
<text id="TXT_F35F7924_DBD3_5F6F_B247_7F4893C63844" key="Software\Policies\Samba\smb_conf\wreplsrv:verify_interval" valueName="wreplsrv:verify_interval"/>\r
</elements>\r
</policy>\r
+ <policy name="POL_38DA04F0_3FD6_4425_8924_1CEEA685FD07" class="Machine" displayName="$(string.POL_38DA04F0_3FD6_4425_8924_1CEEA685FD07)" explainText="$(string.POL_38DA04F0_3FD6_4425_8924_1CEEA685FD07_Help)" presentation="$(presentation.POL_38DA04F0_3FD6_4425_8924_1CEEA685FD07)" key="Software\Policies\Samba\Unix Settings\Messages">\r
+ <parentCategory ref="CAT_9DEF582D_447A_47E9_A1F5_363558D03FA9" />\r
+ <supportedOn ref="windows:SUPPORTED_WindowsVista" />\r
+ <elements>\r
+ <text id="TXT_609C208A_3B4D_48F1_8A15_C0DF08EAD4D6" key="Software\Policies\Samba\Unix Settings\Messages" valueName="motd" />\r
+ </elements>\r
+ </policy>\r
</policies>\r
</policyDefinitions>\r
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+import os
from samba.gpclass import gp_pol_ext
class gp_msgs_ext(gp_pol_ext):
+ def __str__(self):
+ return 'Unix Settings/Messages'
+
def process_group_policy(self, deleted_gpo_list, changed_gpo_list,
cdir='/etc'):
- pass
+ for guid, settings in deleted_gpo_list:
+ self.gp_db.set_guid(guid)
+ if str(self) in settings:
+ for attribute, msg in settings[str(self)].items():
+ if attribute == 'motd':
+ mfile = os.path.join(cdir, 'motd')
+ else:
+ continue
+ with open(mfile, 'w') as w:
+ if msg:
+ w.write(msg)
+ else:
+ w.truncate()
+ self.gp_db.delete(str(self), attribute)
+ self.gp_db.commit()
+
+ for gpo in changed_gpo_list:
+ if gpo.file_sys_path:
+ section_name = 'Software\\Policies\\Samba\\Unix Settings\\Messages'
+ self.gp_db.set_guid(gpo.name)
+ pol_file = 'MACHINE/Registry.pol'
+ path = os.path.join(gpo.file_sys_path, pol_file)
+ pol_conf = self.parse(path)
+ if not pol_conf:
+ continue
+ for e in pol_conf.entries:
+ if e.keyname == section_name and e.data.strip():
+ if e.valuename == 'motd':
+ mfile = os.path.join(cdir, 'motd')
+ else:
+ continue
+ if os.path.exists(mfile):
+ old_val = open(mfile, 'r').read()
+ else:
+ old_val = ''
+ with open(mfile, 'w') as w:
+ w.write(e.data)
+ self.gp_db.store(str(self), e.valuename, old_val)
+ self.gp_db.commit()
^samba.tests.ntlmdisabled.python\(ktest\).python2.ntlmdisabled.NtlmDisabledTests.test_samr_change_password\(ktest\)
^samba.tests.ntlmdisabled.python\(ad_dc_no_ntlm\).python3.ntlmdisabled.NtlmDisabledTests.test_ntlm_connection\(ad_dc_no_ntlm\)
^samba.tests.ntlmdisabled.python\(ad_dc_no_ntlm\).python2.ntlmdisabled.NtlmDisabledTests.test_ntlm_connection\(ad_dc_no_ntlm\)
-^samba.tests.gpo.samba.tests.gpo.GPOTests.test_gp_motd
from samba.gp_scripts_ext import gp_scripts_ext
from samba.gp_sudoers_ext import gp_sudoers_ext
from samba.gp_smb_conf_ext import gp_smb_conf_ext
+from samba.gp_msgs_ext import gp_msgs_ext
import logging
if __name__ == "__main__":
gp_extensions.append(gp_scripts_ext)
gp_extensions.append(gp_sudoers_ext)
gp_extensions.append(gp_smb_conf_ext)
+ gp_extensions.append(gp_msgs_ext)
gp_extensions.extend(machine_exts)
elif opts.target == 'User':
gp_extensions.extend(user_exts)