search for: ssh2_fx_permission_denied

Displaying 7 results from an estimated 7 matches for "ssh2_fx_permission_denied".

2002 Nov 05
0
[PATCH] Add readonly mode to scp, sftp_server
...etc. */ typedef struct Stat Stat; *************** *** 390,395 **** --- 393,404 ---- pflags = get_int(); /* portable flags */ a = get_attrib(); flags = flags_from_portable(pflags); + if (((flags & O_ACCMODE) == O_RDWR) || + ((flags & O_ACCMODE) == O_WRONLY)) { + status = SSH2_FX_PERMISSION_DENIED; + send_status(id, status); + return; + } mode = (a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) ? a->perm : 0666; TRACE("open id %u name %s flags %d mode 0%o", id, name, pflags, mode); fd = open(name, flags, mode); *************** *** 587,592 **** --- 596,606 ----...
2013 Jun 04
1
[PATCH] add restricted mode to sftp-server
Hello. These patches add a new mode of operation for the sftp server. It is located between the ordinary, unrestricted mode and read-only mode. It allows you to add files to the server, but only if these files do not exist on the server before. Changes to existing files - are prohibited. Please review them, maybe these patches will be useful not only to me. Thank you. -------------- next part
2012 Oct 23
4
Disable rm on sftp
...the code of process_remove from: static void process_remove(void) { char *name; u_int32_t id; int status = SSH2_FX_FAILURE; int ret; id = get_int(); name = get_string(NULL); debug3("request %u: remove", id); logit("remove name \"%s\"", name); if (readonly) status = SSH2_FX_PERMISSION_DENIED; else { ret = unlink(name); status = (ret == -1) ? errno_to_portable(errno) : SSH2_FX_OK; } send_status(id, status); xfree(name); } To : static void process_remove(void) { char *name; u_int32_t id; int status = SSH2_FX_FAILURE; int ret; id = get_int(); name = get_string(NULL); debug3("reque...
2013 Oct 14
0
[PATCH-resend] Implement SSH2_FXF_APPEND
...; 0) { status = errno_to_portable(errno); } else { - handle = handle_new(HANDLE_FILE, name, fd, NULL); + handle = handle_new(HANDLE_FILE, name, fd, flags, NULL); if (handle < 0) { close(fd); } else { @@ -660,7 +674,8 @@ process_write(void) else if (readonly) status = SSH2_FX_PERMISSION_DENIED; else { - if (lseek(fd, off, SEEK_SET) < 0) { + if (!(handle_to_flags(handle) & O_APPEND) && + lseek(fd, off, SEEK_SET) < 0) { status = errno_to_portable(errno); error("process_write: seek failed"); } else { @@ -893,7 +908,7 @@ process_opendir(void) i...
2009 Feb 19
4
[Bug 1558] New: Sftp client does not correctly process server response messages after write error
...Priority: P2 Component: sftp AssignedTo: unassigned-bugs at mindrot.org ReportedBy: simm42 at gmail.com I'm in the process of implementing extensions to sftp-server. One of these is a maximum file size - if a write attempts to write past the maximum file size SSH2_FX_PERMISSION_DENIED is returned. When the client receives this it displays permission denied on screen and stops the upload. It then reports ID mismatch and exits. sftp> put bigfile Uploading bigfile to /bigfile bigfile...
2001 May 24
1
chroot sftp-server [PATCH]
I'm working on setting up a semi-trusted sftp service, and to get it working, I need chroot capability. I've taken the /./ wuftpd magic token code from contrib/chroot.diff and put it into the sftp server. The main problem is that privileges have been dropped by the time the subsystem is exec'ed, so my patch requires that sftp-server be setuid root. Not ideal, I know, but I drop all
2002 Mar 15
4
PATCH: sftp-server logging.
...*********** *** 93,98 **** --- 102,126 ---- return ret; } + #ifdef SFTP_LOGGING + char* + status_to_logstr(int status) + { + switch (status) { + case SSH2_FX_OK: + return "Successful"; + case SSH2_FX_NO_SUCH_FILE: + return "No such file or directory"; + case SSH2_FX_PERMISSION_DENIED: + return "Permission denied."; + case SSH2_FX_BAD_MESSAGE: + return "Bad message"; + default: + return "Unknown error"; + } + } + #endif + static int flags_from_portable(int pflags) { *************** *** 115,120 **** --- 143,173 ---- return fla...