[Bug 183006] smb.conf not found under FreeBSD

David Naylor blackdragon at highveldmail.co.za
Tue Feb 3 14:20:03 GMT 2009


http://bugs.kde.org/show_bug.cgi?id=183006





--- Comment #2 from David Naylor <blackdragon highveldmail co za>  2009-02-03 15:19:56 ---
(From update of attachment 30913)
--- kdelibs/kio/kio/ksambashare.cpp     2009-02-03 15:24:57.000000000 +0200
+++ kdelibs/kio/kio/ksambashare.cpp     2009-02-03 15:21:32.000000000 +0200
@@ -72,34 +72,29 @@
 {
   KConfig config(QLatin1String(FILESHARECONF));
   const KConfigGroup group(&config, QString());
+  const char *smbConfPath[] = {
+               "/etc/samba/smb.conf", 
+               "/etc/smb.conf", 
+               "/usr/local/etc/smb.conf", 
+               "/usr/local/samba/lib/smb.conf", 
+               "/usr/samba/lib/smb.conf", 
+               "/usr/lib/smb.conf", 
+               "/usr/local/lib/smb.conf", 
+               NULL};
   smbConf = group.readEntry("SMBCONF");

   if ( QFile::exists(smbConf) )
     return true;
+  
+  for(const char **smb = smbConfPath; *smb != NULL; ++smb)
+    if ( QFile::exists(*smb) ) {
+      smbConf = *smb;
+      return true;
+    }
+    
+  kDebug(7000) << "KSambaShare: Could not found smb.conf!";
+  return false;

-  if ( QFile::exists("/etc/samba/smb.conf") )
-    smbConf = "/etc/samba/smb.conf";
-  else
-  if ( QFile::exists("/etc/smb.conf") )
-    smbConf = "/etc/smb.conf";
-  else
-  if ( QFile::exists("/usr/local/samba/lib/smb.conf") )
-    smbConf = "/usr/local/samba/lib/smb.conf";
-  else
-  if ( QFile::exists("/usr/samba/lib/smb.conf") )
-    smbConf = "/usr/samba/lib/smb.conf";
-  else
-  if ( QFile::exists("/usr/lib/smb.conf") )
-    smbConf = "/usr/lib/smb.conf";
-  else
-  if ( QFile::exists("/usr/local/lib/smb.conf") )
-    smbConf = "/usr/local/lib/smb.conf";
-  else {
-    kDebug(7000) << "KSambaShare: Could not found smb.conf!";
-    return false;
-  }
-
-  return true;
 }




-- 
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Unassigned-bugs mailing list