schema/spacewalk
by Jeff Ortel
schema/spacewalk/spacewalk-schema.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 6a4d1596f0a9959f2171b3cc20cd18d6f8e88df4
Author: Jeff Ortel <jortel(a)redhat.com>
Date: Tue Jul 28 12:06:05 2009 -0500
Fix rhnVersionInfo information
diff --git a/schema/spacewalk/spacewalk-schema.spec b/schema/spacewalk/spacewalk-schema.spec
index fb01cbe..16c5c4e 100644
--- a/schema/spacewalk/spacewalk-schema.spec
+++ b/schema/spacewalk/spacewalk-schema.spec
@@ -29,7 +29,7 @@ Oracle tablespace name conversions have NOT been applied.
%setup -q
%build
-make -f Makefile.schema
+make -f Makefile.schema SCHEMA=%{name} VERSION=%{version} RELEASE=%{release}
pod2man spacewalk-schema-upgrade spacewalk-schema-upgrade.1
%install
14 years, 10 months
3 commits - schema/spacewalk spacewalk/admin spacewalk/setup
by Devan Goodwin
schema/spacewalk/common/views/rhnServerOutdatedPackages.sql | 2 -
schema/spacewalk/oracle/class/evr_t.sql | 18 +++++++++
schema/spacewalk/oracle/procs/sequence_currval.sql | 9 ++++
schema/spacewalk/oracle/procs/sequence_nextval.sql | 9 ++++
spacewalk/admin/rhn-populate-database.pl | 22 +++++++++---
spacewalk/setup/bin/spacewalk-setup | 3 +
6 files changed, 57 insertions(+), 6 deletions(-)
New commits:
commit 6cc47feece98666fbc200f8325586322e67feef1
Author: Devan Goodwin <dgoodwin(a)redhat.com>
Date: Tue Jul 28 12:29:15 2009 -0300
Fix Oracle db population logging.
diff --git a/spacewalk/admin/rhn-populate-database.pl b/spacewalk/admin/rhn-populate-database.pl
index 99de148..1b9fb18 100755
--- a/spacewalk/admin/rhn-populate-database.pl
+++ b/spacewalk/admin/rhn-populate-database.pl
@@ -106,7 +106,11 @@ if ($clear_db) {
RHN::SatInstall->clear_db();
}
+# Only used for PostgreSQL:
my $populate_cmd = "";
+# Only used for Oracle:
+my $dsn = sprintf('%s/%s@%s', $user, $password, $database);
+
if ($postgresql) {
print "*** Installing PostgreSQL schema.\n";
chdir("/usr/share/spacewalk/schema/postgresql/");
@@ -114,7 +118,6 @@ if ($postgresql) {
}
else {
print "*** Installing Oracle schema.\n";
- my $dsn = sprintf('%s/%s@%s', $user, $password, $database);
$populate_cmd = "sqlplus $dsn \@$schema_deploy_file";
chdir;
}
@@ -125,9 +128,20 @@ if (defined $log_file) {
if (Spacewalk::Setup::have_selinux()) {
system('/sbin/restorecon', $log_file) == 0 or die "Error running restorecon on $log_file.";
}
- $pid = open3(gensym, ">&LOGFILE", ">&LOGFILE", $populate_cmd);
-} else {
- $pid = open3(gensym, ">&STDOUT", ">&STDERR", $populate_cmd);
+ if ($postgresql) {
+ $pid = open3(gensym, ">&LOGFILE", ">&LOGFILE", $populate_cmd);
+ }
+ else {
+ $pid = open3(gensym, ">&LOGFILE", ">&LOGFILE", 'sqlplus', $dsn, "\@$schema_deploy_file");
+ }
+}
+else {
+ if ($postgresql) {
+ $pid = open3(gensym, ">&STDOUT", ">&STDERR", $populate_cmd);
+ }
+ else {
+ $pid = open3(gensym, ">&STDOUT", ">&STDERR", 'sqlplus', $dsn, "\@$schema_deploy_file");
+ }
}
waitpid($pid, 0);
commit 83e890f2f148b1aba30f33deb41f9b4b3128c6f7
Author: Devan Goodwin <dgoodwin(a)redhat.com>
Date: Tue Jul 28 11:41:41 2009 -0300
Revert "Resolve differences between databases created master and pgsql sources."
This reverts commit 3410acac4756bea244993a25095376bd922a789b.
These functions were added for Oracle so our code could be compatible
with PostgreSQL as well.
diff --git a/schema/spacewalk/common/views/rhnServerOutdatedPackages.sql b/schema/spacewalk/common/views/rhnServerOutdatedPackages.sql
index a68f3ce..95e4e16 100644
--- a/schema/spacewalk/common/views/rhnServerOutdatedPackages.sql
+++ b/schema/spacewalk/common/views/rhnServerOutdatedPackages.sql
@@ -27,7 +27,7 @@ AS
SELECT DISTINCT SNPC.server_id,
P.name_id,
P.evr_id,
- PN.name || '-' || PE.evr.as_vre_simple(),
+ PN.name || '-' || evr_t_as_vre_simple( PE.evr ),
E.id,
E.advisory
FROM rhnPackageName PN,
diff --git a/schema/spacewalk/oracle/class/evr_t.sql b/schema/spacewalk/oracle/class/evr_t.sql
index 0d03097..ddc06c3 100644
--- a/schema/spacewalk/oracle/class/evr_t.sql
+++ b/schema/spacewalk/oracle/class/evr_t.sql
@@ -61,3 +61,21 @@ end;
/
show errors
+create or replace function evr_t_as_vre( a evr_t )
+ return varchar2
+is
+begin
+ return a.as_vre;
+end;
+/
+show errors
+
+create or replace function evr_t_as_vre_simple( a evr_t )
+ return VARCHAR2
+is
+begin
+ return a.as_vre_simple;
+end;
+/
+show errors
+
diff --git a/schema/spacewalk/oracle/procs/sequence_currval.sql b/schema/spacewalk/oracle/procs/sequence_currval.sql
new file mode 100644
index 0000000..891e74f
--- /dev/null
+++ b/schema/spacewalk/oracle/procs/sequence_currval.sql
@@ -0,0 +1,9 @@
+create or replace function sequence_currval( seq_name varchar2 ) return number as
+ ret number;
+begin
+ execute immediate 'select '|| seq_name || '.currval from dual'
+ into ret;
+ return ret;
+end;
+/
+
diff --git a/schema/spacewalk/oracle/procs/sequence_nextval.sql b/schema/spacewalk/oracle/procs/sequence_nextval.sql
new file mode 100644
index 0000000..c93e152
--- /dev/null
+++ b/schema/spacewalk/oracle/procs/sequence_nextval.sql
@@ -0,0 +1,9 @@
+create or replace function sequence_nextval( seq_name varchar2 ) return number as
+ ret number;
+begin
+ execute immediate 'select '|| seq_name || '.nextval from dual'
+ into ret;
+ return ret;
+end;
+/
+
commit e3e983d2d864b23f89e4fc4fe2622cb879e87314
Author: Devan Goodwin <dgoodwin(a)redhat.com>
Date: Tue Jul 28 11:41:14 2009 -0300
Fix spacewalk-setup pgsql changes lost during merges.
diff --git a/spacewalk/setup/bin/spacewalk-setup b/spacewalk/setup/bin/spacewalk-setup
index 8beb96b..09659f9 100755
--- a/spacewalk/setup/bin/spacewalk-setup
+++ b/spacewalk/setup/bin/spacewalk-setup
@@ -979,6 +979,7 @@ sub populate_initial_configs {
osadispatcherDOTosa_ssl_cert => '/var/www/html/pub/RHN-ORG-TRUSTED-SSL-CERT',
encrypted_passwords => 1,
default_db => sprintf('%s/%s@%s', @{$answers}{qw/db-user db-password db-sid/}),
+ db_backend => $answers->{'db-backend'},
db_user => $answers->{'db-user'},
db_password => $answers->{'db-password'},
db_sid => $answers->{'db-sid'},
@@ -989,7 +990,7 @@ sub populate_initial_configs {
jabberDOTlibdir => $jabberdLibDir,
jabberDOTpassword => 'rhn-dispatcher-' . random_password(6),
serverDOTsatelliteDOTca_chain => '/usr/share/rhn/RHNS-CA-CERT',
- serverDOTnls_lang => 'english.' . $nls_database_paramaters{NLS_CHARACTERSET},
+ serverDOTnls_lang => 'english.' . $charset,
server_secret_key => generate_secret(),
webDOTssl_available => $opts->{'skip-ssl-cert-generation'} ? 0 : 1,
monitoringDOTdbname => $answers->{'db-sid'},
14 years, 10 months
java/code web/conf
by Pradeep Kilambi
java/code/src/com/redhat/rhn/domain/channel/Channel.java | 10 +
java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java | 66 +++++++++-
java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/test/ChannelSoftwareHandlerTest.java | 19 ++
web/conf/rhn_web.conf | 2
4 files changed, 94 insertions(+), 3 deletions(-)
New commits:
commit fcc54a505d9cea73147598e638c7461c8b0e58d0
Author: Pradeep Kilambi <pkilambi(a)redhat.com>
Date: Mon Jul 27 17:18:09 2009 -0400
Adding a new create channel api using checksumtype as a params.
- The old create method calls the new one with default as sha1.
- Updated the api version
- Added unit tests for new call
diff --git a/java/code/src/com/redhat/rhn/domain/channel/Channel.java b/java/code/src/com/redhat/rhn/domain/channel/Channel.java
index 9a40950..a9a317d 100644
--- a/java/code/src/com/redhat/rhn/domain/channel/Channel.java
+++ b/java/code/src/com/redhat/rhn/domain/channel/Channel.java
@@ -837,8 +837,16 @@ public class Channel extends BaseDomainHelper implements Comparable {
}
// IF its custom use the one set at channel creation time
+
if (toConsider.isCustom()) {
- return toConsider.getChecksum().getLabel();
+ String checksumOut = toConsider.getChecksum().getLabel();
+ if (checksumOut != null) {
+ return checksumOut;
+ }
+ else {
+ // default to sha1 if its not available in the db
+ return CHECKSUM_SHA_1;
+ }
}
// default to sha256
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
index 6acf771..318cca3 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
@@ -524,7 +524,9 @@ public class ChannelSoftwareHandler extends BaseHandler {
* @param summary Channel Summary
* @param archLabel Architecture label
* @param parentlabel Parent Channel label (may be null)
+ * @param checksumtype checksum type for this channel
* @return 1 if creation of channel succeeds.
+ * @since 10.9
* @throws PermissionCheckFailureException thrown if user does not have
* permission to create the channel.
* @throws InvalidChannelNameException thrown if given name is in use or
@@ -559,10 +561,18 @@ public class ChannelSoftwareHandler extends BaseHandler {
* #options_end()
* @xmlrpc.param #param_desc("string", "parentLabel", "label of the parent of this
* channel, an empty string if it does not have one")
+ * @xmlrpc.param #param_desc("string", "checksumtype", "checksum type for this channel,
+ * used for yum repository metadata generation")
+ * #options()
+ * #item_desc ("sha1", "Offers widest compatibility with clients")
+ * #item_desc ("sha256", "Offers highest security, but is compatible
+ * only with newer clients: Fedora 11 and newer,
+ * or Enterprise Linux 6 and newer.")
+ * #options_end()
* @xmlrpc.returntype int - 1 if the creation operation succeeded, 0 otherwise
*/
public int create(String sessionKey, String label, String name,
- String summary, String archLabel, String parentlabel)
+ String summary, String archLabel, String parentlabel, String checksumtype)
throws PermissionCheckFailureException, InvalidChannelLabelException,
InvalidChannelNameException, InvalidParentChannelException {
@@ -577,11 +587,65 @@ public class ChannelSoftwareHandler extends BaseHandler {
ccc.setSummary(summary);
ccc.setParentLabel(parentlabel);
ccc.setUser(user);
+ ccc.setChecksum(checksumtype);
return (ccc.create() != null) ? 1 : 0;
}
/**
+ * Creates a software channel, parent_channel_label can be empty string
+ * @param sessionKey WebSession containing User information.
+ * @param label Channel label to be created
+ * @param name Name of Channel
+ * @param summary Channel Summary
+ * @param archLabel Architecture label
+ * @param parentlabel Parent Channel label (may be null)
+ * @return 1 if creation of channel succeeds.
+ * @throws PermissionCheckFailureException thrown if user does not have
+ * permission to create the channel.
+ * @throws InvalidChannelNameException thrown if given name is in use or
+ * otherwise, invalid.
+ * @throws InvalidChannelLabelException throw if given label is in use or
+ * otherwise, invalid.
+ * @throws InvalidParentChannelException thrown if parent label is for a
+ * channel that is not a base channel.
+ *
+ * @xmlrpc.doc Creates a software channel
+ * @xmlrpc.param #session_key()
+ * @xmlrpc.param #param_desc("string", "label", "label of the new channel")
+ * @xmlrpc.param #param_desc("string", "name", "name of the new channel")
+ * @xmlrpc.param #param_desc("string", "summary" "summary of the channel")
+ * @xmlrpc.param #param_desc("string", "archLabel",
+ * "the label of the architecture the channel corresponds to")
+ * #options()
+ * #item_desc ("channel-ia32", "For 32 bit channel architecture")
+ * #item_desc ("channel-ia64", "For 64 bit channel architecture")
+ * #item_desc ("channel-sparc", "For Sparc channel architecture")
+ * #item_desc ("channel-alpha", "For Alpha channel architecture")
+ * #item_desc ("channel-s390", "For s390 channel architecture")
+ * #item_desc ("channel-s390x", "For s390x channel architecture")
+ * #item_desc ("channel-iSeries", "For i-Series channel architecture")
+ * #item_desc ("channel-pSeries", "For p-Series channel architecture")
+ * #item_desc ("channel-x86_64", "For x86_64 channel architecture")
+ * #item_desc ("channel-ppc", "For PPC channel architecture")
+ * #item_desc ("channel-sparc-sun-solaris",
+ * "For Sparc Solaris channel architecture")
+ * #item_desc ("channel-i386-sun-solaris",
+ * "For i386 Solaris channel architecture")
+ * #options_end()
+ * @xmlrpc.param #param_desc("string", "parentLabel", "label of the parent of this
+ * channel, an empty string if it does not have one")
+ * @xmlrpc.returntype int - 1 if the creation operation succeeded, 0 otherwise
+ */
+ public int create(String sessionKey, String label, String name,
+ String summary, String archLabel, String parentlabel)
+ throws PermissionCheckFailureException, InvalidChannelLabelException,
+ InvalidChannelNameException, InvalidParentChannelException {
+
+ return create(sessionKey, label, name, summary, archLabel, parentlabel, "sha1");
+ }
+
+ /**
* Set the contact/support information for given channel.
* @param sessionKey The sessionKey containing the logged in user
* @param channelLabel The label for the channel to change
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/test/ChannelSoftwareHandlerTest.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/test/ChannelSoftwareHandlerTest.java
index b08e648..fc2e77a 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/test/ChannelSoftwareHandlerTest.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/test/ChannelSoftwareHandlerTest.java
@@ -511,6 +511,25 @@ public class ChannelSoftwareHandlerTest extends BaseHandlerTestCase {
assertNotNull(ca);
assertNotNull(c.getChannelArch());
assertEquals(ca.getLabel(), c.getChannelArch().getLabel());
+ assertEquals(c.getChecksumType(), "sha1");
+ }
+
+ public void testCreateWithChecksum() throws Exception {
+ ChannelSoftwareHandler csh = new ChannelSoftwareHandler();
+ addRole(admin, RoleFactory.CHANNEL_ADMIN);
+ int i = csh.create(adminKey, "api-test-checksum-chan-label",
+ "apiTestCSChanName", "apiTestSummary", "channel-ia32", null, "sha-256");
+ assertEquals(1, i);
+ Channel c = ChannelFactory.lookupByLabel(admin.getOrg(),
+ "api-test-checksum-chan-label");
+ assertNotNull(c);
+ assertEquals("apiTestCSChanName", c.getName());
+ assertEquals("apiTestSummary", c.getSummary());
+ ChannelArch ca = ChannelFactory.findArchByLabel("channel-ia32");
+ assertNotNull(ca);
+ assertNotNull(c.getChannelArch());
+ assertEquals(ca.getLabel(), c.getChannelArch().getLabel());
+ assertEquals(c.getChecksumType(), "sha-256");
}
public void testCreateUnauthUser() {
diff --git a/web/conf/rhn_web.conf b/web/conf/rhn_web.conf
index c489994..e2bfde3 100644
--- a/web/conf/rhn_web.conf
+++ b/web/conf/rhn_web.conf
@@ -236,7 +236,7 @@ web.config_delim_end = |}
web.version = 0.5
# the version of API
-web.apiversion = 10.8
+web.apiversion = 10.9
# maximum size for a config file
web.maximum_config_file_size = 131072
14 years, 10 months
Branch 'VADER' - java/code
by Brad Buckingham
java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml | 4 +
java/code/src/com/redhat/rhn/frontend/xmlrpc/PamAuthNotConfiguredException.java | 33 ++++++++++
java/code/src/com/redhat/rhn/frontend/xmlrpc/org/OrgHandler.java | 26 +++++++
3 files changed, 61 insertions(+), 2 deletions(-)
New commits:
commit 4fe3dd55649711cf85517bf0acdf11a51b9ca7a4
Author: Brad Buckingham <bbuckingham(a)redhat.com>
Date: Mon Jul 27 16:36:58 2009 -0400
513786 - api - org.create - update api to support pam authentication
The org.create API has an argument for to allow the admin to be set up
to use PAM authentication; however, the flag is not currently used. This
commit is to enable that flag to be used.
diff --git a/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml b/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
index a8952f6..ebbf169 100644
--- a/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
+++ b/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
@@ -7640,6 +7640,10 @@ Follow this url to see the full list of inactive systems:
<source>Invalid action type</source>
</trans-unit>
+ <trans-unit id="api.org.pamAuthNotConfigured">
+ <source>The server is not configured to support PAM authentication. Refer to the reference guide for instructions on how to set up PAM.</source>
+ </trans-unit>
+
<trans-unit id="api.org.migrationtosameorg">
<source>User cannot migrate a system where the origination and destination organizations are the same. Org Id: {0}, System Id: {1}.</source>
</trans-unit>
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/PamAuthNotConfiguredException.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/PamAuthNotConfiguredException.java
new file mode 100644
index 0000000..6ce32ca
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/PamAuthNotConfiguredException.java
@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2009 Red Hat, Inc.
+ *
+ * This software is licensed to you under the GNU General Public License,
+ * version 2 (GPLv2). There is NO WARRANTY for this software, express or
+ * implied, including the implied warranties of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
+ * along with this software; if not, see
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *
+ * Red Hat trademarks are not licensed under GPLv2. No permission is
+ * granted to use or replicate Red Hat trademarks that are incorporated
+ * in this software or its documentation.
+ */
+package com.redhat.rhn.frontend.xmlrpc;
+
+import com.redhat.rhn.FaultException;
+
+/**
+ * PamAuthNotConfiguredException
+ * @version $Rev$
+ */
+public class PamAuthNotConfiguredException extends FaultException {
+
+ /**
+ * Constructor for exception when management server is not configured
+ * for PAM authentication.
+ */
+ public PamAuthNotConfiguredException() {
+ super(1231, "pamAuthNotConfiged", "api.org.pamAuthNotConfigured",
+ new Object[] {});
+ }
+}
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/org/OrgHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/org/OrgHandler.java
index aefc7a6..1e5ed11 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/org/OrgHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/org/OrgHandler.java
@@ -15,6 +15,8 @@
package com.redhat.rhn.frontend.xmlrpc.org;
import com.redhat.rhn.FaultException;
+import com.redhat.rhn.common.conf.Config;
+import com.redhat.rhn.common.conf.ConfigDefaults;
import com.redhat.rhn.common.db.datasource.DataList;
import com.redhat.rhn.common.hibernate.LookupException;
import com.redhat.rhn.common.validator.ValidatorError;
@@ -43,6 +45,7 @@ import com.redhat.rhn.frontend.xmlrpc.NoSuchEntitlementException;
import com.redhat.rhn.frontend.xmlrpc.NoSuchOrgException;
import com.redhat.rhn.frontend.xmlrpc.NoSuchSystemException;
import com.redhat.rhn.frontend.xmlrpc.OrgNotInTrustException;
+import com.redhat.rhn.frontend.xmlrpc.PamAuthNotConfiguredException;
import com.redhat.rhn.frontend.xmlrpc.PermissionCheckFailureException;
import com.redhat.rhn.frontend.xmlrpc.SatelliteOrgException;
import com.redhat.rhn.frontend.xmlrpc.ValidationException;
@@ -54,6 +57,7 @@ import com.redhat.rhn.manager.org.OrgManager;
import com.redhat.rhn.manager.org.UpdateOrgSoftwareEntitlementsCommand;
import com.redhat.rhn.manager.org.UpdateOrgSystemEntitlementsCommand;
+import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import java.util.HashMap;
@@ -116,7 +120,8 @@ public class OrgHandler extends BaseHandler {
log.debug("OrgHandler.create");
getSatAdmin(sessionKey);
- validateCreateOrgData(orgName, adminPassword, firstName, lastName, email);
+ validateCreateOrgData(orgName, adminPassword, firstName, lastName, email,
+ usePamAuth);
CreateOrgCommand cmd = new CreateOrgCommand(orgName, adminLogin, adminPassword,
email);
@@ -124,6 +129,18 @@ public class OrgHandler extends BaseHandler {
cmd.setLastName(lastName);
cmd.setPrefix(prefix);
+ String pamAuthService = Config.get().getString(ConfigDefaults.WEB_PAM_AUTH_SERVICE);
+ if (usePamAuth) {
+ if (pamAuthService != null && pamAuthService.trim().length() > 0) {
+ cmd.setUsePam(usePamAuth);
+ }
+ else {
+ // The user wants to use pam authentication, but the server has not been
+ // configured to use pam... Throw an error...
+ throw new PamAuthNotConfiguredException();
+ }
+ }
+
ValidatorError[] verrors = cmd.store();
if (verrors != null) {
throw new ValidationException(verrors[0].getMessage());
@@ -133,7 +150,7 @@ public class OrgHandler extends BaseHandler {
}
private void validateCreateOrgData(String orgName, String password, String firstName,
- String lastName, String email) {
+ String lastName, String email, Boolean usePamAuth) {
Map<String, String> values = new HashMap<String, String>();
values.put("orgName", orgName);
@@ -155,6 +172,11 @@ public class OrgHandler extends BaseHandler {
ValidatorError e = result.getErrors().get(0);
throw new ValidationException(e.getMessage());
}
+
+ if (!usePamAuth && StringUtils.isEmpty(password)) {
+ throw new FaultException(-501, "passwordRequiredOrUsePam",
+ "Password is required if not using PAM authentication");
+ }
}
/**
14 years, 10 months
java/code
by Brad Buckingham
java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml | 4 +
java/code/src/com/redhat/rhn/frontend/xmlrpc/PamAuthNotConfiguredException.java | 33 ++++++++++
java/code/src/com/redhat/rhn/frontend/xmlrpc/org/OrgHandler.java | 26 +++++++
3 files changed, 61 insertions(+), 2 deletions(-)
New commits:
commit 12a09e04e5414b2159d05c169d6b8ad70227db68
Author: Brad Buckingham <bbuckingham(a)redhat.com>
Date: Mon Jul 27 16:36:58 2009 -0400
513786 - api - org.create - update api to support pam authentication
The org.create API has an argument for to allow the admin to be set up
to use PAM authentication; however, the flag is not currently used. This
commit is to enable that flag to be used.
diff --git a/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml b/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
index a8952f6..ebbf169 100644
--- a/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
+++ b/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
@@ -7640,6 +7640,10 @@ Follow this url to see the full list of inactive systems:
<source>Invalid action type</source>
</trans-unit>
+ <trans-unit id="api.org.pamAuthNotConfigured">
+ <source>The server is not configured to support PAM authentication. Refer to the reference guide for instructions on how to set up PAM.</source>
+ </trans-unit>
+
<trans-unit id="api.org.migrationtosameorg">
<source>User cannot migrate a system where the origination and destination organizations are the same. Org Id: {0}, System Id: {1}.</source>
</trans-unit>
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/PamAuthNotConfiguredException.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/PamAuthNotConfiguredException.java
new file mode 100644
index 0000000..6ce32ca
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/PamAuthNotConfiguredException.java
@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2009 Red Hat, Inc.
+ *
+ * This software is licensed to you under the GNU General Public License,
+ * version 2 (GPLv2). There is NO WARRANTY for this software, express or
+ * implied, including the implied warranties of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
+ * along with this software; if not, see
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *
+ * Red Hat trademarks are not licensed under GPLv2. No permission is
+ * granted to use or replicate Red Hat trademarks that are incorporated
+ * in this software or its documentation.
+ */
+package com.redhat.rhn.frontend.xmlrpc;
+
+import com.redhat.rhn.FaultException;
+
+/**
+ * PamAuthNotConfiguredException
+ * @version $Rev$
+ */
+public class PamAuthNotConfiguredException extends FaultException {
+
+ /**
+ * Constructor for exception when management server is not configured
+ * for PAM authentication.
+ */
+ public PamAuthNotConfiguredException() {
+ super(1231, "pamAuthNotConfiged", "api.org.pamAuthNotConfigured",
+ new Object[] {});
+ }
+}
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/org/OrgHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/org/OrgHandler.java
index aefc7a6..1e5ed11 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/org/OrgHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/org/OrgHandler.java
@@ -15,6 +15,8 @@
package com.redhat.rhn.frontend.xmlrpc.org;
import com.redhat.rhn.FaultException;
+import com.redhat.rhn.common.conf.Config;
+import com.redhat.rhn.common.conf.ConfigDefaults;
import com.redhat.rhn.common.db.datasource.DataList;
import com.redhat.rhn.common.hibernate.LookupException;
import com.redhat.rhn.common.validator.ValidatorError;
@@ -43,6 +45,7 @@ import com.redhat.rhn.frontend.xmlrpc.NoSuchEntitlementException;
import com.redhat.rhn.frontend.xmlrpc.NoSuchOrgException;
import com.redhat.rhn.frontend.xmlrpc.NoSuchSystemException;
import com.redhat.rhn.frontend.xmlrpc.OrgNotInTrustException;
+import com.redhat.rhn.frontend.xmlrpc.PamAuthNotConfiguredException;
import com.redhat.rhn.frontend.xmlrpc.PermissionCheckFailureException;
import com.redhat.rhn.frontend.xmlrpc.SatelliteOrgException;
import com.redhat.rhn.frontend.xmlrpc.ValidationException;
@@ -54,6 +57,7 @@ import com.redhat.rhn.manager.org.OrgManager;
import com.redhat.rhn.manager.org.UpdateOrgSoftwareEntitlementsCommand;
import com.redhat.rhn.manager.org.UpdateOrgSystemEntitlementsCommand;
+import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import java.util.HashMap;
@@ -116,7 +120,8 @@ public class OrgHandler extends BaseHandler {
log.debug("OrgHandler.create");
getSatAdmin(sessionKey);
- validateCreateOrgData(orgName, adminPassword, firstName, lastName, email);
+ validateCreateOrgData(orgName, adminPassword, firstName, lastName, email,
+ usePamAuth);
CreateOrgCommand cmd = new CreateOrgCommand(orgName, adminLogin, adminPassword,
email);
@@ -124,6 +129,18 @@ public class OrgHandler extends BaseHandler {
cmd.setLastName(lastName);
cmd.setPrefix(prefix);
+ String pamAuthService = Config.get().getString(ConfigDefaults.WEB_PAM_AUTH_SERVICE);
+ if (usePamAuth) {
+ if (pamAuthService != null && pamAuthService.trim().length() > 0) {
+ cmd.setUsePam(usePamAuth);
+ }
+ else {
+ // The user wants to use pam authentication, but the server has not been
+ // configured to use pam... Throw an error...
+ throw new PamAuthNotConfiguredException();
+ }
+ }
+
ValidatorError[] verrors = cmd.store();
if (verrors != null) {
throw new ValidationException(verrors[0].getMessage());
@@ -133,7 +150,7 @@ public class OrgHandler extends BaseHandler {
}
private void validateCreateOrgData(String orgName, String password, String firstName,
- String lastName, String email) {
+ String lastName, String email, Boolean usePamAuth) {
Map<String, String> values = new HashMap<String, String>();
values.put("orgName", orgName);
@@ -155,6 +172,11 @@ public class OrgHandler extends BaseHandler {
ValidatorError e = result.getErrors().get(0);
throw new ValidationException(e.getMessage());
}
+
+ if (!usePamAuth && StringUtils.isEmpty(password)) {
+ throw new FaultException(-501, "passwordRequiredOrUsePam",
+ "Password is required if not using PAM authentication");
+ }
}
/**
14 years, 10 months
schema/spacewalk
by Jeff Ortel
schema/spacewalk/oracle/packages/packages.deps | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit aa22567d8ddb456793562d336870362fd287f1db
Author: Jeff Ortel <jortel(a)redhat.com>
Date: Mon Jul 27 15:24:12 2009 -0500
Added missing dependency
diff --git a/schema/spacewalk/oracle/packages/packages.deps b/schema/spacewalk/oracle/packages/packages.deps
index 36b8ffe..2490128 100644
--- a/schema/spacewalk/oracle/packages/packages.deps
+++ b/schema/spacewalk/oracle/packages/packages.deps
@@ -28,7 +28,8 @@ rhn_channel.pkb :: rhnChannel rhn_exception.pks rhnServer rhnServerChann
rhnPublicChannelFamily rhnOrgChannelFamilyPermissions \
rhnChannelPackage rhnChannelErrata rhnSnapshotChannel \
rhnServerUuid rhnChannelPermissions rhnServerEntitlementView \
- rhnChannelFamilyServerPhysical rhnSharedChannelView
+ rhnChannelFamilyServerPhysical rhnSharedChannelView \
+ rhn_user.pks
rhn_channel.pks :: rhnChannel rhnOrgChannelFamilyPermissions \
rhnServerChannel
rhn_config.pkb :: rhnSnapshot rhnSnapshotConfigRevision lookup_functions \
14 years, 10 months
Changes to 'refs/tags/spacewalk-setup-0.6.12-1'
by Devan Goodwin
Tag 'spacewalk-setup-0.6.12-1' created by Devan Goodwin <dgoodwin(a)redhat.com> at 2009-07-27 19:33 +0000
Tagging package [spacewalk-setup] version [0.6.12-1] in directory [spacewalk/setup/].
Changes since spacewalk-admin-0.6.2-1:
Devan Goodwin (1):
Automatic commit of package [spacewalk-setup] release [0.6.12-1].
---
rel-eng/packages/spacewalk-setup | 2 +-
spacewalk/setup/spacewalk-setup.spec | 17 ++++++++++++++++-
2 files changed, 17 insertions(+), 2 deletions(-)
---
14 years, 10 months
rel-eng/packages spacewalk/setup
by Devan Goodwin
rel-eng/packages/spacewalk-setup | 2 +-
spacewalk/setup/spacewalk-setup.spec | 17 ++++++++++++++++-
2 files changed, 17 insertions(+), 2 deletions(-)
New commits:
commit f3ce58477ae7fe0bb8b1642b9e4fc1bd4acb612b
Author: Devan Goodwin <dgoodwin(a)redhat.com>
Date: Mon Jul 27 16:33:01 2009 -0300
Automatic commit of package [spacewalk-setup] release [0.6.12-1].
diff --git a/rel-eng/packages/spacewalk-setup b/rel-eng/packages/spacewalk-setup
index 07033b9..c0ee80c 100644
--- a/rel-eng/packages/spacewalk-setup
+++ b/rel-eng/packages/spacewalk-setup
@@ -1 +1 @@
-0.6.11-1 spacewalk/setup/
+0.6.12-1 spacewalk/setup/
diff --git a/spacewalk/setup/spacewalk-setup.spec b/spacewalk/setup/spacewalk-setup.spec
index c8afdff..f3e721d 100644
--- a/spacewalk/setup/spacewalk-setup.spec
+++ b/spacewalk/setup/spacewalk-setup.spec
@@ -1,5 +1,5 @@
Name: spacewalk-setup
-Version: 0.6.11
+Version: 0.6.12
Release: 1%{?dist}
Summary: Initial setup tools for Red Hat Spacewalk
@@ -101,6 +101,21 @@ rm -rf %{buildroot}
%dir %{_sysconfdir}/pki/spacewalk/jabberd
%changelog
+* Mon Jul 27 2009 Devan Goodwin <dgoodwin(a)redhat.com> 0.6.12-1
+- Fix PostgreSQL clearing of the DB during setup. (dgoodwin(a)redhat.com)
+- Populate Hibernate settings in rhn.conf for both Oracle and PostgreSQL.
+ (dgoodwin(a)redhat.com)
+- Prep perl stack for PostgreSQL connections. (dgoodwin(a)redhat.com)
+- Fully qualify spacewalk-setup calls to satcon_deploy. (dgoodwin(a)redhat.com)
+- Fix spacewalk-setup query to work with Oracle + PostgreSQL.
+ (dgoodwin(a)redhat.com)
+- Stop printing charset during setup. (dgoodwin(a)redhat.com)
+- Fix Oracle rhn-populate-db.pl issue. (dgoodwin(a)redhat.com)
+- Support setup --clear-db option for PostgreSQL. (dgoodwin(a)redhat.com)
+- Check if schema already exists during setup. (dgoodwin(a)redhat.com)
+- Update spacewalk-setup to deploy new PostgreSQL schema layout.
+ (dgoodwin(a)redhat.com)
+
* Mon Jul 27 2009 John Matthews <jmatthew(a)redhat.com> 0.6.11-1
- 508187 - Fix jabberd configs on x86_64. (dgoodwin(a)redhat.com)
14 years, 10 months
Changes to 'refs/tags/spacewalk-admin-0.6.2-1'
by Devan Goodwin
Tag 'spacewalk-admin-0.6.2-1' created by Devan Goodwin <dgoodwin(a)redhat.com> at 2009-07-27 19:31 +0000
Tagging package [spacewalk-admin] version [0.6.2-1] in directory [spacewalk/admin/].
Changes since spacewalk-web-0.6.15-1:
Devan Goodwin (1):
Automatic commit of package [spacewalk-admin] release [0.6.2-1].
---
rel-eng/packages/spacewalk-admin | 2 +-
spacewalk/admin/spacewalk-admin.spec | 9 ++++++++-
2 files changed, 9 insertions(+), 2 deletions(-)
---
14 years, 10 months
rel-eng/packages spacewalk/admin
by Devan Goodwin
rel-eng/packages/spacewalk-admin | 2 +-
spacewalk/admin/spacewalk-admin.spec | 9 ++++++++-
2 files changed, 9 insertions(+), 2 deletions(-)
New commits:
commit 9f3fcfecdaf4231c78c53dcaac946e5a12e8b281
Author: Devan Goodwin <dgoodwin(a)redhat.com>
Date: Mon Jul 27 16:31:03 2009 -0300
Automatic commit of package [spacewalk-admin] release [0.6.2-1].
diff --git a/rel-eng/packages/spacewalk-admin b/rel-eng/packages/spacewalk-admin
index 5100f64..4cfff3b 100644
--- a/rel-eng/packages/spacewalk-admin
+++ b/rel-eng/packages/spacewalk-admin
@@ -1 +1 @@
-0.6.1-1 spacewalk/admin/
+0.6.2-1 spacewalk/admin/
diff --git a/spacewalk/admin/spacewalk-admin.spec b/spacewalk/admin/spacewalk-admin.spec
index 7c32d6b..ecbb440 100644
--- a/spacewalk/admin/spacewalk-admin.spec
+++ b/spacewalk/admin/spacewalk-admin.spec
@@ -2,7 +2,7 @@
Summary: Various utility scripts and data files for RHN Satellite installations
Name: spacewalk-admin
URL: https://fedorahosted.org/spacewalk
-Version: 0.6.1
+Version: 0.6.2
Release: 1%{?dist}
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
License: GPLv2
@@ -58,6 +58,13 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man3/validate-sat-cert.3.gz
%changelog
+* Mon Jul 27 2009 Devan Goodwin <dgoodwin(a)redhat.com> 0.6.2-1
+- Fix Oracle logging to populate-db.log. (dgoodwin(a)redhat.com)
+- Fix some merge errors in rhn-populate-database.pl. (dgoodwin(a)redhat.com)
+- Fix Oracle rhn-populate-db.pl issue. (dgoodwin(a)redhat.com)
+- Update spacewalk-setup to deploy new PostgreSQL schema layout.
+ (dgoodwin(a)redhat.com)
+
* Mon Apr 20 2009 jesus m. rodriguez <jesusr(a)redhat.com> 0.6.1-1
- bump Versions to 0.6.0 (jesusr(a)redhat.com)
14 years, 10 months