The Samba-Bugzilla – Attachment 601 Details for
Bug 1612
Samba can't store plaintext passwords in sql pdb (mysql, pgsql)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patchs allows "NULL" for name of DB column, which we won't store in SQL; it alows store plaintext password in SQL
samba-3.0.x-sql-plaintext-pw.patch (text/plain), 1.92 KB, created by
Filip Jirsák
on 2004-08-17 02:42:40 UTC
(
hide
)
Description:
Patchs allows "NULL" for name of DB column, which we won't store in SQL; it alows store plaintext password in SQL
Filename:
MIME Type:
Creator:
Filip Jirsák
Created:
2004-08-17 02:42:40 UTC
Size:
1.92 KB
patch
obsolete
>diff -Naur samba-3.0.5.old/source/passdb/pdb_sql.c samba-3.0.5/source/passdb/pdb_sql.c >--- samba-3.0.5.old/source/passdb/pdb_sql.c 2004-07-20 18:28:09.000000000 +0200 >+++ samba-3.0.5/source/passdb/pdb_sql.c 2004-08-15 14:13:47.000000000 +0200 >@@ -50,6 +50,8 @@ > #define CONFIG_LOGON_COUNT_DEFAULT "logon_count" > #define CONFIG_UNKNOWN_6_DEFAULT "unknown_6" > >+#define EMPTY_COLUMN_NAME "NULL" >+ > /* Used to construct insert and update queries */ > > typedef struct pdb_sql_query { >@@ -64,6 +66,13 @@ > if (!name || strchr(name, '\'')) > return; /* This field shouldn't be set by us */ > >+ /* strcasecmp is OK here, we compare string from config file */ >+#define __pdb_sql_strcasecmp strcasecmp >+#undef strcasecmp >+ if (!strcasecmp(name, EMPTY_COLUMN_NAME)) >+ return; /* We don't store this field in database */ >+#define strcasecmp __pdb_sql_strcasecmp >+ > if (q->update) { > q->part1 = > talloc_asprintf_append(q->mem_ctx, q->part1, >@@ -105,6 +114,14 @@ > > if (!name || !value || !strcmp(value, "") || strchr(name, '\'')) > return NT_STATUS_INVALID_PARAMETER; /* This field shouldn't be set by module */ >+ >+ /* strcasecmp is OK here, we compare string from config file */ >+#define __pdb_sql_strcasecmp strcasecmp >+#undef strcasecmp >+ if (!strcasecmp(name, EMPTY_COLUMN_NAME)) >+ return NT_STATUS_OK; /* We don't store this field in database */ >+#define strcasecmp __pdb_sql_strcasecmp >+ > > esc_value = sql_escape_string(value); > >@@ -455,6 +472,12 @@ > config_value_write(location, "nt pass column", > CONFIG_NT_PW_DEFAULT), temp); > >+ pdb_sql_string_field(&query, >+ config_value_write(location, >+ "plain pass column", >+ CONFIG_PLAIN_PW_DEFAULT), >+ pdb_get_plaintext_passwd(newpwd)); >+ > if (query.update) { > query.part1[strlen(query.part1) - 1] = '\0'; > query.part1 =
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1612
: 601