search for: ssh2_filexfer_attr_permissions

Displaying 14 results from an estimated 14 matches for "ssh2_filexfer_attr_permissions".

2002 Nov 05
2
[PATCH] fix sftp to preserve permissions and uid/gid
...q, write_error; int read_error, write_errno; u_int64_t offset, size; ! u_int handle_len, mode, type, id, buflen, savemode; struct request { u_int id; u_int len; *************** *** 763,773 **** return(-1); /* XXX: should we preserve set[ug]id? */ ! if (a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) mode = S_IWRITE | (a->perm & 0777); ! else mode = 0666; ! if ((a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) && (a->perm & S_IFDIR)) { error("Cannot download a directory: %s", remote_path); --- 813,826 ---- return(-1); /* XXX: s...
2001 Feb 21
1
sftp-server and chown
...ve to OpenSSH 2.5.1p1) is suggested. Cheers. Andy. *** sftp-server.c.orig Tue Feb 13 03:40:56 2001 --- sftp-server.c Wed Feb 21 15:12:07 2001 *************** *** 554,560 **** a = get_attrib(); TRACE("setstat id %d name %s", id, name); if (a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) { ! ret = chmod(name, a->perm & 0777); if (ret == -1) status = errno_to_portable(errno); } --- 554,572 ---- a = get_attrib(); TRACE("setstat id %d name %s", id, name); if (a->flags & SSH2_...
2002 Mar 15
4
PATCH: sftp-server logging.
..._FX_FAILURE; id = get_int(); *************** *** 390,407 **** --- 449,478 ---- pflags = get_int(); /* portable flags */ a = get_attrib(); flags = flags_from_portable(pflags); + #ifdef SFTP_LOGGING + sflags_from_portable(&sflags[0], pflags); + #endif mode = (a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) ? a->perm : 0666; TRACE("open id %d name %s flags %d mode 0%o", id, name, pflags, mode); fd = open(name, flags, mode); if (fd < 0) { status = errno_to_portable(errno); + #ifdef SFTP_LOGGING + log("(%d/%d/%s) File/Dir open failed - %s: %s (%s,%04o)", ppid, c...
2001 Jun 20
1
SFTP Logging Redux.
...= "------"; int handle, fd, flags, mode, status = SSH2_FX_FAILURE; id = get_int(); @@ -390,8 +419,10 @@ pflags = get_int(); /* portable flags */ a = get_attrib(); flags = flags_from_portable(pflags); + sflags_from_portable(&sflags[0], pflags); mode = (a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) ? a->perm : 0666; TRACE("open id %d name %s flags %d mode 0%o", id, name, pflags, mode); + log("(%d/%d/%s) File/Dir opened: %s (%s,%04o)", ppid, cuid, CUNAME, name, sflags, mode); fd = open(name, flags, mode); if (fd < 0) { status = errno_to_portable(errno); @@ -...
2002 Nov 05
0
[PATCH] Add readonly mode to scp, sftp_server
...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 ---- id = get_int(); name = get_string(NULL); a = get_attrib(); + if (readonly) { + status = SSH2_FX_PE...
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
2009 Feb 12
2
[patch 1/3] add protocol extension to ATTR message
...stat_to_attrib(const struct stat *st, At { attrib_clear(a); a->flags = 0; + a->ext_flags = 0; a->flags |= SSH2_FILEXFER_ATTR_SIZE; a->size = st->st_size; a->flags |= SSH2_FILEXFER_ATTR_UIDGID; @@ -69,8 +81,32 @@ stat_to_attrib(const struct stat *st, At a->flags |= SSH2_FILEXFER_ATTR_PERMISSIONS; a->perm = st->st_mode; a->flags |= SSH2_FILEXFER_ATTR_ACMODTIME; + a->ext_flags |= SSH2_FXE_EXTATTR_ATIME; + a->ext_flags |= SSH2_FXE_EXTATTR_MTIME; a->atime = st->st_atime; a->mtime = st->st_mtime; + a->ext_flags |= SSH2_FXE_EXTATTR_CTIME; + a->ctime = st-...
2002 Oct 18
1
Patch: sftp client support of "ls [flags] [path [localfile]]" feature
...do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path, ! int lflag, char* localpath) { glob_t g; int i; Attrib *a; struct stat sb; + FILE *fp = NULL; + FILE *fp1 = NULL; memset(&g, 0, sizeof(g)); *************** *** 628,637 **** if ((a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) && S_ISDIR(a->perm)) { globfree(&g); ! return (do_ls_dir(conn, path, strip_path, lflag)); } } for (i = 0; g.gl_pathv[i]; i++) { char *fname, *lname; --- 651,675 ---- if ((a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) && S_ISDIR...
2004 Oct 25
1
Bug in sftp's chmod
Hi, I've discovered that on OpenSSH_3.6.1p1 (the latest SSH available on OSX, but I've also tried a couple of different linux distributions), when you 'sftp' to it, and try to 'chmod' some file or directory, only last three octal digits do actually matter. Example: sftp sshtest at localhost Connecting to localhost... sshtest at localhost's password: sftp> ls -l
2010 May 05
2
[Bug 1767] New: Inconsistend wildcard expansion in 'ls *'
https://bugzilla.mindrot.org/show_bug.cgi?id=1767 Summary: Inconsistend wildcard expansion in 'ls *' Product: Portable OpenSSH Version: 5.5p1 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: sftp AssignedTo: unassigned-bugs at mindrot.org
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
2003 Oct 01
1
3.7.1p2 sftp recurse patch
...mote_path, int pflag) +{ + int err; + DIR *d; + struct dirent *f; + char *local_tmp, *remote_tmp; + Attrib a; + extern int errno; + + if (recursion && is_dir(local_path)) { + if (!remote_is_dir(conn, remote_path)) { + /* Create remote directory */ + attrib_clear(&a); + a.flags |= SSH2_FILEXFER_ATTR_PERMISSIONS; + a.perm = 0777; + err = do_mkdir(conn, remote_path, &a); + if (err == -1) { + error("Couldn't create remote directory \"%s\"", + remote_path); + goto END; + } + } + + d = opendir(local_path); + if (d == NULL) { + error("Unable to read local...
2007 Nov 11
1
ftp-server patch - restrict user to directory
...tory ? */ + logit("remove name \"%s\"", name); + ret = unlink(name); + status = (ret == -1) ? errno_to_portable(errno) : SSH2_FX_OK; + } else + status = errno_to_portable(EPERM); + send_status(id, status); xfree(name); } @@ -920,9 +1064,13 @@ mode = (a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) ? a->perm & 0777 : 0777; debug3("request %u: mkdir", id); - logit("mkdir name \"%s\" mode 0%o", name, mode); - ret = mkdir(name, mode); - status = (ret == -1) ? errno_to_portable(errno) : SSH2_FX_OK; + if(allowed_access(name, "mkdir")) { /* Re...
2008 Jul 21
2
sftp needs a long time for sending a filelist
Hello all Im using sftp 1:4.7p1-8ubuntu1.2 in a batchjob Ive noticed that sftp needs a long time for sending a filelist. The timespan increases exponential if many files are on the remoteserver. for example "ls -la *.txt" needs 10 seconds for 2000 files but needs 50 seconds for 4000 files. For 150.000 Files i have to wait 15 minutes for example but the