Changes to 'refs/tags/spacewalk-repo-1.8-3'
by Jan Pazdziora
Tag 'spacewalk-repo-1.8-3' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2012-04-23 06:49 +0000
Tagging package [spacewalk-repo] version [1.8-3] in directory [spec-tree/spacewalk-repo/].
Changes since spacewalk-java-1.8.53-1:
Jan Pazdziora (2):
Use the yum.spacewalkproject.org address for yum repos.
Automatic commit of package [spacewalk-repo] minor release [1.8-3].
---
rel-eng/packages/spacewalk-repo | 2 +-
spec-tree/spacewalk-repo/spacewalk-repo.spec | 23 +++++++++++++----------
2 files changed, 14 insertions(+), 11 deletions(-)
---
12 years, 1 month
rel-eng/packages spec-tree/spacewalk-repo
by Jan Pazdziora
rel-eng/packages/spacewalk-repo | 2 +-
spec-tree/spacewalk-repo/spacewalk-repo.spec | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 259880d7f3134d4ec76759175a38f94daa88e1dc
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Apr 23 08:49:32 2012 +0200
Automatic commit of package [spacewalk-repo] minor release [1.8-3].
diff --git a/rel-eng/packages/spacewalk-repo b/rel-eng/packages/spacewalk-repo
index e474d7e..c89193a 100644
--- a/rel-eng/packages/spacewalk-repo
+++ b/rel-eng/packages/spacewalk-repo
@@ -1 +1 @@
-1.8-2 spec-tree/spacewalk-repo/
+1.8-3 spec-tree/spacewalk-repo/
diff --git a/spec-tree/spacewalk-repo/spacewalk-repo.spec b/spec-tree/spacewalk-repo/spacewalk-repo.spec
index 877d72f..c3c36f5 100644
--- a/spec-tree/spacewalk-repo/spacewalk-repo.spec
+++ b/spec-tree/spacewalk-repo/spacewalk-repo.spec
@@ -1,7 +1,7 @@
Summary: Spacewalk packages yum repository configuration
Name: spacewalk-repo
Version: 1.8
-Release: 2%{?dist}
+Release: 3%{?dist}
License: GPLv2
Group: System Environment/Base
# This src.rpm is cannonical upstream
@@ -98,6 +98,9 @@ rm -rf $RPM_BUILD_ROOT
%config(noreplace) %{_sysconfdir}/yum.repos.d/spacewalk-client-nightly.repo
%changelog
+* Mon Apr 23 2012 Jan Pazdziora 1.8-3
+- Use the yum.spacewalkproject.org address for yum repos.
+
* Mon Mar 12 2012 Jan Pazdziora 1.8-2
- Marking all .repo files as noreplace, so that they survive local
modifications like enabling nightly repo.
12 years, 1 month
spec-tree/spacewalk-repo
by Jan Pazdziora
spec-tree/spacewalk-repo/spacewalk-repo.spec | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
New commits:
commit 8f2fe2d57385c50a781e1643132542798a3a854d
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Apr 23 08:48:56 2012 +0200
Use the yum.spacewalkproject.org address for yum repos.
diff --git a/spec-tree/spacewalk-repo/spacewalk-repo.spec b/spec-tree/spacewalk-repo/spacewalk-repo.spec
index 6a96bde..877d72f 100644
--- a/spec-tree/spacewalk-repo/spacewalk-repo.spec
+++ b/spec-tree/spacewalk-repo/spacewalk-repo.spec
@@ -40,8 +40,8 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d
cat >>$RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/spacewalk.repo <<REPO
[spacewalk]
name=Spacewalk
-baseurl=http://spacewalk.redhat.com/yum/%{version}/%{reposubdir}/\$basearch/
-gpgkey=http://spacewalk.redhat.com/yum/RPM-GPG-KEY-spacewalk-2012
+baseurl=http://yum.spacewalkproject.org/%{version}/%{reposubdir}/\$basearch/
+gpgkey=http://yum.spacewalkproject.org/RPM-GPG-KEY-spacewalk-2012
enabled=1
gpgcheck=1
REPO
@@ -49,8 +49,8 @@ REPO
cat >>$RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/spacewalk-client.repo <<REPO
[spacewalk-client]
name=Spacewalk Client Tools
-baseurl=http://spacewalk.redhat.com/yum/%{version}-client/%{reposubdir}/\$basearch/
-gpgkey=http://spacewalk.redhat.com/yum/RPM-GPG-KEY-spacewalk-2012
+baseurl=http://yum.spacewalkproject.org/%{version}-client/%{reposubdir}/\$basearch/
+gpgkey=http://yum.spacewalkproject.org/RPM-GPG-KEY-spacewalk-2012
enabled=1
gpgcheck=1
REPO
@@ -59,7 +59,7 @@ cat >>$RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/spacewalk-source.repo <<REPO
[spacewalk-source]
name=Spacewalk SRPMS
baseurl=http://spacewalk.redhat.com/source/%{version}/%{reposubdir}/
-gpgkey=http://spacewalk.redhat.com/yum/RPM-GPG-KEY-spacewalk-2012
+gpgkey=http://yum.spacewalkproject.org/RPM-GPG-KEY-spacewalk-2012
enabled=0
gpgcheck=1
REPO
@@ -67,8 +67,8 @@ REPO
cat >>$RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/spacewalk-nightly.repo <<REPO
[spacewalk-nightly]
name=Spacewalk nightly
-baseurl=http://spacewalk.redhat.com/yum/nightly/%{reposubdir}/\$basearch/
-gpgkey=http://spacewalk.redhat.com/yum/RPM-GPG-KEY-spacewalk-2012
+baseurl=http://yum.spacewalkproject.org/nightly/%{reposubdir}/\$basearch/
+gpgkey=http://yum.spacewalkproject.org/RPM-GPG-KEY-spacewalk-2012
enabled=0
gpgcheck=0
REPO
@@ -76,8 +76,8 @@ REPO
cat >>$RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/spacewalk-client-nightly.repo <<REPO
[spacewalk-client-nightly]
name=Spacewalk Client Tools nightly
-baseurl=http://spacewalk.redhat.com/yum/nightly-client/%{reposubdir}/\$basearch/
-gpgkey=http://spacewalk.redhat.com/yum/RPM-GPG-KEY-spacewalk-2012
+baseurl=http://yum.spacewalkproject.org/nightly-client/%{reposubdir}/\$basearch/
+gpgkey=http://yum.spacewalkproject.org/RPM-GPG-KEY-spacewalk-2012
enabled=0
gpgcheck=0
REPO
12 years, 1 month
Changes to 'refs/tags/spacewalk-java-1.8.53-1'
by Tomas Lestach
Tag 'spacewalk-java-1.8.53-1' created by Tomas Lestach <tlestach(a)redhat.com> at 2012-04-20 16:20 +0000
Tagging package [spacewalk-java] version [1.8.53-1] in directory [java/].
Changes since spacewalk-backend-1.8.20-1:
Tomas Lestach (4):
fix errata clone name generation
728205 - do not check CSRF token for login pages
remove unused paths from unprotected uris
Automatic commit of package [spacewalk-java] release [1.8.53-1].
---
java/code/src/com/redhat/rhn/domain/errata/ErrataFactory.java | 61 ++-----
java/code/src/com/redhat/rhn/frontend/action/channel/manage/PublishErrataHelper.java | 87 +++++++---
java/code/src/com/redhat/rhn/frontend/security/AuthenticationService.java | 8
java/code/src/com/redhat/rhn/frontend/security/BaseAuthenticationService.java | 10 +
java/code/src/com/redhat/rhn/frontend/security/PxtAuthenticationService.java | 23 +-
java/code/src/com/redhat/rhn/frontend/servlets/AuthFilter.java | 6
java/spacewalk-java.spec | 7
rel-eng/packages/spacewalk-java | 2
8 files changed, 134 insertions(+), 70 deletions(-)
---
12 years, 1 month
4 commits - java/code java/spacewalk-java.spec rel-eng/packages
by Tomas Lestach
java/code/src/com/redhat/rhn/domain/errata/ErrataFactory.java | 61 ++-----
java/code/src/com/redhat/rhn/frontend/action/channel/manage/PublishErrataHelper.java | 87 +++++++---
java/code/src/com/redhat/rhn/frontend/security/AuthenticationService.java | 8
java/code/src/com/redhat/rhn/frontend/security/BaseAuthenticationService.java | 10 +
java/code/src/com/redhat/rhn/frontend/security/PxtAuthenticationService.java | 23 +-
java/code/src/com/redhat/rhn/frontend/servlets/AuthFilter.java | 6
java/spacewalk-java.spec | 7
rel-eng/packages/spacewalk-java | 2
8 files changed, 134 insertions(+), 70 deletions(-)
New commits:
commit c4647a2b49b67d5f477219d4d9a1829f69d882aa
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Fri Apr 20 18:20:20 2012 +0200
Automatic commit of package [spacewalk-java] release [1.8.53-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index 328d913..b1e1b21 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -22,7 +22,7 @@ Name: spacewalk-java
Summary: Spacewalk Java site packages
Group: Applications/Internet
License: GPLv2
-Version: 1.8.52
+Version: 1.8.53
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -605,6 +605,11 @@ fi
%{jardir}/postgresql-jdbc.jar
%changelog
+* Fri Apr 20 2012 Tomas Lestach <tlestach(a)redhat.com> 1.8.53-1
+- remove unused paths from unprotected uris
+- 728205 - do not check CSRF token for login pages
+- fix errata clone name generation
+
* Fri Apr 20 2012 Jan Pazdziora 1.8.52-1
- Fixing checkstyle.
diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java
index c0917fe..cb056ff 100644
--- a/rel-eng/packages/spacewalk-java
+++ b/rel-eng/packages/spacewalk-java
@@ -1 +1 @@
-1.8.52-1 java/
+1.8.53-1 java/
commit ffbe89644e59f3fa7438e26388f18b842839d120
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Fri Apr 20 18:18:16 2012 +0200
remove unused paths from unprotected uris
diff --git a/java/code/src/com/redhat/rhn/frontend/security/PxtAuthenticationService.java b/java/code/src/com/redhat/rhn/frontend/security/PxtAuthenticationService.java
index bf90bf8..efb5805 100644
--- a/java/code/src/com/redhat/rhn/frontend/security/PxtAuthenticationService.java
+++ b/java/code/src/com/redhat/rhn/frontend/security/PxtAuthenticationService.java
@@ -51,12 +51,7 @@ public class PxtAuthenticationService extends BaseAuthenticationService {
LOGIN_URIS = UnmodifiableSet.decorate(set);
set = new TreeSet(set);
- set.add("/rhn/newuser");
set.add("/rhn/rpc/api");
- set.add("/rhn/servlet/");
- set.add("/rhn/services/");
- set.add("/rhn/help/");
- set.add("/rhn/tnc/"); //TODO should tnc be here?
set.add("/rhn/help/");
set.add("/rhn/apidoc");
set.add("/rhn/kickstart/DownloadFile");
commit 40fdee3ccf85a3f582a987685d12739bebbda051
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Fri Apr 20 15:54:46 2012 +0200
728205 - do not check CSRF token for login pages
diff --git a/java/code/src/com/redhat/rhn/frontend/security/AuthenticationService.java b/java/code/src/com/redhat/rhn/frontend/security/AuthenticationService.java
index 91efacc..3a08b14 100644
--- a/java/code/src/com/redhat/rhn/frontend/security/AuthenticationService.java
+++ b/java/code/src/com/redhat/rhn/frontend/security/AuthenticationService.java
@@ -46,6 +46,14 @@ public interface AuthenticationService {
throws ServletException;
/**
+ * CSFR check might be skipped for particular POST requests f.e. all login
+ * pages
+ * @param request The current request
+ * @return True if CSFR check shall be skipped for current request
+ */
+ boolean skipCsfr(HttpServletRequest request);
+
+ /**
* Redirects the request to whatever resource handles logins. This method is typically
* invoked after a call to {@link #validate(HttpServletRequest, HttpServletResponse)}
* fails. Note that the redirect may be client-side or server-side, and it may be to an
diff --git a/java/code/src/com/redhat/rhn/frontend/security/BaseAuthenticationService.java b/java/code/src/com/redhat/rhn/frontend/security/BaseAuthenticationService.java
index 0581611..7059ded 100644
--- a/java/code/src/com/redhat/rhn/frontend/security/BaseAuthenticationService.java
+++ b/java/code/src/com/redhat/rhn/frontend/security/BaseAuthenticationService.java
@@ -35,6 +35,14 @@ public abstract class BaseAuthenticationService implements AuthenticationService
});
}
- protected abstract Set getUnprotectedURIs();
+ protected boolean requestURIdoesLogin(final HttpServletRequest request) {
+ return CollectionUtils.exists(getLoginURIs(), new Predicate() {
+ public boolean evaluate(Object uri) {
+ return request.getRequestURI().startsWith(uri.toString());
+ }
+ });
+ }
+ protected abstract Set getUnprotectedURIs();
+ protected abstract Set getLoginURIs();
}
diff --git a/java/code/src/com/redhat/rhn/frontend/security/PxtAuthenticationService.java b/java/code/src/com/redhat/rhn/frontend/security/PxtAuthenticationService.java
index b4e799f..bf90bf8 100644
--- a/java/code/src/com/redhat/rhn/frontend/security/PxtAuthenticationService.java
+++ b/java/code/src/com/redhat/rhn/frontend/security/PxtAuthenticationService.java
@@ -40,17 +40,22 @@ public class PxtAuthenticationService extends BaseAuthenticationService {
public static final long MAX_URL_LENGTH = 2048;
private static final Set UNPROTECTED_URIS;
+ private static final Set LOGIN_URIS;
static {
TreeSet set = new TreeSet();
set.add("/rhn/Login");
set.add("/rhn/ReLogin");
+ set.add("/rhn/newlogin/");
+
+ LOGIN_URIS = UnmodifiableSet.decorate(set);
+
+ set = new TreeSet(set);
set.add("/rhn/newuser");
set.add("/rhn/rpc/api");
set.add("/rhn/servlet/");
set.add("/rhn/services/");
set.add("/rhn/help/");
- set.add("/rhn/newlogin/");
set.add("/rhn/tnc/"); //TODO should tnc be here?
set.add("/rhn/help/");
set.add("/rhn/apidoc");
@@ -69,6 +74,10 @@ public class PxtAuthenticationService extends BaseAuthenticationService {
protected PxtAuthenticationService() {
}
+ protected Set getLoginURIs() {
+ return LOGIN_URIS;
+ }
+
protected Set getUnprotectedURIs() {
return UNPROTECTED_URIS;
}
@@ -87,6 +96,13 @@ public class PxtAuthenticationService extends BaseAuthenticationService {
/**
* {@inheritDoc}
*/
+ public boolean skipCsfr(HttpServletRequest request) {
+ return requestURIdoesLogin(request);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public boolean validate(HttpServletRequest request, HttpServletResponse response) {
//is authentication needed (i.e. is our session valid, and does the url
// we are hitting require auth)
diff --git a/java/code/src/com/redhat/rhn/frontend/servlets/AuthFilter.java b/java/code/src/com/redhat/rhn/frontend/servlets/AuthFilter.java
index 834bc6a..7c1a88f 100644
--- a/java/code/src/com/redhat/rhn/frontend/servlets/AuthFilter.java
+++ b/java/code/src/com/redhat/rhn/frontend/servlets/AuthFilter.java
@@ -76,14 +76,16 @@ public class AuthFilter implements Filter {
RhnHttpServletRequest((HttpServletRequest)request);
// validate security token to prevent CSRF type of attacks
- if (hreq.getMethod().equals("POST")) {
+ if (hreq.getMethod().equals("POST") &&
+ !authenticationService.skipCsfr((HttpServletRequest) request)) {
try {
CSRFTokenValidator.validate(hreq);
}
catch (CSRFTokenException e) {
// send HTTP 403 if security token validation failed
HttpServletResponse hres = (HttpServletResponse) response;
- hres.sendError(HttpServletResponse.SC_FORBIDDEN, e.getMessage());
+ hres.sendError(HttpServletResponse.SC_FORBIDDEN,
+ e.getMessage());
return;
}
}
commit c6afa3411b8a890e21ffc035767436afd31785f1
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Thu Apr 19 17:47:02 2012 +0200
fix errata clone name generation
diff --git a/java/code/src/com/redhat/rhn/domain/errata/ErrataFactory.java b/java/code/src/com/redhat/rhn/domain/errata/ErrataFactory.java
index f4477cc..d4ce27d 100644
--- a/java/code/src/com/redhat/rhn/domain/errata/ErrataFactory.java
+++ b/java/code/src/com/redhat/rhn/domain/errata/ErrataFactory.java
@@ -17,24 +17,6 @@
*/
package com.redhat.rhn.domain.errata;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.StringTokenizer;
-
-import org.apache.commons.collections.IteratorUtils;
-import org.apache.log4j.Logger;
-import org.hibernate.HibernateException;
-import org.hibernate.Query;
-import org.hibernate.Session;
-
import com.redhat.rhn.common.db.datasource.DataResult;
import com.redhat.rhn.common.db.datasource.ModeFactory;
import com.redhat.rhn.common.db.datasource.SelectMode;
@@ -56,6 +38,7 @@ import com.redhat.rhn.domain.org.Org;
import com.redhat.rhn.domain.rhnpackage.Package;
import com.redhat.rhn.domain.rhnpackage.PackageFactory;
import com.redhat.rhn.domain.user.User;
+import com.redhat.rhn.frontend.action.channel.manage.PublishErrataHelper;
import com.redhat.rhn.frontend.dto.ErrataOverview;
import com.redhat.rhn.frontend.dto.ErrataPackageFile;
import com.redhat.rhn.frontend.dto.PackageOverview;
@@ -64,6 +47,24 @@ import com.redhat.rhn.manager.channel.ChannelManager;
import com.redhat.rhn.manager.errata.ErrataManager;
import com.redhat.rhn.manager.errata.cache.ErrataCacheManager;
+import org.apache.commons.collections.IteratorUtils;
+import org.apache.log4j.Logger;
+import org.hibernate.HibernateException;
+import org.hibernate.Query;
+import org.hibernate.Session;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.StringTokenizer;
+
/**
* ErrataFactory - the singleton class used to fetch and store
* com.redhat.rhn.domain.errata.Errata objects from the
@@ -378,33 +379,11 @@ public class ErrataFactory extends HibernateFactory {
*/
public static Errata createClone(Org org, Errata e) {
-
- String baseClonedAdvisoryName = "CL" + e.getAdvisoryName().substring(2);
- String baseClonedAdvisory = "CL" + e.getAdvisory().substring(2);
- String clonedAdvisory = baseClonedAdvisory;
- String clonedAdvisoryName = baseClonedAdvisoryName;
- boolean unusedNameFound = false;
-
-
- for (int j = 1; !unusedNameFound; ++j) {
- Errata advisoryNameMatch = lookupByAdvisory(clonedAdvisoryName);
- Errata advisoryMatch = lookupByAdvisoryId(clonedAdvisory);
-
- if ((advisoryNameMatch == null) && (advisoryMatch == null)) {
- unusedNameFound = true;
- }
- else {
- clonedAdvisoryName = baseClonedAdvisoryName + '-' + j;
- clonedAdvisory = baseClonedAdvisory + '-' + j;
- }
- }
-
UnpublishedClonedErrata clone = new UnpublishedClonedErrata();
copyDetails(clone, e, true);
- clone.setAdvisoryName(clonedAdvisoryName);
- clone.setAdvisory(clonedAdvisory);
+ PublishErrataHelper.setUniqueAdvisoryCloneName(e, clone);
clone.setOriginal(e);
clone.setOrg(org);
diff --git a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/PublishErrataHelper.java b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/PublishErrataHelper.java
index 0690e78..fa6b6df 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/PublishErrataHelper.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/PublishErrataHelper.java
@@ -39,6 +39,8 @@ import java.util.Set;
*/
public class PublishErrataHelper {
+ private static final String DEFAULT_ERRATA_CLONE_PREFIX = "CL-";
+ private static final String REDHAT_ERRATA_PREFIX = "RH";
private PublishErrataHelper() {
@@ -106,15 +108,60 @@ public class PublishErrataHelper {
clone.addBug(bClone);
}
+ setUniqueAdvisoryCloneName(original, clone);
+ ((PublishedClonedErrata) clone).setOriginal(original);
+ clone.setOrg(org);
+ ErrataFactory.save(clone);
- String baseClonedAdvisoryName = "CL" + original.getAdvisoryName().substring(2);
- String baseClonedAdvisory = "CL" + original.getAdvisory().substring(2);
- String clonedAdvisory = baseClonedAdvisory;
- String clonedAdvisoryName = baseClonedAdvisoryName;
- boolean unusedNameFound = false;
+ return clone;
+ }
- for (int j = 1; !unusedNameFound; ++j) {
+ /**
+ * Generates a unique errata clone advisory and advisoryName and sets them
+ * to the errata clone
+ * @param original original erratum
+ * @param clone cloned erratum
+ */
+ public static void setUniqueAdvisoryCloneName(Errata original, Errata clone) {
+ String clonedAdvisory, clonedAdvisoryName;
+
+ if (!original.isCloned()) {
+ if (original.getAdvisory().startsWith(REDHAT_ERRATA_PREFIX)) {
+ // RHBA-1234:1234 -> CL-BA-1234:1234
+ clonedAdvisory = DEFAULT_ERRATA_CLONE_PREFIX +
+ original.getAdvisory().substring(
+ REDHAT_ERRATA_PREFIX.length());
+ clonedAdvisoryName = DEFAULT_ERRATA_CLONE_PREFIX +
+ original.getAdvisoryName().substring(
+ REDHAT_ERRATA_PREFIX.length());
+ }
+ else {
+ // CUSTOM-ERRATA -> CL-CUSTOM-ERRATA
+ clonedAdvisory = DEFAULT_ERRATA_CLONE_PREFIX +
+ original.getAdvisory();
+ clonedAdvisoryName = DEFAULT_ERRATA_CLONE_PREFIX +
+ original.getAdvisoryName();
+ }
+ }
+ else {
+ // increment CL -> CM only advisories with 3rd char '-'
+ if ('-' == original.getAdvisory().charAt(2) &&
+ '-' == original.getAdvisoryName().charAt(2)) {
+ clonedAdvisory = new String(original.getAdvisory());
+ clonedAdvisoryName = new String(original.getAdvisoryName());
+ }
+ else {
+ clonedAdvisory = DEFAULT_ERRATA_CLONE_PREFIX +
+ original.getAdvisory();
+ clonedAdvisoryName = DEFAULT_ERRATA_CLONE_PREFIX +
+ original.getAdvisoryName();
+ }
+ }
+
+ boolean unusedNameFound = false;
+
+ while (!unusedNameFound) {
Errata advisoryNameMatch = ErrataFactory.lookupByAdvisory(
clonedAdvisoryName);
Errata advisoryMatch = ErrataFactory.lookupByAdvisoryId(clonedAdvisory);
@@ -123,22 +170,26 @@ public class PublishErrataHelper {
unusedNameFound = true;
}
else {
- clonedAdvisoryName = baseClonedAdvisoryName + '-' +
- new Integer(j).toString();
- clonedAdvisory = baseClonedAdvisory + '-' +
- new Integer(j).toString();
+ // use the advisory prefix for both - advisory and advisory_name
+ char c1 = clonedAdvisory.charAt(1);
+ if ('Z' == c1) {
+ char c0next = (char) (clonedAdvisory.charAt(0) + 1);
+ clonedAdvisory = "" + c0next + 'A' +
+ clonedAdvisory.substring(2);
+ clonedAdvisoryName = "" + c0next + 'A' +
+ clonedAdvisoryName.substring(2);
+ }
+ else {
+ char c1next = (char) (c1 + 1);
+ clonedAdvisory = "" + clonedAdvisory.charAt(0) + c1next +
+ clonedAdvisory.substring(2);
+ clonedAdvisoryName = "" + clonedAdvisoryName.charAt(0) +
+ c1next + clonedAdvisoryName.substring(2);
+ }
}
}
-
clone.setAdvisoryName(clonedAdvisoryName);
clone.setAdvisory(clonedAdvisory);
- ((PublishedClonedErrata) clone).setOriginal(original);
- clone.setOrg(org);
- ErrataFactory.save(clone);
-
- return clone;
-
}
-
}
12 years, 1 month
Changes to 'refs/tags/spacewalk-backend-1.8.20-1'
by Miroslav Suchý
Tag 'spacewalk-backend-1.8.20-1' created by Miroslav Suchý <msuchy(a)redhat.com> at 2012-04-20 12:20 +0000
Tagging package [spacewalk-backend] version [1.8.20-1] in directory [backend/].
Changes since spacewalk-schema-1.8.17-1:
Miroslav Suchý (2):
805582 - fix sql query with --use-sync-date and --start-date of rhn-satellite-exporter
Automatic commit of package [spacewalk-backend] release [1.8.20-1].
---
backend/satellite_tools/disk_dumper/iss.py | 4 ++--
backend/spacewalk-backend.spec | 6 +++++-
rel-eng/packages/spacewalk-backend | 2 +-
3 files changed, 8 insertions(+), 4 deletions(-)
---
12 years, 1 month
2 commits - backend/satellite_tools backend/spacewalk-backend.spec rel-eng/packages
by Miroslav Suchý
backend/satellite_tools/disk_dumper/iss.py | 4 ++--
backend/spacewalk-backend.spec | 6 +++++-
rel-eng/packages/spacewalk-backend | 2 +-
3 files changed, 8 insertions(+), 4 deletions(-)
New commits:
commit 8ee38f6f01a321650a57da33b5792d1e72d4a71e
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Apr 20 14:20:54 2012 +0200
Automatic commit of package [spacewalk-backend] release [1.8.20-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 54f6b4c..8ba1134 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -12,7 +12,7 @@ Name: spacewalk-backend
Summary: Common programs needed to be installed on the Spacewalk servers/proxies
Group: Applications/Internet
License: GPLv2
-Version: 1.8.19
+Version: 1.8.20
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -673,6 +673,10 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Fri Apr 20 2012 Miroslav Suchý <msuchy(a)redhat.com> 1.8.20-1
+- 805582 - fix sql query with --use-sync-date and --start-date of rhn-
+ satellite-exporter
+
* Tue Apr 17 2012 Jan Pazdziora 1.8.19-1
- The mod_wsgi insists on having something after the numeric value on the
Status line.
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index 56a58ba..f4ed522 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-1.8.19-1 backend/
+1.8.20-1 backend/
commit 0bd4e9e04cdd057a1120f472ee3f57d1f28583e7
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Apr 20 14:20:27 2012 +0200
805582 - fix sql query with --use-sync-date and --start-date of rhn-satellite-exporter
diff --git a/backend/satellite_tools/disk_dumper/iss.py b/backend/satellite_tools/disk_dumper/iss.py
index c459740..656c5a0 100644
--- a/backend/satellite_tools/disk_dumper/iss.py
+++ b/backend/satellite_tools/disk_dumper/iss.py
@@ -285,8 +285,8 @@ class Dumper(dumper.XML_Dumper):
"""
else:
query += """
- and ((rcp.modified >= TO_TIMESTAMP(:start_date, 'YYYYMMDDHH24MISS')
- and rcp.modified <= TO_TIMESTAMP(:end_date, 'YYYYMMDDHH24MISS'))
+ and rcp.modified >= TO_TIMESTAMP(:start_date, 'YYYYMMDDHH24MISS')
+ and rcp.modified <= TO_TIMESTAMP(:end_date, 'YYYYMMDDHH24MISS')
"""
self.brpm_query = rhnSQL.Statement(query)
brpm_data = rhnSQL.prepare(self.brpm_query)
12 years, 1 month
Changes to 'refs/tags/spacewalk-schema-1.8.17-1'
by Jan Pazdziora
Tag 'spacewalk-schema-1.8.17-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2012-04-20 11:18 +0000
Tagging package [spacewalk-schema] version [1.8.17-1] in directory [schema/spacewalk/].
Changes since spacewalk-java-1.8.52-1:
Jan Pazdziora (3):
Make the records in rhnPackageUpgradeArchCompat -- no need to have duplicates.
Schema hardening: catch code which would update or delete rhnPackageEvr.
Automatic commit of package [spacewalk-schema] release [1.8.17-1].
---
rel-eng/packages/spacewalk-schema | 2
schema/spacewalk/common/tables/rhnPackageUpgradeArchCompat.sql | 4 -
schema/spacewalk/oracle/triggers/rhnPackageEvr.sql | 32 ++++++++++
schema/spacewalk/postgres/procs/no_operation_trig_fun.sql | 10 +++
schema/spacewalk/postgres/triggers/rhnPackageEvr.sql | 7 ++
schema/spacewalk/schema-source-sanity-check.pl | 1
schema/spacewalk/spacewalk-schema.spec | 7 +-
schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/022-rhnPackageUpgradeArchCompat-unique.sql | 5 +
schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/031-no_operation_trig_fun.sql.postgresql | 10 +++
schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/032-rhnPackageEvr-trigger.sql.oracle | 32 ++++++++++
schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/032-rhnPackageEvr-trigger.sql.postgresql | 7 ++
11 files changed, 113 insertions(+), 4 deletions(-)
---
12 years, 1 month
rel-eng/packages schema/spacewalk
by Jan Pazdziora
rel-eng/packages/spacewalk-schema | 2 +-
schema/spacewalk/spacewalk-schema.spec | 7 ++++++-
2 files changed, 7 insertions(+), 2 deletions(-)
New commits:
commit d0f4a7d11afdd20631c630e580e77bfad26d63d4
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Apr 20 13:18:39 2012 +0200
Automatic commit of package [spacewalk-schema] release [1.8.17-1].
diff --git a/rel-eng/packages/spacewalk-schema b/rel-eng/packages/spacewalk-schema
index b78ad46..d067ec6 100644
--- a/rel-eng/packages/spacewalk-schema
+++ b/rel-eng/packages/spacewalk-schema
@@ -1 +1 @@
-1.8.16-1 schema/spacewalk/
+1.8.17-1 schema/spacewalk/
diff --git a/schema/spacewalk/spacewalk-schema.spec b/schema/spacewalk/spacewalk-schema.spec
index 854d225..2fd1d72 100644
--- a/schema/spacewalk/spacewalk-schema.spec
+++ b/schema/spacewalk/spacewalk-schema.spec
@@ -2,7 +2,7 @@ Name: spacewalk-schema
Group: Applications/Internet
Summary: Oracle SQL schema for Spacewalk server
-Version: 1.8.16
+Version: 1.8.17
Release: 1%{?dist}
Source0: %{name}-%{version}.tar.gz
@@ -69,6 +69,11 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/spacewalk-sql*
%changelog
+* Fri Apr 20 2012 Jan Pazdziora 1.8.17-1
+- Schema hardening: catch code which would update or delete rhnPackageEvr.
+- Make the records in rhnPackageUpgradeArchCompat -- no need to have
+ duplicates.
+
* Mon Apr 16 2012 Jan Pazdziora 1.8.16-1
- 812453 - bring the schema version as recorded in the database in sync with
the installed rpms, even if the difference is just the dist tag.
12 years, 1 month
schema/spacewalk
by Jan Pazdziora
schema/spacewalk/oracle/triggers/rhnPackageEvr.sql | 32 ++++++++++
schema/spacewalk/postgres/procs/no_operation_trig_fun.sql | 10 +++
schema/spacewalk/postgres/triggers/rhnPackageEvr.sql | 7 ++
schema/spacewalk/schema-source-sanity-check.pl | 1
schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/031-no_operation_trig_fun.sql.postgresql | 10 +++
schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/032-rhnPackageEvr-trigger.sql.oracle | 32 ++++++++++
schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/032-rhnPackageEvr-trigger.sql.postgresql | 7 ++
7 files changed, 99 insertions(+)
New commits:
commit 3acf583a6e74c24ebc0e3a7da63476508e5393b9
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Apr 20 13:17:33 2012 +0200
Schema hardening: catch code which would update or delete rhnPackageEvr.
diff --git a/schema/spacewalk/oracle/triggers/rhnPackageEvr.sql b/schema/spacewalk/oracle/triggers/rhnPackageEvr.sql
new file mode 100644
index 0000000..bc59d37
--- /dev/null
+++ b/schema/spacewalk/oracle/triggers/rhnPackageEvr.sql
@@ -0,0 +1,32 @@
+--
+-- Copyright (c) 2012 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.
+--
+
+create or replace trigger
+rhn_pack_evr_no_updel_trig
+before update or delete on rhnPackageEvr
+declare
+ operation varchar(20);
+begin
+ if updating then
+ operation := 'UPDATE';
+ elsif deleting then
+ operation := 'DELETE';
+ else
+ raise_application_error(-20051, 'Unknown operation (no UPDATE and no DELETE)');
+ end if;
+ raise_application_error(-20050, 'Permission denied: ' || operation || ' is not allowed on RHNPACKAGEEVR');
+end;
+/
+show errors
diff --git a/schema/spacewalk/postgres/procs/no_operation_trig_fun.sql b/schema/spacewalk/postgres/procs/no_operation_trig_fun.sql
new file mode 100644
index 0000000..fc6453c
--- /dev/null
+++ b/schema/spacewalk/postgres/procs/no_operation_trig_fun.sql
@@ -0,0 +1,10 @@
+-- oracle equivalent source none
+
+create function no_operation_trig_fun()
+returns trigger as
+$$
+begin
+ raise exception 'Permission denied: % is not allowed on %', TG_OP, TG_RELNAME;
+end;
+$$ language plpgsql;
+
diff --git a/schema/spacewalk/postgres/triggers/rhnPackageEvr.sql b/schema/spacewalk/postgres/triggers/rhnPackageEvr.sql
new file mode 100644
index 0000000..fea41f1
--- /dev/null
+++ b/schema/spacewalk/postgres/triggers/rhnPackageEvr.sql
@@ -0,0 +1,7 @@
+-- oracle equivalent source sha1 f9833597e5035b2a9d3f8a1c399c736391f1a862
+
+create trigger
+rhn_pack_evr_no_updel_trig
+before insert or update on rhnPackageEvr
+execute procedure no_operation_trig_fun();
+
diff --git a/schema/spacewalk/schema-source-sanity-check.pl b/schema/spacewalk/schema-source-sanity-check.pl
index a52b2f3..b27cf46 100644
--- a/schema/spacewalk/schema-source-sanity-check.pl
+++ b/schema/spacewalk/schema-source-sanity-check.pl
@@ -131,6 +131,7 @@ sub check_file_content {
|\s*\n
|create(?:\s+or\s+replace)?\s+function\s+(\w+)(?s:.+?)\s+language\s+plpgsql;
\s+create(\s+or\s+replace)?\s+trigger[^;]+\s+on\s+$name\b[^;]+execute\s+procedure\s+\1\(\);
+ |create(\s+or\s+replace)?\s+trigger[^;]+\s+on\s+$name\b[^;]+execute\s+procedure\s+no_operation_trig_fun\(\);
|create(\s+or\s+replace)?\s+trigger[^;]+\s+on\s+$name\b(?s:.+?);\n/\n
|show\s+errors;?\n
)+$!ix) {
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/031-no_operation_trig_fun.sql.postgresql b/schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/031-no_operation_trig_fun.sql.postgresql
new file mode 100644
index 0000000..fc6453c
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/031-no_operation_trig_fun.sql.postgresql
@@ -0,0 +1,10 @@
+-- oracle equivalent source none
+
+create function no_operation_trig_fun()
+returns trigger as
+$$
+begin
+ raise exception 'Permission denied: % is not allowed on %', TG_OP, TG_RELNAME;
+end;
+$$ language plpgsql;
+
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/032-rhnPackageEvr-trigger.sql.oracle b/schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/032-rhnPackageEvr-trigger.sql.oracle
new file mode 100644
index 0000000..bc59d37
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/032-rhnPackageEvr-trigger.sql.oracle
@@ -0,0 +1,32 @@
+--
+-- Copyright (c) 2012 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.
+--
+
+create or replace trigger
+rhn_pack_evr_no_updel_trig
+before update or delete on rhnPackageEvr
+declare
+ operation varchar(20);
+begin
+ if updating then
+ operation := 'UPDATE';
+ elsif deleting then
+ operation := 'DELETE';
+ else
+ raise_application_error(-20051, 'Unknown operation (no UPDATE and no DELETE)');
+ end if;
+ raise_application_error(-20050, 'Permission denied: ' || operation || ' is not allowed on RHNPACKAGEEVR');
+end;
+/
+show errors
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/032-rhnPackageEvr-trigger.sql.postgresql b/schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/032-rhnPackageEvr-trigger.sql.postgresql
new file mode 100644
index 0000000..fea41f1
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/032-rhnPackageEvr-trigger.sql.postgresql
@@ -0,0 +1,7 @@
+-- oracle equivalent source sha1 f9833597e5035b2a9d3f8a1c399c736391f1a862
+
+create trigger
+rhn_pack_evr_no_updel_trig
+before insert or update on rhnPackageEvr
+execute procedure no_operation_trig_fun();
+
12 years, 1 month