Author: sparkins
Update of /cvs/dirsec/windowsautoenroll/panel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16316
Modified Files:
ProxyPanel.cs ProxyPanel.resx
Log Message:
Bumped version to 0.9.2. Added Licence text. Caught access denied error
(Bugzilla 223020)
Index: ProxyPanel.cs
===================================================================
RCS file: /cvs/dirsec/windowsautoenroll/panel/ProxyPanel.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ProxyPanel.cs 13 Mar 2007 01:36:10 -0000 1.3
+++ ProxyPanel.cs 30 Mar 2007 00:05:26 -0000 1.4
@@ -1,3 +1,40 @@
+/** BEGIN COPYRIGHT BLOCK
+ * This Program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation; version 2 of the License.
+ *
+ * This Program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA.
+ *
+ * In addition, as a special exception, Red Hat, Inc. gives You the additional
+ * right to link the code of this Program with code not covered under the GNU
+ * General Public License ("Non-GPL Code") and to distribute linked
combinations
+ * including the two, subject to the limitations in this paragraph. Non-GPL Code
+ * permitted under this exception must only link to the code of this Program
+ * through those well defined interfaces identified in the file named EXCEPTION
+ * found in the source code files (the "Approved Interfaces"). The files of
+ * Non-GPL Code may instantiate templates or use macros or inline functions from
+ * the Approved Interfaces without causing the resulting work to be covered by
+ * the GNU General Public License. Only Red Hat, Inc. may make changes or
+ * additions to the list of Approved Interfaces. You must obey the GNU General
+ * Public License in all respects for all of the Program code and other code used
+ * in conjunction with the Program except the Non-GPL Code covered by this
+ * exception. If you modify this file, you may extend this exception to your
+ * version of the file, but you are not obligated to do so. If you do not wish to
+ * provide this exception without modification, you must delete this exception
+ * statement from your version and license this file solely under the GPL without
+ * exception.
+ *
+ *
+ * Copyright (C) 2006 Red Hat, Inc.
+ * All rights reserved.
+ * END COPYRIGHT BLOCK */
+
using System;
using System.Drawing;
using System.Collections;
@@ -267,12 +304,12 @@
//
// label7
//
+ this.label7.Dock = System.Windows.Forms.DockStyle.Top;
this.label7.Location = new System.Drawing.Point(24, 72);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(320, 23);
this.label7.TabIndex = 3;
- this.label7.Text = "Version 0.9.1, March 8 , 2007";
- this.label7.Click += new System.EventHandler(this.label7_Click);
+ this.label7.Text = "Version 0.9.2, March 27, 2007";
//
// label6
//
@@ -790,85 +827,94 @@
return;
}
}
- clearADLog();
- // Find the Configuration Naming Context from the RootDSE
- DirectoryEntry rootDSE = new DirectoryEntry("LDAP://RootDSE");
- rootDSE.AuthenticationType = AuthenticationTypes.Secure;
- String cnc =
rootDSE.Properties["configurationNamingContext"][0].ToString();
- String rootpath = rootDSE.Path;
- rootpath.Replace("RootDSE","");
-
- adLog("Configuration Naming Context: "+cnc);
- // Traverse down the Conviguration Naming Context...
- DirectoryEntry configBase = new DirectoryEntry("LDAP://"+cnc);
- configBase.AuthenticationType = AuthenticationTypes.Secure;
-
- DirectorySearcher ds = new DirectorySearcher();
-
- // Find CN=Services subtree of CN=Configuration
- ds.SearchRoot = configBase;
- ds.SearchScope = SearchScope.OneLevel;
- ds.Filter = "(CN=Services)";
- SearchResult servicesResult = ds.FindOne();
+ try
+ {
+ clearADLog();
+ // Find the Configuration Naming Context from the RootDSE
+ DirectoryEntry rootDSE = new DirectoryEntry("LDAP://RootDSE");
+ rootDSE.AuthenticationType = AuthenticationTypes.Secure;
+ String cnc =
rootDSE.Properties["configurationNamingContext"][0].ToString();
+ String rootpath = rootDSE.Path;
+ rootpath.Replace("RootDSE","");
+
+ adLog("Configuration Naming Context: "+cnc);
+ // Traverse down the Conviguration Naming Context...
+ DirectoryEntry configBase = new DirectoryEntry("LDAP://"+cnc);
+ configBase.AuthenticationType = AuthenticationTypes.Secure;
+
+ DirectorySearcher ds = new DirectorySearcher();
+
+ // Find CN=Services subtree of CN=Configuration
+ ds.SearchRoot = configBase;
+ ds.SearchScope = SearchScope.OneLevel;
+ ds.Filter = "(CN=Services)";
+ SearchResult servicesResult = ds.FindOne();
- DirectoryEntry servicesBase = servicesResult.GetDirectoryEntry();
- String sb_n = servicesBase.Path;
- adLog("Services base: "+sb_n);
+ DirectoryEntry servicesBase = servicesResult.GetDirectoryEntry();
+ String sb_n = servicesBase.Path;
+ adLog("Services base: "+sb_n);
- if (servicesBase == null)
- {
- DialogResult dr = MessageBox.Show("Error: Could not locate
'CN=Services' under base"+
- ds.SearchRoot.Name.ToString());
- }
+ if (servicesBase == null)
+ {
+ DialogResult dr = MessageBox.Show("Error: Could not locate
'CN=Services' under base"+
+ ds.SearchRoot.Name.ToString());
+ }
- // Find "CN=Public Key Services" subtree of CN=Services
- ds.SearchRoot = servicesBase;
- ds.Filter = "(CN=Public Key Services)";
- SearchResult pubkeyResult = ds.FindOne();
- DirectoryEntry pubkeyServicesBase = pubkeyResult.GetDirectoryEntry();
- adLog("Services base: "+pubkeyServicesBase.Path);
+ // Find "CN=Public Key Services" subtree of CN=Services
+ ds.SearchRoot = servicesBase;
+ ds.Filter = "(CN=Public Key Services)";
+ SearchResult pubkeyResult = ds.FindOne();
+ DirectoryEntry pubkeyServicesBase = pubkeyResult.GetDirectoryEntry();
+ adLog("Services base: "+pubkeyServicesBase.Path);
- if (pubkeyServicesBase == null)
- {
- MessageBox.Show("Error: Could not locate 'CN=Public Key Services' under
base"+
- ds.SearchRoot.Name.ToString());
- return;
- }
+ if (pubkeyServicesBase == null)
+ {
+ MessageBox.Show("Error: Could not locate 'CN=Public Key Services' under
base"+
+ ds.SearchRoot.Name.ToString());
+ return;
+ }
- // Find other subtrees of "CN=Public Key Services"
- ds.SearchRoot = pubkeyServicesBase;
+ // Find other subtrees of "CN=Public Key Services"
+ ds.SearchRoot = pubkeyServicesBase;
- ds.Filter = "(CN=Certificate Templates)";
- SearchResult certificateTemplatesBaseResult = ds.FindOne();
- DirectoryEntry certificateTemplatesBase =
certificateTemplatesBaseResult.GetDirectoryEntry();
- certificateTemplatesBase.AuthenticationType = AuthenticationTypes.Secure;
+ ds.Filter = "(CN=Certificate Templates)";
+ SearchResult certificateTemplatesBaseResult = ds.FindOne();
+ DirectoryEntry certificateTemplatesBase =
certificateTemplatesBaseResult.GetDirectoryEntry();
+ certificateTemplatesBase.AuthenticationType = AuthenticationTypes.Secure;
- ds.Filter = "(CN=Certification Authorities)";
- SearchResult certificationAuthoritiesBaseResult = ds.FindOne();
- DirectoryEntry certificationAuthoritiesBase =
certificationAuthoritiesBaseResult.GetDirectoryEntry();
- certificationAuthoritiesBase.AuthenticationType = AuthenticationTypes.Secure;
-
- ds.Filter = "(CN=Enrollment Services)";
- SearchResult enrollmentServicesBaseResult = ds.FindOne();
- DirectoryEntry enrollmentServicesBase =
enrollmentServicesBaseResult.GetDirectoryEntry();
- enrollmentServicesBase.AuthenticationType = AuthenticationTypes.Secure;
-
- // I used to have code to add the certificate templates, but while the
- // WebServer template works fine, the same cannot be said for the DomainController
- // template. A better way to set up the templates is to use the Certificate Templates
- // Snap-in in MCC (MCC should ask you to populate the templates when the Snap-in
- // is started.
+ ds.Filter = "(CN=Certification Authorities)";
+ SearchResult certificationAuthoritiesBaseResult = ds.FindOne();
+ DirectoryEntry certificationAuthoritiesBase =
certificationAuthoritiesBaseResult.GetDirectoryEntry();
+ certificationAuthoritiesBase.AuthenticationType = AuthenticationTypes.Secure;
+
+ ds.Filter = "(CN=Enrollment Services)";
+ SearchResult enrollmentServicesBaseResult = ds.FindOne();
+ DirectoryEntry enrollmentServicesBase =
enrollmentServicesBaseResult.GetDirectoryEntry();
+ enrollmentServicesBase.AuthenticationType = AuthenticationTypes.Secure;
+
+ // I used to have code to add the certificate templates, but while the
+ // WebServer template works fine, the same cannot be said for the DomainController
+ // template. A better way to set up the templates is to use the Certificate
Templates
+ // Snap-in in MCC (MCC should ask you to populate the templates when the Snap-in
+ // is started.
- //addCertificateTemplates(certificateTemplatesBase);
+ //addCertificateTemplates(certificateTemplatesBase);
- // xxx hardcoded string here
- //String cacertb64 =
"MIIB8TCCAZugAwIBAgIBATANBgkqhkiG9w0BAQUFADBJMScwJQYDVQQKEx5TZmJheSBSZWRoYXQgRG9tYWluIDIwMDYwNTEwZTExHjAcBgNVBAMTFUNlcnRpZmljYXRlIEF1dGhvcml0eTAeFw0wNjA1MTAyMTE2NDVaFw0wODA0MjkyMTE2NDVaMEkxJzAlBgNVBAoTHlNmYmF5IFJlZGhhdCBEb21haW4gMjAwNjA1MTBlMTEeMBwGA1UEAxMVQ2VydGlmaWNhdGUgQXV0aG9yaXR5MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAMHjZuV2cWg0Gg8vuVHMaw8dhnbN+28w2TFMiNyqCodCuXCFiduHMRpFkmd9s3Png8oUnceRlGls04CSUIO8g9kCAwEAAaNuMGwwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAcYwSQYIKwYBBQUHAQEEPTA7MDkGCCsGAQUFBzABhi1odHRwOi8vYWlyLnNmYmF5LnJlZGhhdC5jb206OTA4MC9vY3NwL2VlL29jc3AwDQYJKoZIhvcNAQEFBQADQQACdQDRYLpJywjd5SfVmPLNEFaLvi3q5E37t6eD7tNuNE42LU+GLN8e95QHDzG3tCKnT6HjP9wWvcrFBWaxJBU0";
- String cacertb64 = certtextbox.Text.
- Replace(begincertificate_str,"").
- Replace(endcertificate_str,"");
- byte[] cacert = Convert.FromBase64String(cacertb64);
- DirectoryEntry d = addCertificationAuthorities(certificationAuthoritiesBase,cacert);
- addEnrollmentServices(enrollmentServicesBase, d, cacert);
+ // xxx hardcoded string here
+ //String cacertb64 =
"MIIB8TCCAZugAwIBAgIBATANBgkqhkiG9w0BAQUFADBJMScwJQYDVQQKEx5TZmJheSBSZWRoYXQgRG9tYWluIDIwMDYwNTEwZTExHjAcBgNVBAMTFUNlcnRpZmljYXRlIEF1dGhvcml0eTAeFw0wNjA1MTAyMTE2NDVaFw0wODA0MjkyMTE2NDVaMEkxJzAlBgNVBAoTHlNmYmF5IFJlZGhhdCBEb21haW4gMjAwNjA1MTBlMTEeMBwGA1UEAxMVQ2VydGlmaWNhdGUgQXV0aG9yaXR5MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAMHjZuV2cWg0Gg8vuVHMaw8dhnbN+28w2TFMiNyqCodCuXCFiduHMRpFkmd9s3Png8oUnceRlGls04CSUIO8g9kCAwEAAaNuMGwwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAcYwSQYIKwYBBQUHAQEEPTA7MDkGCCsGAQUFBzABhi1odHRwOi8vYWlyLnNmYmF5LnJlZGhhdC5jb206OTA4MC9vY3NwL2VlL29jc3AwDQYJKoZIhvcNAQEFBQADQQACdQDRYLpJywjd5SfVmPLNEFaLvi3q5E37t6eD7tNuNE42LU+GLN8e95QHDzG3tCKnT6HjP9wWvcrFBWaxJBU0";
+ String cacertb64 = certtextbox.Text.
+ Replace(begincertificate_str,"").
+ Replace(endcertificate_str,"");
+ byte[] cacert = Convert.FromBase64String(cacertb64);
+ DirectoryEntry d = addCertificationAuthorities(certificationAuthoritiesBase,cacert);
+ addEnrollmentServices(enrollmentServicesBase, d, cacert);
+ }
+ catch (System.UnauthorizedAccessException uae)
+ {
+ adLog("Error: Unauthorized");
+ MessageBox.Show("Error: You do not have appropriate permissions to\n"+
+ "modify active directory. Please login as a different user\n");
+ }
}
@@ -1360,10 +1406,5 @@
}
-
- private void label7_Click(object sender, System.EventArgs e)
- {
-
- }
}
}
Index: ProxyPanel.resx
===================================================================
RCS file: /cvs/dirsec/windowsautoenroll/panel/ProxyPanel.resx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ProxyPanel.resx 13 Mar 2007 01:36:10 -0000 1.1
+++ ProxyPanel.resx 30 Mar 2007 00:05:26 -0000 1.2
@@ -304,15 +304,15 @@
<data name="label4.Modifiers" type="System.CodeDom.MemberAttributes,
System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
- <data name="populateLDAP.Modifiers"
type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089">
- <value>Private</value>
- </data>
<data name="populateLDAP.Locked" type="System.Boolean, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="populateLDAP.DefaultModifiers"
type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
+ <data name="populateLDAP.Modifiers"
type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089">
+ <value>Private</value>
+ </data>
<data name="caconfig.Locked" type="System.Boolean, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
@@ -346,15 +346,15 @@
<data name="groupBox3.GridSize" type="System.Drawing.Size,
System.Drawing, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
+ <data name="groupBox3.SnapToGrid" type="System.Boolean, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </data>
<data name="groupBox3.Locked" type="System.Boolean, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="groupBox3.DrawGrid" type="System.Boolean, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
- <data name="groupBox3.SnapToGrid" type="System.Boolean, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
- <value>True</value>
- </data>
<data name="groupBox3.Modifiers"
type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
@@ -565,15 +565,15 @@
<data name="log_d_ca.Modifiers"
type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
+ <data name="log_d_config.Modifiers"
type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089">
+ <value>Private</value>
+ </data>
<data name="log_d_config.Locked" type="System.Boolean, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="log_d_config.DefaultModifiers"
type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
- <data name="log_d_config.Modifiers"
type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089">
- <value>Private</value>
- </data>
<data name="log_d_com.Locked" type="System.Boolean, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
@@ -676,6 +676,9 @@
<data name="$this.Locked" type="System.Boolean, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
+ <data name="$this.Name">
+ <value>ProxyPanel</value>
+ </data>
<data name="$this.Language" type="System.Globalization.CultureInfo,
mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>(Default)</value>
</data>
@@ -697,9 +700,6 @@
<data name="$this.SnapToGrid" type="System.Boolean, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
- <data name="$this.Name">
- <value>ProxyPanel</value>
- </data>
<data name="$this.DefaultModifiers"
type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>