[PR PATCH] [Updated] Added smbc_SetConfiguration which lets the user set the smb.conf for …

Volker Lendecke Volker.Lendecke at SerNet.DE
Wed Jan 17 12:50:45 UTC 2018


On Wed, Jan 17, 2018 at 12:59:24PM +0530, Puran Chand via samba-technical wrote:
> Gentle reminder,  Kindly review.

This

+/** set configuration file */
+int smbc_setConfiguration(SMBCCTX *c, const char *file)
+{
+    if (lp_load_client_no_reinit(file))
+    {
+        DBG_DEBUG("Configuration loaded successfully: %s\n", file);
+        return 0;
+    }
+    else
+    {
+        DBG_ERR("Could not load config file: %s\n", file);
+        errno = ENOENT;
+        return -1;
+    }
+}

looks strange according to README.Coding. More samba-style would be

int smbc_setConfiguration(SMBCCTX *c, const char *file)
{
        bool ok;

        ok = lp_load_client_no_reinit(file);
        if (!ok) {
                DBG_ERR("Could not load config file: %s\n", file);
                errno = ENOENT;
                return -1;
        }

        DBG_DEBUG("Configuration loaded successfully: %s\n", file);
        return 0;
}

Also, DBG_ERR goes to syslog by default. Do you really need to flood
/var/log/messages with that error?

With best regards,

Volker Lendecke

-- 
Besuchen Sie die verinice.XP 2018 in Berlin,
Anwenderkonferenz für Informationssicherheit
vom 21.-23.03.2018 im Sofitel Kurfürstendamm
Info & Anmeldung hier: http://veriniceXP.org

SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de



More information about the samba-technical mailing list