提交 a84ab891 编写于 作者: D Daniel Beck

Merge branch 'master' into security-master

......@@ -4,7 +4,6 @@ name-template: $NEXT_PATCH_VERSION
version-template: $MAJOR.$MINOR
tag-template: jenkins-$NEXT_MINOR_VERSION
# TODO: categories are YAGNI for now, until we can extract `type` somehow
exclude-labels:
- reverted
- no-changelog
......@@ -17,6 +16,7 @@ change-template: |-
pull: $NUMBER
authors:
- $AUTHOR
template: |
**Disclaimer**: This is an automatically generated changelog draft for Jenkins weekly releases.
See https://jenkins.io/changelog/ for the official changelogs.
......@@ -24,6 +24,26 @@ template: |
```yaml
$CHANGES
```
# Categories will be commented out, because we use YAML
# Now we use categories only for sorting
categories:
- title: Major BUGs and regressions
labels:
- major-bug
- regression-fix
- title: Major RFE
label: major-rfe
- title: RFEs
label: rfe
- title: Bug fixes
label: bug
- title: Localization
label: localization
# TODO: consider merging category or changing emojis
- title: Internal/Developer changes
label: internal
replacers:
- search: '/\[*JENKINS-(\d+)\]*\s*-*\s*/g'
replace: |-
......@@ -34,3 +54,6 @@ replacers:
message: |-
issue:
replace: "issue:"
- search: "##"
replace: "#"
......@@ -11,7 +11,8 @@ def failFast = false
properties([buildDiscarder(logRotator(numToKeepStr: '50', artifactNumToKeepStr: '3')), durabilityHint('PERFORMANCE_OPTIMIZED')])
def buildTypes = ['Linux', 'Windows']
// TODO: Restore 'Windows' once https://groups.google.com/forum/#!topic/jenkinsci-dev/v9d-XosOp2s is resolved
def buildTypes = ['Linux']
def jdks = [8, 11]
def builds = [:]
......@@ -72,7 +73,9 @@ for(j = 0; j < jdks.size(); j++) {
}
}}
// TODO: Restore ATH once https://groups.google.com/forum/#!topic/jenkinsci-dev/v9d-XosOp2s is resolved
// TODO: ATH flow now supports Java 8 only, it needs to be reworked (INFRA-1690)
/*
builds.ath = {
node("docker&&highmem") {
// Just to be safe
......@@ -94,7 +97,7 @@ builds.ath = {
runATH jenkins: fileUri, metadataFile: metadataPath
}
}
}
}*/
builds.failFast = failFast
parallel builds
......
......@@ -7,7 +7,7 @@
[![Docker Pulls](https://img.shields.io/docker/pulls/jenkins/jenkins.svg)](https://hub.docker.com/r/jenkins/jenkins/)
In a nutshell, Jenkins is the leading open-source automation server.
Built with Java, it provides over 1000 plugins to support automating virtually anything,
Built with Java, it provides over 1600 [plugins](https://plugins.jenkins.io/) to support automating virtually anything,
so that humans can actually spend their time doing things machines cannot.
# What to Use Jenkins for and When to Use It
......@@ -34,32 +34,11 @@ Follow the [contributing](CONTRIBUTING.md) file.
All information about Jenkins can be found on our [website]. Follow us on Twitter [@jenkinsci].
# License
Jenkins is **licensed** under the **[MIT License]**. The terms of the license are as follows:
Jenkins is **licensed** under the **[MIT License]**.
The MIT License (MIT)
Copyright (c) 2004 Kohsuke Kawaguchi, Sun Microsystems Inc., and a number of other contributors.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
[ButlerImage]: https://jenkins.io/sites/default/files/jenkins_logo.png
[MIT License]: https://github.com/jenkinsci/jenkins/raw/master/LICENSE.txt
[MIT License]: https://github.com/jenkinsci/jenkins/blob/master/LICENSE.txt
[Mirrors]: http://mirrors.jenkins-ci.org
[GitHub]: https://github.com/jenkinsci/jenkins
[website]: https://jenkins.io/
......
......@@ -88,8 +88,8 @@ public class ExtensionComponent<T> implements Comparable<ExtensionComponent<T>>
public int compareTo(ExtensionComponent<T> that) {
double a = this.ordinal();
double b = that.ordinal();
if (a>b) return -1;
if (a<b) return 1;
if (Double.compare(a, b) > 0) return -1;
if (Double.compare(a, b) < 0) return 1;
// make the order bit more deterministic among extensions of the same ordinal
if (this.instance instanceof Descriptor && that.instance instanceof Descriptor) {
......
......@@ -1664,7 +1664,7 @@ public class Functions {
for( int i=0; i<projectName.length(); i++ ) {
char ch = projectName.charAt(i);
if(('a'<=ch && ch<='z')
|| ('z'<=ch && ch<='Z')
|| ('A'<=ch && ch<='Z')
|| ('0'<=ch && ch<='9')
|| "-_.".indexOf(ch)>=0)
buf.append(ch);
......
......@@ -1114,7 +1114,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
try(final JarFile jarFile = jarURLConnection.getJarFile()) {
final JarEntry entry = (entryName != null && jarFile != null) ? jarFile.getJarEntry(entryName) : null;
if (entry != null && jarFile != null) {
if (entry != null) {
try(InputStream i = jarFile.getInputStream(entry)) {
byte[] manifestBytes = IOUtils.toByteArray(i);
in = new ByteArrayInputStream(manifestBytes);
......
......@@ -27,7 +27,6 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.ByteArrayInputStream;
import java.io.SequenceInputStream;
import java.io.Writer;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.security.interfaces.RSAPublicKey;
import javax.annotation.Nullable;
......@@ -140,7 +139,7 @@ public final class TcpSlaveAgentListener extends Thread {
@Nullable
public String getIdentityPublicKey() {
RSAPublicKey key = InstanceIdentityProvider.RSA.getPublicKey();
return key == null ? null : new String(Base64.encodeBase64(key.getEncoded()), Charset.forName("UTF-8"));
return key == null ? null : new String(Base64.encodeBase64(key.getEncoded()), StandardCharsets.UTF_8);
}
/**
......
......@@ -866,29 +866,50 @@ public class Util {
CharBuffer buf = null;
char c;
for (int i = 0, m = s.length(); i < m; i++) {
c = s.charAt(i);
if (c > 122 || uriMap[c]) {
int codePoint = Character.codePointAt(s, i);
if((codePoint&0xffffff80)==0) { // 1 byte
c = s.charAt(i);
if (c > 122 || uriMap[c]) {
if (!escaped) {
out = new StringBuilder(i + (m - i) * 3);
out.append(s, 0, i);
enc = StandardCharsets.UTF_8.newEncoder();
buf = CharBuffer.allocate(1);
escaped = true;
}
// 1 char -> UTF8
buf.put(0, c);
buf.rewind();
try {
ByteBuffer bytes = enc.encode(buf);
while (bytes.hasRemaining()) {
byte b = bytes.get();
out.append('%');
out.append(toDigit((b >> 4) & 0xF));
out.append(toDigit(b & 0xF));
}
} catch (CharacterCodingException ex) {
}
} else if (escaped) {
out.append(c);
}
} else {
if (!escaped) {
out = new StringBuilder(i + (m - i) * 3);
out.append(s, 0, i);
enc = StandardCharsets.UTF_8.newEncoder();
buf = CharBuffer.allocate(1);
escaped = true;
}
// 1 char -> UTF8
buf.put(0,c);
buf.rewind();
try {
ByteBuffer bytes = enc.encode(buf);
while (bytes.hasRemaining()) {
byte b = bytes.get();
out.append('%');
out.append(toDigit((b >> 4) & 0xF));
out.append(toDigit(b & 0xF));
}
} catch (CharacterCodingException ex) { }
} else if (escaped) {
out.append(c);
byte[] bytes = new String(new int[] { codePoint }, 0, 1).getBytes(StandardCharsets.UTF_8);
for(int j=0;j<bytes.length;j++) {
out.append('%');
out.append(toDigit((bytes[j] >> 4) & 0xF));
out.append(toDigit(bytes[j] & 0xF));
}
if(Character.charCount(codePoint) > 1) {
i++; // we processed two characters
}
}
}
return escaped ? out.toString() : s;
......
package hudson.cli;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Extension;
import hudson.model.Job;
import hudson.model.Run;
......@@ -9,6 +10,9 @@ import java.io.Serializable;
import org.apache.commons.io.IOUtils;
import org.kohsuke.args4j.Argument;
// TODO: Remove Serializable
@SuppressFBWarnings(value = "SE_NO_SERIALVERSIONID", justification = "The Serializable should be removed.")
@Extension
public class SetBuildDescriptionCommand extends CLICommand implements Serializable {
......
......@@ -275,6 +275,11 @@ public abstract class AbstractItem extends Actionable implements Item, HttpDelet
*/
@Restricted(NoExternalUse.class)
public @Nonnull FormValidation doCheckNewName(@QueryParameter String newName) {
if (!isNameEditable()) {
return FormValidation.error("Trying to rename an item that does not support this operation.");
}
// TODO: Create an Item.RENAME permission to use here, see JENKINS-18649.
if (!hasPermission(Item.CONFIGURE)) {
if (parent instanceof AccessControlled) {
......@@ -351,6 +356,11 @@ public abstract class AbstractItem extends Actionable implements Item, HttpDelet
* you can use this method.
*/
protected void renameTo(final String newName) throws IOException {
if (!isNameEditable()) {
throw new IOException("Trying to rename an item that does not support this operation.");
}
// always synchronize from bigger objects first
final ItemGroup parent = getParent();
String oldName = this.name;
......
......@@ -67,6 +67,7 @@ import org.kohsuke.stapler.StaplerResponse;
public class FileParameterValue extends ParameterValue {
private static final String FOLDER_NAME = "fileParameters";
private static final Pattern PROHIBITED_DOUBLE_DOT = Pattern.compile(".*[\\\\/]\\.\\.[\\\\/].*");
private static final long serialVersionUID = -143427023159076073L;
/**
* Escape hatch for SECURITY-1074, fileParameter used to escape their expected folder.
......
......@@ -63,6 +63,8 @@ public class HealthReport implements Serializable, Comparable<HealthReport> {
private static final String HEALTH_UNKNOWN_IMG = "empty.png";
private static final Map<String, String> iconIMGToClassMap = new HashMap<>();
private static final long serialVersionUID = 7451361788415642230L;
static {
iconIMGToClassMap.put(HEALTH_OVER_80_IMG, HEALTH_OVER_80);
iconIMGToClassMap.put(HEALTH_61_TO_80_IMG, HEALTH_61_TO_80);
......
......@@ -64,6 +64,7 @@ public final class JDK extends ToolInstallation implements NodeSpecific<JDK>, En
* @since 1.577
*/
public static final String DEFAULT_NAME = "(System)";
private static final long serialVersionUID = -3318291200160313357L;
@Restricted(NoExternalUse.class)
public static boolean isDefaultName(String name) {
......
......@@ -132,7 +132,7 @@ public class StringParameterDefinition extends SimpleParameterDefinition {
public ParameterValue createValue(String str) {
StringParameterValue value = new StringParameterValue(getName(), str, getDescription());
if (isTrim() && value!=null) {
if (isTrim()) {
value.doTrim();
}
return value;
......
......@@ -262,13 +262,11 @@ public class User extends AbstractModelObject implements AccessControlled, Descr
return id;
}
public @Nonnull
String getUrl() {
public @Nonnull String getUrl() {
return "user/" + Util.rawEncode(idStrategy().keyFor(id));
}
public @Nonnull
String getSearchUrl() {
public @Nonnull String getSearchUrl() {
return "/user/" + Util.rawEncode(idStrategy().keyFor(id));
}
......@@ -276,8 +274,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr
* The URL of the user page.
*/
@Exported(visibility = 999)
public @Nonnull
String getAbsoluteUrl() {
public @Nonnull String getAbsoluteUrl() {
return Jenkins.get().getRootUrl() + getUrl();
}
......@@ -286,8 +283,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr
* This is configurable by the user.
*/
@Exported(visibility = 999)
public @Nonnull
String getFullName() {
public @Nonnull String getFullName() {
return fullName;
}
......@@ -301,8 +297,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr
}
@Exported
public @CheckForNull
String getDescription() {
public @CheckForNull String getDescription() {
return description;
}
......@@ -370,8 +365,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr
* @throws UsernameNotFoundException If this user is not a valid user in the backend {@link SecurityRealm}.
* @since 1.419
*/
public @Nonnull
Authentication impersonate() throws UsernameNotFoundException {
public @Nonnull Authentication impersonate() throws UsernameNotFoundException {
return this.impersonate(this.getUserDetailsForImpersonation());
}
......@@ -384,8 +378,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr
* @return userDetails for the user, in case he's not found but seems legitimate, we provide a userDetails with minimum access
* @throws UsernameNotFoundException If this user is not a valid user in the backend {@link SecurityRealm}.
*/
public @Nonnull
UserDetails getUserDetailsForImpersonation() throws UsernameNotFoundException {
public @Nonnull UserDetails getUserDetailsForImpersonation() throws UsernameNotFoundException {
ImpersonatingUserDetailsService userDetailsService = new ImpersonatingUserDetailsService(
Jenkins.get().getSecurityRealm().getSecurityComponents().userDetails
);
......@@ -431,8 +424,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr
* @see #getUserDetailsForImpersonation()
*/
@Restricted(NoExternalUse.class)
public @Nonnull
Authentication impersonate(@Nonnull UserDetails userDetails) {
public @Nonnull Authentication impersonate(@Nonnull UserDetails userDetails) {
return new UsernamePasswordAuthenticationToken(userDetails.getUsername(), "", userDetails.getAuthorities());
}
......@@ -470,8 +462,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr
* @deprecated use {@link User#get(String, boolean, java.util.Map)}
*/
@Deprecated
public static @Nullable
User get(String idOrFullName, boolean create) {
public static @Nullable User get(String idOrFullName, boolean create) {
return get(idOrFullName, create, Collections.emptyMap());
}
......@@ -491,8 +482,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr
* @return An existing or created user. May be {@code null} if a user does not exist and
* {@code create} is false.
*/
public static @Nullable
User get(String idOrFullName, boolean create, @Nonnull Map context) {
public static @Nullable User get(String idOrFullName, boolean create, @Nonnull Map context) {
if (idOrFullName == null) {
return null;
}
......@@ -512,8 +502,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr
* @return An existing or created user. May be {@code null} if a user does not exist and
* {@code create} is false.
*/
private static @Nullable
User getOrCreateById(@Nonnull String id, @Nonnull String fullName, boolean create) {
private static @Nullable User getOrCreateById(@Nonnull String id, @Nonnull String fullName, boolean create) {
User u = AllUsers.get(id);
if (u == null && (create || UserIdMapper.getInstance().isMapped(id))) {
u = new User(id, fullName);
......@@ -546,8 +535,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr
* Otherwise use {@link #getOrCreateByIdOrFullName(String)} or {@link #get(String, boolean, Map)}.
*/
@Deprecated
public static @Nonnull
User get(String idOrFullName) {
public static @Nonnull User get(String idOrFullName) {
return getOrCreateByIdOrFullName(idOrFullName);
}
......@@ -577,8 +565,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr
*
* @since 1.172
*/
public static @CheckForNull
User current() {
public static @CheckForNull User current() {
return get(Jenkins.getAuthentication());
}
......@@ -590,8 +577,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr
* @return a {@link User} object for the supplied {@link Authentication} or {@code null}
* @since 1.609
*/
public static @CheckForNull
User get(@CheckForNull Authentication a) {
public static @CheckForNull User get(@CheckForNull Authentication a) {
if (a == null || a instanceof AnonymousAuthenticationToken)
return null;
......@@ -610,16 +596,14 @@ public class User extends AbstractModelObject implements AccessControlled, Descr
* and the user does not exist.
* @since 1.651.2 / 2.3
*/
public static @Nullable
User getById(String id, boolean create) {
public static @Nullable User getById(String id, boolean create) {
return getOrCreateById(id, id, create);
}
/**
* Gets all the users.
*/
public static @Nonnull
Collection<User> getAll() {
public static @Nonnull Collection<User> getAll() {
final IdStrategy strategy = idStrategy();
ArrayList<User> users = new ArrayList<>(AllUsers.values());
users.sort((o1, o2) -> strategy.compare(o1.getId(), o2.getId()));
......@@ -657,8 +641,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr
/**
* Returns the user name.
*/
public @Nonnull
String getDisplayName() {
public @Nonnull String getDisplayName() {
return getFullName();
}
......@@ -686,8 +669,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr
*/
@SuppressWarnings("unchecked")
@WithBridgeMethods(List.class)
public @Nonnull
RunList getBuilds() {
public @Nonnull RunList getBuilds() {
return RunList.fromJobs((Iterable) Jenkins.get().
allItems(Job.class)).filter((Predicate<Run<?, ?>>) r -> r instanceof AbstractBuild && relatedTo((AbstractBuild<?, ?>) r));
}
......@@ -697,8 +679,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr
*
* @since 1.191
*/
public @Nonnull
Set<AbstractProject<?, ?>> getProjects() {
public @Nonnull Set<AbstractProject<?, ?>> getProjects() {
Set<AbstractProject<?, ?>> r = new HashSet<>();
for (AbstractProject<?, ?> p : Jenkins.get().allItems(AbstractProject.class))
if (p.hasParticipant(this))
......@@ -706,8 +687,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr
return r;
}
public @Override
String toString() {
public @Override String toString() {
return fullName;
}
......@@ -945,8 +925,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr
* @return a possibly empty list
* @since 1.498
*/
public @Nonnull
List<String> getAuthorities() {
public @Nonnull List<String> getAuthorities() {
if (!Jenkins.get().hasPermission(Jenkins.ADMINISTER)) {
return Collections.emptyList();
}
......@@ -1136,8 +1115,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr
* extract user ID from idOrFullName with help from contextual infos.
* can return <code>null</code> if no user ID matched the input
*/
public abstract @CheckForNull
String resolveCanonicalId(String idOrFullName, Map<String, ?> context);
public abstract @CheckForNull String resolveCanonicalId(String idOrFullName, Map<String, ?> context);
/**
* Gets priority of the resolver.
......
......@@ -105,16 +105,16 @@ public class HudsonAuthenticationEntryPoint extends AuthenticationProcessingFilt
"<meta http-equiv='refresh' content='1;url=%1$s'/>" +
"<script>window.location.replace('%1$s');</script>" +
"</head>" +
"<body style='background-color:white; color:white;'>\n" +
"\n\n"+
"Authentication required\n"+
"<!--\n",loginForm);
"<body style='background-color:white; color:white;'>%n" +
"%n%n"+
"Authentication required%n"+
"<!--%n",loginForm);
if (cause!=null)
cause.report(out);
out.printf(
"-->\n\n"+
"-->%n%n"+
"</body></html>");
// Turn Off "Show Friendly HTTP Error Messages" Feature on the Server Side.
// See http://support.microsoft.com/kb/294807
......
......@@ -5,7 +5,7 @@
*/
package hudson.security.csrf;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.logging.Level;
......@@ -49,14 +49,8 @@ public class DefaultCrumbIssuer extends CrumbIssuer {
@DataBoundConstructor
public DefaultCrumbIssuer(boolean excludeClientIPFromCrumb) {
try {
this.md = MessageDigest.getInstance("MD5");
this.excludeClientIPFromCrumb = excludeClientIPFromCrumb;
} catch (NoSuchAlgorithmException e) {
this.md = null;
this.excludeClientIPFromCrumb = false;
LOGGER.log(Level.SEVERE, "Can't find MD5", e);
}
this.excludeClientIPFromCrumb = excludeClientIPFromCrumb;
initializeMessageDigest();
}
public boolean isExcludeClientIPFromCrumb() {
......@@ -64,14 +58,17 @@ public class DefaultCrumbIssuer extends CrumbIssuer {
}
private Object readResolve() {
initializeMessageDigest();
return this;
}
private void initializeMessageDigest() {
try {
this.md = MessageDigest.getInstance("MD5");
md = MessageDigest.getInstance("SHA-256");
} catch (NoSuchAlgorithmException e) {
this.md = null;
LOGGER.log(Level.SEVERE, "Can't find MD5", e);
md = null;
LOGGER.log(Level.SEVERE, e, () -> "Cannot find SHA-256 MessageDigest implementation.");
}
return this;
}
/**
......@@ -110,8 +107,8 @@ public class DefaultCrumbIssuer extends CrumbIssuer {
String newCrumb = issueCrumb(request, salt);
if ((newCrumb != null) && (crumb != null)) {
// String.equals() is not constant-time, but this is
return MessageDigest.isEqual(newCrumb.getBytes(Charset.forName("US-ASCII")),
crumb.getBytes(Charset.forName("US-ASCII")));
return MessageDigest.isEqual(newCrumb.getBytes(StandardCharsets.US_ASCII),
crumb.getBytes(StandardCharsets.US_ASCII));
}
}
return false;
......
......@@ -26,6 +26,7 @@ package hudson.slaves;
import hudson.AbortException;
import hudson.FilePath;
import hudson.Functions;
import hudson.Main;
import hudson.RestrictedSince;
import hudson.Util;
import hudson.console.ConsoleLogFilter;
......@@ -87,6 +88,8 @@ import java.security.Security;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.concurrent.Future;
import java.util.logging.Handler;
import java.util.logging.Level;
......@@ -902,6 +905,32 @@ public class SlaveComputer extends Computer {
return channel.call(new DetectOS()) ? "Unix" : "Windows";
}
/**
* Expose real full env vars map from agent for UI presentation
*/
public Map<String,String> getEnvVarsFull() throws IOException, InterruptedException {
if(getChannel() == null) {
Map<String, String> env = new TreeMap<> ();
env.put("N/A","N/A");
return env;
} else {
return getChannel().call(new ListFullEnvironment());
}
}
private static class ListFullEnvironment extends MasterToSlaveCallable<Map<String,String>,IOException> {
public Map<String,String> call() throws IOException {
Map<String, String> env = new TreeMap<>(System.getenv());
if(Main.isUnitTest || Main.isDevelopmentMode) {
// if unit test is launched with maven debug switch,
// we need to prevent forked Maven processes from seeing it, or else
// they'll hang
env.remove("MAVEN_OPTS");
}
return env;
}
}
private static final Logger logger = Logger.getLogger(SlaveComputer.class.getName());
private static final class SlaveVersion extends MasterToSlaveCallable<String,IOException> {
......
......@@ -353,7 +353,13 @@ public class ArgumentListBuilder implements Serializable, Cloneable {
percent = (c == '%');
if (quoted) quotedArgs.append(c);
}
if(i == 0 && quoted) quotedArgs.insert(0, '"'); else if (i == 0 && !quoted) quotedArgs.append('"');
if (i == 0) {
if (quoted) {
quotedArgs.insert(0, '"');
} else {
quotedArgs.append('"');
}
}
if (quoted) quotedArgs.append('"'); else quotedArgs.append(arg);
windowsCommand.add(quotedArgs, mask.get(i));
......
......@@ -33,7 +33,7 @@ import javax.annotation.Nonnull;
import javax.servlet.ServletException;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Map;
/**
......@@ -142,8 +142,6 @@ public class HttpResponses extends org.kohsuke.stapler.HttpResponses {
*/
static class JSONObjectResponse implements HttpResponse {
private static final Charset UTF8 = Charset.forName("UTF-8");
private final JSONObject jsonObject;
/**
......@@ -210,7 +208,7 @@ public class HttpResponses extends org.kohsuke.stapler.HttpResponses {
*/
@Override
public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException {
byte[] bytes = jsonObject.toString().getBytes(UTF8);
byte[] bytes = jsonObject.toString().getBytes(StandardCharsets.UTF_8);
rsp.setContentType("application/json; charset=UTF-8");
rsp.setContentLength(bytes.length);
rsp.getOutputStream().write(bytes);
......
......@@ -197,7 +197,7 @@ public class SecretRewriter {
}
private static boolean isBase64(char ch) {
return 0<=ch && ch<128 && IS_BASE64[ch];
return ch<128 && IS_BASE64[ch];
}
private static boolean isBase64(String s) {
......
......@@ -30,6 +30,7 @@ import java.nio.charset.CharsetDecoder;
import java.nio.charset.CodingErrorAction;
import java.nio.charset.CoderResult;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.charset.UnsupportedCharsetException;
import java.nio.*;
......@@ -127,7 +128,7 @@ public class WriterOutputStream extends OutputStream {
String encoding = System.getProperty("file.encoding");
return Charset.forName(encoding);
} catch (UnsupportedCharsetException e) {
return Charset.forName("UTF-8");
return StandardCharsets.UTF_8;
}
}
}
......@@ -70,7 +70,7 @@ import java.io.Writer;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
......@@ -308,7 +308,7 @@ public class XStream2 extends XStream {
* @since 1.504
*/
public void toXMLUTF8(Object obj, OutputStream out) throws IOException {
Writer w = new OutputStreamWriter(out, Charset.forName("UTF-8"));
Writer w = new OutputStreamWriter(out, StandardCharsets.UTF_8);
w.write("<?xml version=\"1.1\" encoding=\"UTF-8\"?>\n");
toXML(obj, w);
}
......
......@@ -3,10 +3,14 @@ package jenkins.model;
import hudson.Extension;
import hudson.model.UnprotectedRootAction;
import java.util.concurrent.TimeUnit;
import org.apache.commons.lang.StringUtils;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
......@@ -74,7 +78,11 @@ public class AssetManager implements UnprotectedRootAction {
* look for child classloader first. But to support plugins that get split, if the child classloader
* doesn't find it, fall back to the parent classloader.
*/
private URL findResource(String path) throws IOException {
private @CheckForNull URL findResource(@Nonnull String path) throws IOException {
if (StringUtils.isBlank(path)) {
return null;
}
try {
if (path.contains("..")) // crude avoidance of directory traversal attack
throw new IllegalArgumentException(path);
......
......@@ -3836,10 +3836,10 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
}
@RequirePOST
public synchronized HttpRedirect doQuietDown() throws IOException {
public synchronized HttpRedirect doQuietDown() {
try {
return doQuietDown(false,0);
} catch (InterruptedException e) {
} catch (IOException | InterruptedException e) {
throw new AssertionError(); // impossible
}
}
......
......@@ -210,7 +210,7 @@ public class HistoryPageFilter<T> {
}
}
}
} else if (olderThan != null) {
} else {
Iterator<ItemT> iter = items.iterator();
while (iter.hasNext()) {
Object item = iter.next();
......
# The MIT License
#
# Copyright (c) 2016-2017, Damian Szczepanik
# Copyright (c) 2016-2019, Damian Szczepanik
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......@@ -33,3 +33,4 @@ AboutJenkins.DisplayName=Informacje o Jenkinsie
AboutJenkins.Description=Sprawd\u017A wersj\u0119 i licencj\u0119
# {0} v{1} is missing. To fix, install v{1} or later.
PluginWrapper.missing=Brakuje wtyczki {0} w wersji {1}. Aby rozwi\u0105za\u0107 problem, zainstaluj wersj\u0119 {1} lub wy\u017Csz\u0105.
PluginWrapper.failed_to_load_dependency=Nie uda\u0142o si\u0119 za\u0142adowa\u0107 wtyczki {0} o wersji {1}. Rozwi\u0105\u017C ten problem w pierwszej kolejno\u015Bci.
\ No newline at end of file
# The MIT License
#
# Copyright (c) 2004-2010, Sun Microsystems, Inc.
# Copyright (c) 2004-2019, Sun Microsystems, Inc., Damian Szczepanik
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......@@ -21,7 +21,8 @@
# THE SOFTWARE.
All=Wszystkie
None=\u017Badnej
None=\u017Badne
Select=Zaznacz
UpdatePageDescription=Ta strona zawiera aktualizacje wtyczek, kt\u00F3rych aktualnie u\u017Cywasz
UpdatePageLegend=Nieaktywne wiersze oznaczaj\u0105 ju\u017C wykonane aktualizacje, czekaj\u0105ce na restart. Zacieniowane ale aktywne wiersze s\u0105 <a href="{0}">w trakcie aktualizacji lub zako\u0144czy\u0142y si\u0119 b\u0142\u0119dnie</a>.
Compatible=Kompatybilne
# The MIT License
#
# Copyright (c) 2004-2017, Sun Microsystems, Inc., Damian Szczepanik
# Copyright (c) 2004-2019, Sun Microsystems, Inc., Damian Szczepanik
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......@@ -32,4 +32,6 @@ Name=Nazwa
No\ updates=Brak dost\u0119pnych aktualizacji
Version=Wersja
coreWarning=UWAGA: Ten dodatek jest przygotowany dla Jenkinsa w wersji {0} lub nowszej. Mo\u017Ce nie dzia\u0142a\u0107 poprawnie z Twoj\u0105 wersj\u0105 Jenkinsa.
Update\ Center=Centrum aktualizacji
\ No newline at end of file
Update\ Center=Centrum aktualizacji
securityWarning= \
Ostrze\u017Cenie: Ta wtyczka mo\u017Ce nie by\u0107 bezpieczna. Sprawd\u017A nast\u0119puj\u0105ce ostrze\u017Cenia dotycz\u0105ce bezpiecze\u0144stwa:
# The MIT License
#
# Copyright (c) 2016, Damian Szczepanik
# Copyright (c) 2016-2019, Damian Szczepanik
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......@@ -21,3 +21,5 @@
# THE SOFTWARE.
Correct=Napraw
Dependency\ errors=Wyst\u0105pi\u0142y b\u0142\u0119dy podczas \u0142adowania niekt\u00F3rych wtyczek
blurbOriginal=Niekt\u00F3re wtyczki nie mog\u0142y zosta\u0107 za\u0142adowane z powodu niewystarczaj\u0105cych zale\u017Cno\u015Bci. Rozwi\u0105\u017C te problemy i uruchom ponownie Jenkinsa, aby korzysta\u0107 z funkcjonalno\u015Bci oferowanych przez te wtyczki.
blurbDerived=Nast\u0119puj\u0105ce wtyczki nie mog\u0142y zosta\u0107 za\u0142adowane z powodu problem\u00F3w wymienionych wy\u017Cej. Rozwi\u0105\u017C je, a wtyczki zostan\u0105 za\u0142adowane ponownie.
......@@ -23,38 +23,39 @@ THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler"><st:contentType value="application/atom+xml;charset=UTF-8" /><!-- No whitespace before xml header: -->&lt;?xml version="1.0" encoding="UTF-8"?&gt;
<!-- ATOM. See http://atompub.org/rfc4287.html for the format -->
<feed xmlns="http://www.w3.org/2005/Atom">
<title>${title}</title>
<link rel="alternate" type="text/html" href="${rootURL}${url}"/>
<j:choose>
<j:when test="${empty(entries)}">
<updated>2001-01-01T00:00:00Z</updated>
</j:when>
<j:otherwise>
<updated>${h.xsDate(adapter.getEntryTimestamp(entries[0]))}</updated>
</j:otherwise>
</j:choose>
<author>
<name>Jenkins Server</name>
</author>
<id>urn:uuid:903deee0-7bfa-11db-9fe1-0800200c9a66</id>
<j:forEach var="e" items="${entries}" >
<entry>
<title>${adapter.getEntryTitle(e)}</title>
<link rel="alternate" type="text/html" href="${rootURL}${h.encode(adapter.getEntryUrl(e))}"/>
<id>${adapter.getEntryID(e)}</id>
<published>${h.xsDate(adapter.getEntryTimestamp(e))}</published>
<updated>${h.xsDate(adapter.getEntryTimestamp(e))}</updated>
<j:set var="desc" value="${adapter.getEntryDescription(e)}"/>
<j:if test="${desc!=null}">
<content>${desc}</content>
</j:if>
</entry>
</j:forEach>
</feed>
<j:jelly xmlns:j="jelly:core" xmlns:l="/lib/layout">
<l:view contentType="application/atom+xml;charset=UTF-8"><!-- No whitespace before xml header: -->&lt;?xml version="1.0" encoding="UTF-8"?&gt;
<!-- ATOM. See http://atompub.org/rfc4287.html for the format -->
<feed xmlns="http://www.w3.org/2005/Atom">
<title>${title}</title>
<link rel="alternate" type="text/html" href="${rootURL}${url}"/>
<j:choose>
<j:when test="${empty(entries)}">
<updated>2001-01-01T00:00:00Z</updated>
</j:when>
<j:otherwise>
<updated>${h.xsDate(adapter.getEntryTimestamp(entries[0]))}</updated>
</j:otherwise>
</j:choose>
<author>
<name>Jenkins Server</name>
</author>
<id>urn:uuid:903deee0-7bfa-11db-9fe1-0800200c9a66</id>
<j:forEach var="e" items="${entries}" >
<entry>
<title>${adapter.getEntryTitle(e)}</title>
<link rel="alternate" type="text/html" href="${rootURL}${h.encode(adapter.getEntryUrl(e))}"/>
<id>${adapter.getEntryID(e)}</id>
<published>${h.xsDate(adapter.getEntryTimestamp(e))}</published>
<updated>${h.xsDate(adapter.getEntryTimestamp(e))}</updated>
<j:set var="desc" value="${adapter.getEntryDescription(e)}"/>
<j:if test="${desc!=null}">
<content>${desc}</content>
</j:if>
</entry>
</j:forEach>
</feed>
</l:view>
</j:jelly>
# The MIT License
#
# Copyright (c) 2016 Damian Szczepanik
# Copyright (c) 2016-2019 Damian Szczepanik
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......@@ -21,3 +21,5 @@
# THE SOFTWARE.
OldDataMonitor.DisplayName=Zarz\u0105dzanie starymi danymi
OldDataMonitor.Description=Usuwanie danych po nieu\u017Cywanych lub starszych wersjach wtyczek.
HudsonHomeDiskUsageMonitor.DisplayName=Monitoring zu\u017Cycia dysku
TooManyJobsButNoView.DisplayName=Zbyt wiele projekt\u00F3w jest nie przypisanych do widok\u00F3w
# The MIT License
#
# Copyright (c) 2019, Damian Szczepanik
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
Rename=Zmie\u0144 nazw\u0119
DescribeRename=Zmie\u0144 nazw\u0119 {0}
NewName=Nowa nazwa
......@@ -80,3 +80,5 @@ Hudson.ViewName=Wszystkie
RunParameterDefinition.DisplayName=Parametr uruchomienia# SCM check out aborted
Hudson.JobAlreadyExists=Projekt o nazwie \u2018{0}\u2019 ju\u017C istnieje
AbstractProject.CustomWorkspaceEmpty=Nie wprowadzono dedykowanego katalogu projektu.
AbstractItem.NewNameUnchanged=Nowa nazwa jest taka sama, jak aktualna.
Hudson.NoName=Nazwa nie zosta\u0142a podana
# The MIT License
#
# Copyright (c) 2019, Damian Szczepanik
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
Pending=W trakcie
# The MIT License
#
# Copyright (c) 2019, Damian Szczepanik
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
Success=Sukces
# The MIT License
#
# Copyright (c) 2019, Damian Szczepanik
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
Loading\ plugin\ extensions=\u0141adowanie wtyczki
# The MIT License
#
# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors
# Copyright (c) 2004-2019, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......@@ -23,7 +23,6 @@
Name=Nazwa
On=Na
People=U\u017Cytkownicy
User\ Id=Identyfikator u\u017Cytkownika
User\ ID=Identyfikator u\u017Cytkownika
Last\ Commit\ Activity=Ostatnia zmiana
blurb=Prezentuje wszystkich uwierzytelnionych u\u017Cytkownik\u00F3w w\u0142\u0105cznie z identyfikatorem oraz osoby wymienione w opisach zarejestrowanych zmian.
......@@ -23,28 +23,29 @@ THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler"><st:contentType value="text/xml;charset=UTF-8" /><!-- No whitespace before xml header: -->&lt;?xml version="1.0" encoding="UTF-8"?&gt;
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout">
<l:view contentType="text/xml;charset=UTF-8"><!-- No whitespace before xml header: -->&lt;?xml version="1.0" encoding="UTF-8"?&gt;
<!-- RSS 2.0 feed. See http://cyber.law.harvard.edu/rss/rss.html for the format -->
<rss version="2.0">
<channel>
<title>${title}</title>
<link>${rootURL}${url}</link>
<description>${title}</description>
<!-- RSS 2.0 feed. See http://cyber.law.harvard.edu/rss/rss.html for the format -->
<rss version="2.0">
<channel>
<title>${title}</title>
<link>${rootURL}${url}</link>
<description>${title}</description>
<j:forEach var="e" items="${entries}" >
<item>
<title>${adapter.getEntryTitle(e)}</title>
<link>${rootURL}${h.encode(adapter.getEntryUrl(e))}</link>
<guid isPermaLink="false">${adapter.getEntryID(e)}</guid>
<pubDate>${h.rfc822Date(adapter.getEntryTimestamp(e))}</pubDate>
<author><st:out value="${adapter.getEntryAuthor(e)}"/></author>
<j:set var="desc" value="${adapter.getEntryDescription(e)}"/>
<j:if test="${desc!=null}">
<description>${desc}</description>
</j:if>
</item>
</j:forEach>
</channel>
</rss>
<j:forEach var="e" items="${entries}" >
<item>
<title>${adapter.getEntryTitle(e)}</title>
<link>${rootURL}${h.encode(adapter.getEntryUrl(e))}</link>
<guid isPermaLink="false">${adapter.getEntryID(e)}</guid>
<pubDate>${h.rfc822Date(adapter.getEntryTimestamp(e))}</pubDate>
<author><st:out value="${adapter.getEntryAuthor(e)}"/></author>
<j:set var="desc" value="${adapter.getEntryDescription(e)}"/>
<j:if test="${desc!=null}">
<description>${desc}</description>
</j:if>
</item>
</j:forEach>
</channel>
</rss>
</l:view>
</j:jelly>
......@@ -29,7 +29,7 @@ ComputerLauncher.UnknownJavaVersion=Konnte Java-Version von {0} nicht bestimmen.
ConnectionActivityMonitor.OfflineCause=Ping-Versuche scheiterten wiederholt
DumbSlave.displayName=Statischer Agent
EnvironmentVariablesNodeProperty.displayName=Umgebungsvariablen
JNLPLauncher.displayName=Agent via Java Web Start starten
JNLPLauncher.displayName=Agent \u00FCber eine Verbindung zum Master-Knoten starten
NodeDescriptor.CheckName.Mandatory=Name ist ein Pflichtfeld.
NodeProvisioner.EmptyString=
OfflineCause.connection_was_broken_=Verbindung wurde unterbrochen: {0}
......
......@@ -49,7 +49,6 @@
{ "name": "github-branch-source", "suggested": true, "added": "2.0" },
{ "name": "pipeline-github-lib", "suggested": true, "added": "2.0" },
{ "name": "pipeline-stage-view", "suggested": true, "added": "2.0" },
{ "name": "build-pipeline-plugin" },
{ "name": "conditional-buildstep" },
{ "name": "jenkins-multijob-plugin" },
{ "name": "parameterized-trigger" },
......
......@@ -20,5 +20,5 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
description=Der JNLP-Agent-Port wurde ver\u00E4ndert, obwohl er durch die System-Eigenschaft {0} beim Start festgelegt wurde. Der Wert wird beim Neustart auf {1,number,#} zur\u00FCckgesetzt.
description=Der TCP-Agent-Port wurde ver\u00E4ndert, obwohl er durch die System-Eigenschaft {0} beim Start festgelegt wurde. Der Wert wird beim Neustart auf {1,number,#} zur\u00FCckgesetzt.
reset=Auf {0,number,#} zur\u00FCcksetzen
# The MIT License
#
# Copyright (c) 2019 Damian Szczepanik
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
Rename=Zmie\u0144 nazw\u0119
# The MIT License
#
# Copyright (c) 2019 Damian Szczepanik
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
NoTokenYet=Nie ma zarejestrowanych token\u00F3w dla tego u\u017Cytkownika
CurrentTokens=Aktualny token
AddNewToken=Dodaj nowy token
# The MIT License
#
# Copyright (c) 2019, Damian Szczepanik
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
resetSeed.button=Zako\u0144cz wszystkie sesje
resetSeed.result=Operacja zako\u0144czona pomy\u015Blnie. Wszystkie sesje zako\u0144czone.
resetSeed.confirmation=Wszystkie aktywne sesje zostan\u0105 zako\u0144czone. \n\
B\u0119dzie wymagane ponowne zalogowanie si\u0119. \n\
Czy kontynuowa\u0107?
......@@ -29,5 +29,5 @@ THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<t:propertyTable items="${it.envVars}" />
<t:propertyTable items="${it.envVarsFull}" />
</j:jelly>
\ No newline at end of file
# This file is under the MIT License by authors
configuration=konfiguracja
configuration=Konfiguracja
......@@ -24,6 +24,7 @@
margin: 0;
height: 2em;
border-bottom: 1px solid #d3d7cf;
display:block;
}
#breadcrumbs LI {
......@@ -31,6 +32,7 @@
line-height:2em;
height: 2em;
color:#555753;
display:inline-block;
}
#breadcrumbs LI A {
......@@ -46,6 +48,12 @@
#breadcrumbs LI A:link, #breadcrumbs LI A:visited {
text-decoration:none;
color:#555753;
display: block;
max-width: 1330px;
float: left;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
#breadcrumbs LI A:hover, #crumbs LI A:focus {
......
......@@ -21,5 +21,5 @@
# THE SOFTWARE.
Page\ generated=P\u00E1gina generada
logout=Volver al proyecto
logout=Desconectar
search=Buscar
......@@ -158,6 +158,7 @@ public class UtilTest {
" \"#%/:;<>?", "%20%22%23%25%2F%3A%3B%3C%3E%3F",
"[\\]^`{|}~", "%5B%5C%5D%5E%60%7B%7C%7D%7E",
"d\u00E9velopp\u00E9s", "d%C3%A9velopp%C3%A9s",
"Foo \uD800\uDF98 Foo", "Foo%20%F0%90%8E%98%20Foo"
};
for (int i = 0; i < data.length; i += 2) {
assertEquals("test " + i, data[i + 1], Util.rawEncode(data[i]));
......
......@@ -5,10 +5,13 @@ package hudson.model;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;
import java.io.IOException;
import java.util.Collection;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
/**
* @author kingfai
......@@ -91,4 +94,60 @@ public class AbstractItemTest {
assertEquals(displayName, i.getDisplayNameOrNull());
assertEquals(displayName, i.getDisplayName());
}
private class NameNotEditableItem extends AbstractItem {
protected NameNotEditableItem(ItemGroup parent, String name){
super(parent, name);
}
@Override
public Collection<? extends Job> getAllJobs() {
return null;
}
@Override
public boolean isNameEditable() {
return false; //so far it's the default value, but it's good to be explicit for test.
}
}
@Test
@Issue("JENKINS-58571")
public void renameMethodShouldThrowExceptionWhenNotIsNameEditable() {
//GIVEN
NameNotEditableItem item = new NameNotEditableItem(null,"NameNotEditableItem");
//WHEN
try {
item.renameTo("NewName");
fail("An item with isNameEditable false must throw exception when trying to rename it.");
} catch (IOException e) {
//THEN
assertEquals(e.getMessage(),"Trying to rename an item that does not support this operation.");
assertEquals("NameNotEditableItem",item.getName());
}
}
@Test
@Issue("JENKINS-58571")
public void doConfirmRenameMustThrowFormFailureWhenNotIsNameEditable() throws IOException {
//GIVEN
NameNotEditableItem item = new NameNotEditableItem(null,"NameNotEditableItem");
//WHEN
try {
item.doConfirmRename("MyNewName");
fail("An item with isNameEditable false must throw exception when trying to call doConfirmRename.");
} catch (Failure f) {
//THEN
assertEquals(f.getMessage(),"Trying to rename an item that does not support this operation.");
assertEquals("NameNotEditableItem",item.getName());
}
}
}
package hudson.model;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.io.ByteArrayOutputStream;
......@@ -58,7 +59,9 @@ public class TaskActionTest {
Thread.sleep(10);
}
ByteArrayOutputStream os = new ByteArrayOutputStream();
annotatedText.writeLogTo(0, os);
final long length = annotatedText.writeLogTo(0, os);
// Windows based systems will be 220, linux base 219
assertTrue("length should be longer or even 219", length >= 219);
assertTrue(os.toString("UTF-8").startsWith("a linkCompleted"));
}
}
......@@ -83,7 +83,7 @@ public class AtomicFileWriterTest {
final Path childFileInSymlinkToDir = Paths.get(zeSymlink.toString(), "childFileInSymlinkToDir");
new AtomicFileWriter(childFileInSymlinkToDir, Charset.forName("UTF-8"));
new AtomicFileWriter(childFileInSymlinkToDir, StandardCharsets.UTF_8);
}
@Test
......@@ -154,7 +154,7 @@ public class AtomicFileWriterTest {
assertFalse(parentExistsAndIsAFile.exists());
try {
new AtomicFileWriter(parentExistsAndIsAFile.toPath(), Charset.forName("UTF-8"));
new AtomicFileWriter(parentExistsAndIsAFile.toPath(), StandardCharsets.UTF_8);
fail("Expected a failure");
} catch (IOException e) {
assertThat(e.getMessage(),
......
......@@ -76,7 +76,7 @@ THE SOFTWARE.
</issueManagement>
<properties>
<revision>2.190</revision>
<revision>2.192</revision>
<changelist>-SNAPSHOT</changelist>
<!-- *.html files are in UTF-8, and *.properties are in iso-8859-1, so this configuration is actually incorrect,
......@@ -108,7 +108,7 @@ THE SOFTWARE.
<maven-war-plugin.version>3.2.3</maven-war-plugin.version>
<!-- Bundled Remoting version -->
<remoting.version>3.33</remoting.version>
<remoting.version>3.34</remoting.version>
<!-- Minimum Remoting version, which is tested for API compatibility -->
<remoting.minimum.supported.version>3.4</remoting.minimum.supported.version>
......@@ -159,7 +159,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.22.0</version>
<version>3.0.0</version>
</dependency>
<dependency>
......
......@@ -64,7 +64,7 @@ THE SOFTWARE.
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jenkins-test-harness</artifactId>
<version>2.54</version>
<version>2.55</version>
<scope>test</scope>
<exclusions>
<exclusion>
......
......@@ -42,7 +42,6 @@ import org.jvnet.hudson.test.JenkinsRule;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.security.KeyFactory;
import java.security.interfaces.RSAPrivateKey;
import java.security.spec.PKCS8EncodedKeySpec;
......@@ -172,7 +171,7 @@ public class UsageStatisticsTest {
private void compareWithFile(String fileName, Object object) throws IOException {
Class clazz = this.getClass();
String fileContent = Resources.toString(clazz.getResource(clazz.getSimpleName() + "/" + fileName), Charset.forName("UTF-8"));
String fileContent = Resources.toString(clazz.getResource(clazz.getSimpleName() + "/" + fileName), StandardCharsets.UTF_8);
fileContent = fileContent.replace("JVMVENDOR", System.getProperty("java.vendor"));
fileContent = fileContent.replace("JVMNAME", System.getProperty("java.vm.name"));
fileContent = fileContent.replace("JVMVERSION", System.getProperty("java.version"));
......
/*
* The MIT License
*
* Copyright (c) 2019 CloudBees, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package jenkins.model;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.JenkinsRule;
import java.net.HttpURLConnection;
import java.net.URL;
import static org.junit.Assert.assertEquals;
public class AssetManagerTest {
@Rule
public JenkinsRule j = new JenkinsRule();
@Test
@Issue("JENKINS-58736")
public void emptyAssetDoesNotThrowError() throws Exception {
URL url = new URL(j.getURL() + "assets");
HttpURLConnection httpCon = (HttpURLConnection) url.openConnection();
assertEquals(HttpURLConnection.HTTP_NOT_FOUND, httpCon.getResponseCode());
}
@Test
@Issue("JENKINS-9598")
public void jqueryLoad() throws Exception {
// webclient does not work because it tries to parse the jquery2.js and there is a missing comma
URL url = new URL(j.getURL() + "assets/jquery-detached/jsmodules/jquery2.js");
HttpURLConnection httpCon = (HttpURLConnection) url.openConnection();
assertEquals(HttpURLConnection.HTTP_OK, httpCon.getResponseCode());
}
}
......@@ -93,6 +93,7 @@ body {
body.two-column #main-panel {
margin-left: 320px;
display:block;
}
body.full-screen {
......@@ -112,6 +113,7 @@ body.full-screen #main-panel {
body.two-column #main-panel {
margin-left: 0;
display:block;
}
}
......@@ -122,6 +124,7 @@ body.full-screen #main-panel {
body.two-column #main-panel {
margin-left: 360px;
display:block;
}
}
......
......@@ -13,6 +13,12 @@
-moz-box-sizing: border-box;
box-sizing: border-box;
}
h1.build-caption.page-headline {
max-width: 1200px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
*:before,
*:after {
-webkit-box-sizing: border-box;
......
......@@ -26,12 +26,16 @@
#tasks {
margin-bottom: 20px;
display: inline-block;
}
#tasks .task {
margin-bottom: 4px;
font-size: 14px;
max-width: 325px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
/* buildQueue */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册