From 24a39dea441fb65b4ac523dbb9f21010f1c52c38 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Fri, 26 Feb 2016 14:28:26 +0100 Subject: [PATCH] adtrustinstance: Make sure smb.conf exists The 'net' command fails unless smb.conf exists. Touch the file prior to any 'net' call to make sure we do not crash for this very reason. https://fedorahosted.org/freeipa/ticket/5687 Reviewed-By: Martin Basti --- ipaserver/install/adtrustinstance.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ipaserver/install/adtrustinstance.py b/ipaserver/install/adtrustinstance.py index 8a6e31e5c..fb88e5596 100644 --- a/ipaserver/install/adtrustinstance.py +++ b/ipaserver/install/adtrustinstance.py @@ -520,6 +520,11 @@ class ADTRUSTInstance(service.Service): os.write(tmp_fd, conf) os.close(tmp_fd) + # Workaround for: https://fedorahosted.org/freeipa/ticket/5687 + # We make sure that paths.SMB_CONF file exists, hence touch it + with open(paths.SMB_CONF, 'a'): + os.utime(paths.SMB_CONF, None) + args = [paths.NET, "conf", "import", tmp_name] try: