mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 12:56:51 +03:00
Ticket #1708: ftp permissions
Some FTP-servers don't have chmon support (or don't able to change permissions in some cases). This commit will add "ignore_ftp_chattr_errors" section into config file. Now default behavior: ignore FTP errors related to chmod operations. Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
parent
3368438bee
commit
4f6c5e7811
12
vfs/ftpfs.c
12
vfs/ftpfs.c
@ -89,6 +89,7 @@ What to do with this?
|
||||
#include "../src/main.h" /* print_vfs_message */
|
||||
#include "../src/history.h"
|
||||
#include "../src/setup.h" /* for load_anon_passwd */
|
||||
#include "../src/mcconfig/mcconfig.h"
|
||||
|
||||
#include "utilvfs.h"
|
||||
#include "xdirentry.h"
|
||||
@ -1655,9 +1656,18 @@ ftpfs_init_passwd(void)
|
||||
static int ftpfs_chmod (struct vfs_class *me, const char *path, int mode)
|
||||
{
|
||||
char buf[BUF_SMALL];
|
||||
int ret;
|
||||
|
||||
g_snprintf(buf, sizeof(buf), "SITE CHMOD %4.4o /%%s", mode & 07777);
|
||||
return ftpfs_send_command(me, path, buf, OPT_FLUSH);
|
||||
|
||||
ret = ftpfs_send_command(me, path, buf, OPT_FLUSH);
|
||||
|
||||
if ( mc_config_get_bool (mc_main_config, CONFIG_APP_SECTION,
|
||||
"ignore_ftp_chattr_errors", TRUE)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ftpfs_chown (struct vfs_class *me, const char *path, int owner, int group)
|
||||
|
Loading…
Reference in New Issue
Block a user