Skip to content

Commit

Permalink
Permission related fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
tavip committed Jan 6, 2008
1 parent e830c15 commit 3d6e32d
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions cmdhandler.c
Expand Up @@ -93,7 +93,7 @@ static char * get_abs_path(const char * path, struct lfd_sess *sess, apr_pool_t
path = apr_pstrcat(allocator_pool, sess->cwd_path, path, NULL);
}

return path;
return (char*)path;
}


Expand Down Expand Up @@ -713,7 +713,7 @@ static apr_status_t handle_upload_common(struct lfd_sess *sess, int is_append, i
{
flags |= APR_FOPEN_TRUNCATE;
}
rc = lkl_file_open(&file, filename, flags, 0, sess->loop_pool);
rc = lkl_file_open(&file, filename, flags, APR_FPROT_OS_DEFAULT, sess->loop_pool);
if(APR_SUCCESS != rc)
{
lfd_log(LFD_ERROR, "lkl_file_open failed with errorcode[%d] and error message[%s]", rc, lfd_sess_strerror(sess, rc));
Expand Down Expand Up @@ -834,17 +834,17 @@ static apr_status_t list_dir(const char * directory, apr_pool_t * pool, char **
snprintf(buffer, sizeof(buffer), "%c%c%c%c%c%c%c%c%c%c ftp ftp %d %s %s",
(finfo.filetype == APR_DIR)?'d':'-',
/* user permission */
(finfo.protection&00400)?'r':'-',
(finfo.protection&00200)?'w':'-',
(finfo.protection&00100)?'x':'-',
(finfo.protection&APR_FPROT_UREAD)?'r':'-',
(finfo.protection&APR_FPROT_UWRITE)?'w':'-',
(finfo.protection&APR_FPROT_UEXECUTE)?'x':'-',
/* group permission */
(finfo.protection&00040)?'r':'-',
(finfo.protection&00020)?'w':'-',
(finfo.protection&00010)?'x':'-',
(finfo.protection&APR_FPROT_GREAD)?'r':'-',
(finfo.protection&APR_FPROT_GWRITE)?'w':'-',
(finfo.protection&APR_FPROT_GEXECUTE)?'x':'-',
/* others permission */
(finfo.protection&00004)?'r':'-',
(finfo.protection&00002)?'w':'-',
(finfo.protection&00001)?'x':'-',
(finfo.protection&APR_FPROT_WREAD)?'r':'-',
(finfo.protection&APR_FPROT_WWRITE)?'w':'-',
(finfo.protection&APR_FPROT_WEXECUTE)?'x':'-',
(int)finfo.size, time_string, finfo.name);
} else
snprintf(buffer, sizeof(buffer), "%s%s", finfo.name,
Expand Down

0 comments on commit 3d6e32d

Please sign in to comment.