search for: do_lstat

Displaying 16 results from an estimated 16 matches for "do_lstat".

2009 Jul 27
1
supporting --fake-super on opensolaris (zfs) destination
...28,7 +128,155 @@ ssize_t sys_llistxattr(const char *path, char *list, size_t size) #else -#error You need to create xattr compatibility functions. +ssize_t sys_lgetxattr(const char *path, const char *name, void *value, size_t size) +{ + + + int attrfd; + size_t bufpos,r; + STRUCT_STAT fst; + + do_lstat(path,&fst); + if(S_ISLNK(fst.st_mode)) { + errno=EPERM; + return(-1); + } + + attrfd = attropen(path, name, O_RDONLY); + + if (attrfd<0) { + errno = ENOATTR; + return -1; + } + + + for(bufpos=0;bufpos<size;) { + r=read(attrfd,value+bufpos,512); + if (r==0) break; + if(r<0) {...
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
2001 Nov 03
3
unpredictable behaviour
I see very odd results from rsync 2.4.7pre1, the latest cvs version (sept 12, i think was the last modified file). We have a number of network-attached storage devices. 10/100 ethernet, nfs2 mounted (under nfs3, they buffer deletes, and recursive deletions fail). Usually, these are kept syncronized across a wan by a nightly cronjob, We have a few we keep in reserve, which we syncronize
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
2002 Jan 07
0
rsync-2.5.1 / updated syscall.c "const" patch
...e_t mode) { if (dry_run) return 0; CHECK_RO @@ -138,7 +141,7 @@ int do_stat(const char *fname, STRUCT_STAT *st) { -#if HAVE_OFF64_T +#ifdef HAVE_OFF64_T return stat64(fname, st); #else return stat(fname, st); @@ -148,7 +151,7 @@ #if SUPPORT_LINKS int do_lstat(const char *fname, STRUCT_STAT *st) { -#if HAVE_OFF64_T +#ifdef HAVE_OFF64_T return lstat64(fname, st); #else return lstat(fname, st); @@ -158,7 +161,7 @@ int do_fstat(int fd, STRUCT_STAT *st) { -#if HAVE_OFF64_T +#ifdef HAVE_OFF64_T return fstat64(fd, st); #el...
2002 Jan 25
0
suid files and bsd - correction
it's in syscall.c, not generator.c You'll have to save the status of the lstat, modify the mode in st, and return the lstat status. I don't know how to do it, though. #if SUPPORT_LINKS int do_lstat(const char *fname, STRUCT_STAT *st) { #if HAVE_OFF64_T return lstat64(fname, st); #else return lstat(fname, st); #endif } #endif Tim Conway tim.conway@philips.com 303.682.4917 Philips Semiconductor - Longmont TC 1880 Industrial Circle, Suite D Longmont, CO 80501 Available via SameT...
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
2014 Mar 10
5
[Bug 10494] New: remove-source-files fails with symlinks
https://bugzilla.samba.org/show_bug.cgi?id=10494 Summary: remove-source-files fails with symlinks Product: rsync Version: 3.1.0 Platform: x64 OS/Version: Linux Status: NEW Severity: major Priority: P5 Component: core AssignedTo: wayned at samba.org ReportedBy: afried at deteque.com
2004 Apr 11
1
fchmod in do_mkstemp? (patch included)
...004 23:48:36 -0000 @@ -222,7 +222,7 @@ int do_rename(char *fname1, char *fname2); void trim_trailing_slashes(char *name); int do_mkdir(char *fname, mode_t mode); -int do_mkstemp(char *template, mode_t perms); +int do_mkstemp(char *template); int do_stat(const char *fname, STRUCT_STAT *st); int do_lstat(const char *fname, STRUCT_STAT *st); int do_fstat(int fd, STRUCT_STAT *st); Index: receiver.c =================================================================== RCS file: /cvsroot/rsync/receiver.c,v retrieving revision 1.75 diff -u -w -r1.75 receiver.c --- receiver.c 23 Mar 2004 16:50:40 -0000 1....
2010 Jun 15
3
about rsyncing of block devices
Hiya, I can see it's a regular subject on this list. I, like others wanted to use rsync to synchronise two block devices (as it happens one lvm volume and one nbd device served by qemu-img on a remote host from a qcow2 disk image so that I can keep the old versions) As I couldn't find any report of it being done successfully, I'm just sharing my findings as it might benefit others.
2002 Nov 05
0
[PATCH] Add getlink command to sftp
...buffer_free(&msg); *************** *** 719,724 **** --- 722,774 ---- return(filename); } + int + do_getlink(struct sftp_conn *conn, char *path) + { + char *dest; + u_int status = 0; + int ret; + struct stat statb; + char *filename; + Attrib *a; + Attrib attrib; + + a = do_lstat(conn, path, 0); + if (a == NULL || !S_ISLNK(a->perm)) { + if (a != NULL) + error("%s is not a symlink", path); + return(-1); + } + + dest = do_readlink(conn, path, &attrib); + if (dest == NULL) + return(-1); + filename = strrchr(path, '/'); + if (filename ==...
2009 Feb 12
2
[patch 1/3] add protocol extension to ATTR message
This patch adds all the missing commonly used UNIX attributes: st_dev, st_ino, st_nlink, st_rdev, st_blocks, st_blksize, st_ctime. In addition it extends st_atime and st_mtime to 64bits, and adds nanosecond resolution to all three timestamps. This is implemented as an extension to the ATTR message. This patch alone is sufficient for SSHFS to be able to use these attributes. The following two
2004 Apr 10
0
patches for copying atimes
..., + mt->tm_sec); + } else { + strcpy(dest, " "); + } +} static void list_file (const char *fname) { STRUCT_STAT buf; char permbuf[PERMSTRING_SIZE]; - struct tm *mt; - char datebuf[50]; + char mtimebuf[50]; + char atimebuf[50]; char linkbuf[4096]; if (do_lstat(fname, &buf) == -1) @@ -97,19 +115,8 @@ permstring(permbuf, buf.st_mode); - if (buf.st_mtime) { - mt = gmtime(&buf.st_mtime); - - sprintf(datebuf, "%04d-%02d-%02d %02d:%02d:%02d", - mt->tm_year + 1900, - mt->tm_mon + 1, - mt->tm_mday, - mt->tm_hour, -...
2014 Sep 22
2
[PATCH] New APIs: Implement stat calls that return nanosecond timestamps (RHBZ#1144891).
...TRUCT_STAT_ST_BLOCKS - ret->blocks = statbuf.st_blocks; -#else - ret->blocks = -1; -#endif - ret->atime = statbuf.st_atime; - ret->mtime = statbuf.st_mtime; - ret->ctime = statbuf.st_ctime; - - return ret; + return stat_to_statns (NULL, &statbuf); } -guestfs_int_stat * -do_lstat (const char *path) +guestfs_int_statns * +do_lstatns (const char *path) { int r; - guestfs_int_stat *ret; struct stat statbuf; CHROOT_IN; @@ -93,42 +117,14 @@ do_lstat (const char *path) return NULL; } - ret = malloc (sizeof *ret); - if (ret == NULL) { - reply_with_perro...
2004 Apr 20
1
improved atime patch
..., + mt->tm_sec); + } else { + strcpy(dest, " "); + } +} static void list_file (const char *fname) { STRUCT_STAT buf; char permbuf[PERMSTRING_SIZE]; - struct tm *mt; - char datebuf[50]; + char mtimebuf[50]; + char atimebuf[50]; char linkbuf[4096]; if (do_lstat(fname, &buf) == -1) @@ -97,19 +115,8 @@ permstring(permbuf, buf.st_mode); - if (buf.st_mtime) { - mt = gmtime(&buf.st_mtime); - - sprintf(datebuf, "%04d-%02d-%02d %02d:%02d:%02d", - mt->tm_year + 1900, - mt->tm_mon + 1, - mt->tm_mday, - mt->tm_hour, -...
2009 Aug 12
23
[PATCH 0/23] factor and const-correctness
This started as a simple warning-elimination change. I'll get back to that series shortly ;-) It turned into a factorization and constification exercise during which I got a taste of ocaml. Thanks to Rich Jones for help with a few snippets in generator.ml. The overall result is that many previously-manually-maintained bits from daemon/*.c functions are now hoisted into the automatically-