~ubuntu-branches/debian/sid/subversion/sid

« back to all changes in this revision

Viewing changes to subversion/bindings/javahl/native/ListCallback.cpp

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2015-08-07 21:32:47 UTC
  • mfrom: (0.2.15) (4.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20150807213247-ozyewtmgsr6tkewl
Tags: 1.9.0-1
* Upload to unstable
* New upstream release.
  + Security fixes
    - CVE-2015-3184: Mixed anonymous/authenticated path-based authz with
      httpd 2.4
    - CVE-2015-3187: svn_repos_trace_node_locations() reveals paths hidden
      by authz
* Add >= 2.7 requirement for python-all-dev Build-Depends, needed to run
  tests.
* Remove Build-Conflicts against ruby-test-unit.  (Closes: #791844)
* Remove patches/apache_module_dependency in favor of expressing the
  dependencies in authz_svn.load/dav_svn.load.
* Build-Depend on apache2-dev (>= 2.4.16) to ensure ap_some_authn_required()
  is available when building mod_authz_svn and Depend on apache2-bin (>=
  2.4.16) for runtime support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
  static jmethodID mid = 0;
88
88
  if (mid == 0)
89
89
    {
90
 
      jclass clazz = env->FindClass(JAVA_PACKAGE"/callback/ListCallback");
 
90
      jclass clazz = env->FindClass(JAVAHL_CLASS("/callback/ListCallback"));
91
91
      if (JNIUtil::isJavaExceptionThrown())
92
92
        POP_AND_RETURN(SVN_NO_ERROR);
93
93
 
94
94
      mid = env->GetMethodID(clazz, "doEntry",
95
 
                             "(L"JAVA_PACKAGE"/types/DirEntry;"
96
 
                             "L"JAVA_PACKAGE"/types/Lock;)V");
 
95
                             "(" JAVAHL_ARG("/types/DirEntry;")
 
96
                             JAVAHL_ARG("/types/Lock;") ")V");
97
97
      if (JNIUtil::isJavaExceptionThrown() || mid == 0)
98
98
        POP_AND_RETURN(SVN_NO_ERROR);
99
99
    }
113
113
 
114
114
  // call the Java method
115
115
  env->CallVoidMethod(m_callback, mid, jdirentry, jlock);
116
 
  // No need to check for exception here, because we'll just return anyway
117
116
 
118
 
  env->PopLocalFrame(NULL);
119
 
  return SVN_NO_ERROR;
 
117
  POP_AND_RETURN_EXCEPTION_AS_SVNERROR();
120
118
}
121
119
 
122
120
/**
126
124
ListCallback::createJavaDirEntry(const char *path, const char *absPath,
127
125
                                 const svn_dirent_t *dirent)
128
126
{
129
 
  JNIEnv *env = JNIUtil::getEnv();
130
 
 
131
 
  // Create a local frame for our references
132
 
  env->PushLocalFrame(LOCAL_FRAME_SIZE);
133
 
  if (JNIUtil::isJavaExceptionThrown())
134
 
    return SVN_NO_ERROR;
135
 
 
136
 
  jclass clazz = env->FindClass(JAVA_PACKAGE"/types/DirEntry");
137
 
  if (JNIUtil::isJavaExceptionThrown())
138
 
    POP_AND_RETURN_NULL;
139
 
 
140
 
  static jmethodID mid = 0;
141
 
  if (mid == 0)
142
 
    {
143
 
      mid = env->GetMethodID(clazz, "<init>",
144
 
                             "(Ljava/lang/String;Ljava/lang/String;"
145
 
                             "L"JAVA_PACKAGE"/types/NodeKind;"
146
 
                             "JZJJLjava/lang/String;)V");
147
 
      if (JNIUtil::isJavaExceptionThrown())
148
 
        POP_AND_RETURN_NULL;
149
 
    }
150
 
 
151
 
  jstring jPath = JNIUtil::makeJString(path);
152
 
  if (JNIUtil::isJavaExceptionThrown())
153
 
    POP_AND_RETURN_NULL;
154
 
 
155
 
  jstring jAbsPath = JNIUtil::makeJString(absPath);
156
 
  if (JNIUtil::isJavaExceptionThrown())
157
 
    POP_AND_RETURN_NULL;
158
 
 
159
 
  jobject jNodeKind = EnumMapper::mapNodeKind(dirent->kind);
160
 
  if (JNIUtil::isJavaExceptionThrown())
161
 
    POP_AND_RETURN_NULL;
162
 
 
163
 
  jlong jSize = dirent->size;
164
 
  jboolean jHasProps = (dirent->has_props? JNI_TRUE : JNI_FALSE);
165
 
  jlong jLastChangedRevision = dirent->created_rev;
166
 
  jlong jLastChanged = dirent->time;
167
 
  jstring jLastAuthor = JNIUtil::makeJString(dirent->last_author);
168
 
  if (JNIUtil::isJavaExceptionThrown())
169
 
    POP_AND_RETURN_NULL;
170
 
 
171
 
  jobject ret = env->NewObject(clazz, mid, jPath, jAbsPath, jNodeKind,
172
 
                               jSize, jHasProps, jLastChangedRevision,
173
 
                               jLastChanged, jLastAuthor);
174
 
  if (JNIUtil::isJavaExceptionThrown())
175
 
    POP_AND_RETURN_NULL;
176
 
 
177
 
  return env->PopLocalFrame(ret);
 
127
  return CreateJ::DirEntry(path, absPath, dirent);
178
128
}