1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-09-25 14:42:52 +00:00

Merge pull request #189 from haiwen/fix_list_dir_with_perm

Fix the invalid arguments process of list_dir_with_perm.
This commit is contained in:
Jiaqiang Xu
2018-11-09 17:52:20 +08:00
committed by GitHub
2 changed files with 10 additions and 5 deletions

View File

@@ -4645,11 +4645,21 @@ seafile_list_dir_with_perm (const char *repo_id,
return NULL;
}
if (!path) {
g_set_error (error, SEAFILE_DOMAIN, SEAF_ERR_BAD_ARGS, "Invalid path");
return NULL;
}
if (!dir_id || !is_object_id_valid (dir_id)) {
g_set_error (error, SEAFILE_DOMAIN, SEAF_ERR_BAD_ARGS, "Invalid dir id");
return NULL;
}
if (!user) {
g_set_error (error, SEAFILE_DOMAIN, SEAF_ERR_BAD_ARGS, "Invalid user");
return NULL;
}
char *rpath = format_dir_path (path);
GList *ret = seaf_repo_manager_list_dir_with_perm (seaf->repo_mgr,

View File

@@ -215,11 +215,6 @@ seaf_repo_manager_list_dir_with_perm (SeafRepoManager *mgr,
GList *res = NULL;
GList *p;
if (!repo_id || !is_uuid_valid(repo_id) || dir_id == NULL || !user) {
g_set_error (error, SEAFILE_DOMAIN, SEAF_ERR_BAD_DIR_ID, "Bad dir id");
return NULL;
}
perm = seaf_repo_manager_check_permission (mgr, repo_id, user, error);
if (!perm) {
if (*error == NULL)