Displaying 4 results from an estimated 4 matches for "stat_to_attrib".
2009 Feb 12
2
[patch 1/3] add protocol extension to ATTR message
...s = 0;
+ a->blksize = 0;
a->uid = 0;
a->gid = 0;
a->perm = 0;
+ a->nlink = 0;
a->atime = 0;
a->mtime = 0;
+ a->ctime = 0;
+ a->atimensec = 0;
+ a->mtimensec = 0;
+ a->ctimensec = 0;
}
/* Convert from struct stat to filexfer attribs */
@@ -61,6 +72,7 @@ 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_A...
2001 Jul 25
1
[PATCH]: sftp: Avoid paths beginning with "//"
...- snprintf(pathname, sizeof pathname,
- "%s/%s", path, dp->d_name);
+ snprintf(pathname, sizeof pathname, "%s%s%s", path,
+ strcmp(path, "/") ? "/" : "", dp->d_name);
if (lstat(pathname, &st) < 0)
continue;
stat_to_attrib(&st, &(stats[count].attrib));
--
Corinna Vinschen
Cygwin Developer
Red Hat, Inc.
mailto:vinschen at redhat.com
2002 Nov 05
0
[PATCH] Add getlink command to sftp
...name = link;
send_names(id, 1, &s);
}
--- 941,958 ----
send_status(id, errno_to_portable(errno));
else {
Stat s;
! struct stat st;
! int status;
link[len] = '\0';
attrib_clear(&s.attrib);
+
+ status = lstat(path, &st);
+ if (status == 0) {
+ stat_to_attrib(&st, &s.attrib);
+ }
+ else {
+ send_status(id, errno_to_portable(errno));
+ }
s.name = s.long_name = link;
send_names(id, 1, &s);
}
2023 May 10
2
SFTP support for subsecond times
...ad really to a minimum and just add both u32
variables to a separate sshbuf temporary variable and write that
sshbuf as the value string with sshbuf_put_stringb().
I think subsecond time support could be implemented in all file
attribs related protocol functions with the main changes involving the
stat_to_attrib(), attrib_to_stat(), decode_attrib(), encode_attrib(),
attrib_to_tv() and attrib_to_ts() functions mainly.
This way, sftp servers/clients that don't understand this "nsec-times"
extended attribute would just ignore it and keep working as up to now,
while those who understand them cou...