Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 50c5434b3a59
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 723686d18d66
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Nov 7, 2014

  1. Copy the full SHA
    650b075 View commit details
  2. Merge pull request #2140 from cheald/fix_chmod_chgrp

    Don't swallow missing user/group errors for Etc.getgrnam/getpwname
    headius committed Nov 7, 2014
    Copy the full SHA
    723686d View commit details
Showing with 6 additions and 2 deletions.
  1. +6 −2 core/src/main/java/org/jruby/ext/etc/RubyEtc.java
8 changes: 6 additions & 2 deletions core/src/main/java/org/jruby/ext/etc/RubyEtc.java
Original file line number Diff line number Diff line change
@@ -140,13 +140,15 @@ public static IRubyObject getpwnam(IRubyObject recv, IRubyObject name) {
String nam = name.convertToString().toString();
try {
Passwd pwd = runtime.getPosix().getpwnam(nam);
if(pwd == null) {
if (pwd == null) {
if (Platform.IS_WINDOWS) { // MRI behavior
return runtime.getNil();
}
throw runtime.newArgumentError("can't find user for " + nam);
}
return setupPasswd(recv.getRuntime(), pwd);
} catch (RaiseException e) {
throw e;
} catch (Exception e) {
if (runtime.getDebug().isTrue()) {
runtime.getWarnings().warn(ID.NOT_IMPLEMENTED, "Etc.getpwnam is not supported by JRuby on this platform");
@@ -267,13 +269,15 @@ public static IRubyObject getgrnam(IRubyObject recv, IRubyObject name) {
String nam = name.convertToString().toString();
try {
Group grp = runtime.getPosix().getgrnam(nam);
if(grp == null) {
if (grp == null) {
if (Platform.IS_WINDOWS) { // MRI behavior
return runtime.getNil();
}
throw runtime.newArgumentError("can't find group for " + nam);
}
return setupGroup(runtime, grp);
} catch (RaiseException e) {
throw e;
} catch (Exception e) {
if (runtime.getDebug().isTrue()) {
runtime.getWarnings().warn(ID.NOT_IMPLEMENTED, "Etc.getgrnam is not supported by JRuby on this platform");