summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-08-28 22:17:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:34:53 -0500
commitd6cd54fb0a1c3ac51479d1fdcff91893c27ef9d7 (patch)
tree2d8964994e7b8c282c3e8ee87480bccdc8585c4a
parent8b15ef881d21b713817bb3aa3599288ecdde0d28 (diff)
downloadsamba-d6cd54fb0a1c3ac51479d1fdcff91893c27ef9d7.tar.gz
samba-d6cd54fb0a1c3ac51479d1fdcff91893c27ef9d7.tar.bz2
samba-d6cd54fb0a1c3ac51479d1fdcff91893c27ef9d7.zip
r9718: Work a bit on the SWAT interface
(This used to be commit b1844905d2c1ca26aef0ccba799ff16383348fc1)
-rw-r--r--source4/lib/ldb/ldb_map/ldb_map.c4
-rw-r--r--source4/lib/ldb/tests/samba3.ldif106
-rw-r--r--source4/lib/samba3/PLAN12
-rw-r--r--source4/lib/samba3/README3
-rw-r--r--source4/scripting/libjs/samba3.js8
-rw-r--r--swat/install/samba3.esp40
-rw-r--r--swat/menu.js3
7 files changed, 114 insertions, 62 deletions
diff --git a/source4/lib/ldb/ldb_map/ldb_map.c b/source4/lib/ldb/ldb_map/ldb_map.c
index 5ae4a435d8..1a8ea2afc4 100644
--- a/source4/lib/ldb/ldb_map/ldb_map.c
+++ b/source4/lib/ldb/ldb_map/ldb_map.c
@@ -136,8 +136,10 @@ static struct ldb_parse_tree *ldb_map_parse_tree(struct ldb_module *module, TALL
return attr->convert_operator(privdat, module, tree);
}
- if (map_type == MAP_IGNORE)
+ if (map_type == MAP_IGNORE) {
+ DEBUG(0, ("Search on ignored attribute '%s'!\n", tree->u.equality.attr));
return NULL;
+ }
if (map_type == MAP_GENERATE) {
DEBUG(0, ("Can't do conversion for MAP_GENERATE in map_parse_tree without convert_operator for '%s'\n", tree->u.equality.attr));
diff --git a/source4/lib/ldb/tests/samba3.ldif b/source4/lib/ldb/tests/samba3.ldif
index fb0a1386d4..02103b65b6 100644
--- a/source4/lib/ldb/tests/samba3.ldif
+++ b/source4/lib/ldb/tests/samba3.ldif
@@ -1,49 +1,4 @@
-dn: dc=idealx,dc=org
-objectClass: dcObject
-objectclass: organization
-o: idealx
-dc: idealx
-
-dn: ou=Users,dc=idealx,dc=org
-objectClass: organizationalUnit
-ou: Users
-
-dn: ou=Groups,dc=idealx,dc=org
-objectClass: organizationalUnit
-ou: Groups
-
-dn: ou=Computers,dc=idealx,dc=org
-objectClass: organizationalUnit
-ou: Computers
-dn: uid=Administrator,ou=Users,dc=idealx,dc=org
-cn: Administrator
-sn: Administrator
-objectClass: inetOrgPerson
-objectClass: sambaSAMAccount
-objectClass: posixAccount
-objectClass: shadowAccount
-gidNumber: 512
-uid: Administrator
-uidNumber: 0
-homeDirectory: /home/%U
-sambaPwdLastSet: 0
-sambaLogonTime: 0
-sambaLogoffTime: 2147483647
-sambaKickoffTime: 2147483647
-sambaPwdCanChange: 0
-sambaPwdMustChange: 2147483647
-sambaHomePath: \\PDC-SMB3\home\%U
-sambaHomeDrive: H:
-sambaProfilePath: \\PDC-SMB3\profiles\%U\Administrator
-sambaPrimaryGroupSID: S-1-5-21-4231626423-2410014848-2360679739-512
-sambaLMPassword: XXX
-sambaNTPassword: XXX
-sambaAcctFlags: [U ]
-sambaSID: S-1-5-21-4231626423-2410014848-2360679739-2996
-loginShell: /bin/false
-gecos: Netbios Domain Administrator
-
-dn: uid=nobody,ou=Users,dc=idealx,dc=org
+dn: uid=nobody,ou=Users,dc=test,dc=vernstok,dc=nl
cn: nobody
sn: nobody
objectClass: inetOrgPerson
@@ -70,7 +25,7 @@ sambaAcctFlags: [NU ]
sambaSID: S-1-5-21-4231626423-2410014848-2360679739-2998
loginShell: /bin/false
-dn: cn=Domain Admins,ou=Groups,dc=idealx,dc=org
+dn: cn=Domain Admins,ou=Groups,dc=test,dc=vernstok,dc=nl
objectClass: posixGroup
objectClass: sambaGroupMapping
gidNumber: 512
@@ -81,7 +36,7 @@ sambaSID: S-1-5-21-4231626423-2410014848-2360679739-512
sambaGroupType: 2
displayName: Domain Admins
-dn: cn=Domain Users,ou=Groups,dc=idealx,dc=org
+dn: cn=Domain Users,ou=Groups,dc=test,dc=vernstok,dc=nl
objectClass: posixGroup
objectClass: sambaGroupMapping
gidNumber: 513
@@ -91,7 +46,7 @@ sambaSID: S-1-5-21-4231626423-2410014848-2360679739-513
sambaGroupType: 2
displayName: Domain Users
-dn: cn=Domain Guests,ou=Groups,dc=idealx,dc=org
+dn: cn=Domain Guests,ou=Groups,dc=test,dc=vernstok,dc=nl
objectClass: posixGroup
objectClass: sambaGroupMapping
gidNumber: 514
@@ -101,7 +56,7 @@ sambaSID: S-1-5-21-4231626423-2410014848-2360679739-514
sambaGroupType: 2
displayName: Domain Guests
-dn: cn=Print Operators,ou=Groups,dc=idealx,dc=org
+dn: cn=Print Operators,ou=Groups,dc=test,dc=vernstok,dc=nl
objectClass: posixGroup
objectClass: sambaGroupMapping
gidNumber: 550
@@ -111,7 +66,7 @@ sambaSID: S-1-5-21-4231626423-2410014848-2360679739-550
sambaGroupType: 2
displayName: Print Operators
-dn: cn=Backup Operators,ou=Groups,dc=idealx,dc=org
+dn: cn=Backup Operators,ou=Groups,dc=test,dc=vernstok,dc=nl
objectClass: posixGroup
objectClass: sambaGroupMapping
gidNumber: 551
@@ -121,7 +76,7 @@ sambaSID: S-1-5-21-4231626423-2410014848-2360679739-551
sambaGroupType: 2
displayName: Backup Operators
-dn: cn=Replicator,ou=Groups,dc=idealx,dc=org
+dn: cn=Replicator,ou=Groups,dc=test,dc=vernstok,dc=nl
objectClass: posixGroup
objectClass: sambaGroupMapping
gidNumber: 552
@@ -131,7 +86,7 @@ sambaSID: S-1-5-21-4231626423-2410014848-2360679739-552
sambaGroupType: 2
displayName: Replicator
-dn: cn=Domain Computers,ou=Groups,dc=idealx,dc=org
+dn: cn=Domain Computers,ou=Groups,dc=test,dc=vernstok,dc=nl
objectClass: posixGroup
objectClass: sambaGroupMapping
gidNumber: 553
@@ -141,7 +96,7 @@ sambaSID: S-1-5-21-4231626423-2410014848-2360679739-553
sambaGroupType: 2
displayName: Domain Computers
-dn: cn=Administrators,ou=Groups,dc=idealx,dc=org
+dn: cn=Administrators,ou=Groups,dc=test,dc=vernstok,dc=nl
objectClass: posixGroup
objectClass: sambaGroupMapping
gidNumber: 544
@@ -151,7 +106,7 @@ sambaSID: S-1-5-21-4231626423-2410014848-2360679739-544
sambaGroupType: 2
displayName: Administrators
-dn: cn=Users,ou=Groups,dc=idealx,dc=org
+dn: cn=Users,ou=Groups,dc=test,dc=vernstok,dc=nl
objectClass: posixGroup
objectClass: sambaGroupMapping
gidNumber: 545
@@ -161,7 +116,7 @@ sambaSID: S-1-5-21-4231626423-2410014848-2360679739-545
sambaGroupType: 2
displayName: users
-dn: cn=Guests,ou=Groups,dc=idealx,dc=org
+dn: cn=Guests,ou=Groups,dc=test,dc=vernstok,dc=nl
objectClass: posixGroup
objectClass: sambaGroupMapping
gidNumber: 546
@@ -172,7 +127,7 @@ sambaSID: S-1-5-21-4231626423-2410014848-2360679739-546
sambaGroupType: 2
displayName: Guests
-dn: cn=Power Users,ou=Groups,dc=idealx,dc=org
+dn: cn=Power Users,ou=Groups,dc=test,dc=vernstok,dc=nl
objectClass: posixGroup
objectClass: sambaGroupMapping
gidNumber: 547
@@ -182,7 +137,7 @@ sambaSID: S-1-5-21-4231626423-2410014848-2360679739-547
sambaGroupType: 2
displayName: Power Users
-dn: cn=Account Operators,ou=Groups,dc=idealx,dc=org
+dn: cn=Account Operators,ou=Groups,dc=test,dc=vernstok,dc=nl
objectClass: posixGroup
objectClass: sambaGroupMapping
gidNumber: 548
@@ -192,7 +147,7 @@ sambaSID: S-1-5-21-4231626423-2410014848-2360679739-548
sambaGroupType: 2
displayName: Account Operators
-dn: cn=Server Operators,ou=Groups,dc=idealx,dc=org
+dn: cn=Server Operators,ou=Groups,dc=test,dc=vernstok,dc=nl
objectClass: posixGroup
objectClass: sambaGroupMapping
gidNumber: 549
@@ -201,3 +156,36 @@ description: Netbios Domain Server Operators
sambaSID: S-1-5-21-4231626423-2410014848-2360679739-549
sambaGroupType: 2
displayName: Server Operators
+
+dn: ou=Computers,dc=test,dc=vernstok,dc=nl
+objectClass: organizationalUnit
+ou: Computers
+dn: uid=Administrator,ou=Users,dc=test,dc=vernstok,dc=nl
+cn: Administrator
+sn: Administrator
+objectClass: inetOrgPerson
+objectClass: sambaSAMAccount
+objectClass: posixAccount
+objectClass: shadowAccount
+gidNumber: 512
+uid: Administrator
+uidNumber: 0
+homeDirectory: /home/%U
+sambaPwdLastSet: 0
+sambaLogonTime: 0
+sambaLogoffTime: 2147483647
+sambaKickoffTime: 2147483647
+sambaPwdCanChange: 0
+sambaPwdMustChange: 2147483647
+sambaHomePath: \\PDC-SMB3\home\%U
+sambaHomeDrive: H:
+sambaProfilePath: \\PDC-SMB3\profiles\%U\Administrator
+sambaPrimaryGroupSID: S-1-5-21-4231626423-2410014848-2360679739-512
+sambaLMPassword: XXX
+sambaNTPassword: XXX
+sambaAcctFlags: [U ]
+sambaSID: S-1-5-21-4231626423-2410014848-2360679739-2996
+loginShell: /bin/false
+gecos: Netbios Domain Administrator
+
+
diff --git a/source4/lib/samba3/PLAN b/source4/lib/samba3/PLAN
index 26bf54634c..8bc90da427 100644
--- a/source4/lib/samba3/PLAN
+++ b/source4/lib/samba3/PLAN
@@ -1,6 +1,6 @@
Three possible viable approaches:
1) TDB conversion approach. Read in TDB dump out LDIF (one-way)
- - samr.ldb: from tdbsam/smbpasswd, account_policy.tdb, secrets.tdb, group_mapping.tdb, privilege.tdb
+ - samr.ldb: from tdbsam/smbpasswd, account_policy.tdb, secrets.tdb, group_mapping.tdb
- registry.ldb: from registry.tdb
- wins.ldif: from wins.tdb/wins.dat
- smb.conf/ea's: generated from the old smb.conf + share_info.tdb
@@ -29,3 +29,13 @@ Three possible viable approaches:
- convert smb.conf (using Jerry's registry hack)
(going with a combination of 1 and 2)
+
+ldb mapping backend:
+ - do search in new and old (mapped) backend and merge results?
+
+Upgrade process:
+ - take libdir & smb.conf
+ - read various tdb files / old smb.conf
+ - write new smb.conf (ejs?)
+ - list of parameters to keep.. generate some of the others
+ - add generated LDIF (ejs?)
diff --git a/source4/lib/samba3/README b/source4/lib/samba3/README
index 3f6553f7e8..83520f673d 100644
--- a/source4/lib/samba3/README
+++ b/source4/lib/samba3/README
@@ -3,3 +3,6 @@ Samba3 import, migration and compatibility.
For example, the first file in this directory (smbpasswd.c) handles
portions of the smbpasswd file format.
+
+The other files in this directory support reading the various
+TDB databases from Samba3.
diff --git a/source4/scripting/libjs/samba3.js b/source4/scripting/libjs/samba3.js
new file mode 100644
index 0000000000..7f50c8c4b2
--- /dev/null
+++ b/source4/scripting/libjs/samba3.js
@@ -0,0 +1,8 @@
+/*
+ backend code for upgrading from Samba3
+ Copyright Jelmer Vernooij 2005
+ Released under the GNU GPL v2 or later
+*/
+
+
+return 0;
diff --git a/swat/install/samba3.esp b/swat/install/samba3.esp
new file mode 100644
index 0000000000..ead694a107
--- /dev/null
+++ b/swat/install/samba3.esp
@@ -0,0 +1,40 @@
+<% page_header("columns", "Upgrade", "install");
+
+ include("/scripting/forms.js");
+ libinclude("base.js");
+ libinclude("provision.js");
+ libinclude("samba3.js");
+%>
+
+<h1>Import from Samba3</h1>
+
+<%
+var f = FormObj("Import from Samba3", 0, 2);
+var i;
+
+f.add("SMBCONF", "smb.conf file");
+f.add("LIBDIR", "Lib directory");
+f.submit[0] = "Import";
+f.submit[1] = "Cancel";
+
+if (form['submit'] == "Cancel") {
+ redirect("/");
+}
+
+if (form['submit'] == "Import") {
+ for (r in form) {
+ subobj[r] = form[r];
+ }
+}
+
+f.element[0].value = "/etc/samba/smb.conf";
+f.element[1].value = "/var/lib/samba";
+
+if (form['submit'] == "import") {
+ // provision(subobj, writefln, false);
+} else {
+ f.display();
+}
+%>
+
+<% page_footer(); %>
diff --git a/swat/menu.js b/swat/menu.js
index 83529825f1..e28160e16f 100644
--- a/swat/menu.js
+++ b/swat/menu.js
@@ -39,7 +39,8 @@ swat_menus.esptest = simple_menu(
swat_menus.install = simple_menu(
"Installation",
"Provisioning", session_uri("/install/provision.esp"),
- "New User", session_uri("/install/newuser.esp"));
+ "New User", session_uri("/install/newuser.esp"),
+ "Import from Samba3", session_uri("/install/samba3.esp"));
swat_menus.nbt_server = simple_menu(