r4802: Don't try to update a column with the name "NULL"
authorJelmer Vernooij <jelmer@samba.org>
Mon, 17 Jan 2005 14:25:58 +0000 (14:25 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:53:55 +0000 (10:53 -0500)
(This used to be commit ed38e6026494a2b58c70cc175c6e210bea454e5c)

source3/passdb/pdb_sql.c

index 820280bcbf6d28be262ff2a16475449fc3d226c8..ee9ece2baf03d409d05b6334d63806d0a527e3b1 100644 (file)
@@ -141,8 +141,14 @@ static const char * config_value_write(const char *location, const char *name, c
        swrite = strrchr(v, ':');
 
        /* Default to the same field as read field */
-       if (!swrite)
+       if (!swrite) {
+
+               /* Updating NULL does not make much sense */
+               if (!strcmp(v, "NULL")) 
+                       return NULL;
+
                return v;
+       }
 
        swrite++;