Hi,

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.

I couldn't find the aforementioned Samba bug either in the RH/Samba
bugzilla, despite spending non-trivial amount of time searching for it.

Can somebody point me to it? I referenced the IPA ticket for now.

https://fedorahosted.org/freeipa/ticket/5687
From 4fd714beec5c95e079028836168e0188ed27ff0c Mon Sep 17 00:00:00 2001
From: Tomas Babej <tba...@redhat.com>
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
---
 ipaserver/install/adtrustinstance.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ipaserver/install/adtrustinstance.py b/ipaserver/install/adtrustinstance.py
index 54a23bc15d818864f0987b02294244414ed9883f..cd346e0698e7c7d2e0f9f76893104cdf7262fb98 100644
--- a/ipaserver/install/adtrustinstance.py
+++ b/ipaserver/install/adtrustinstance.py
@@ -517,6 +517,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:
-- 
2.5.0

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to