Displaying 20 results from an estimated 98 matches for "s_islnk".
2007 Nov 10
3
Funny issue with chroot + symlink outside chroot
...file(const char
if (save_errno == ENOENT) {
#ifdef SUPPORT_LINKS
/* Avoid "vanished" error if symlink points nowhere.
*/
- if (copy_links && x_lstat(thisname, &st, NULL) == 0
- && S_ISLNK(st.st_mode)) {
+ if ((copy_links && x_lstat(thisname, &st, NULL) == 0
+ && S_ISLNK(st.st_mode)) || x_stat(thisname, &st,
NULL) != 0) {
io_error |= IOERR_GENERAL;...
2004 Jan 24
2
[PATCH] --links-depth for rsync
...rrbuf[MAXPATHLEN], linkbuf[MAXPATHLEN];
+ STRUCT_STAT st;
+ int i;
+
+ memset(currbuf, 0, MAXPATHLEN);
+ memset(linkbuf, 0, MAXPATHLEN);
+ strncpy(currbuf, file->u.link, MAXPATHLEN);
+ for (i = 0; i < follow_links_depth; i++) {
+ if (link_stat(currbuf, &st) != 0) {
+ break;
+ }
+ if (S_ISLNK(st.st_mode)) {
+ int buflen = readlink(currbuf, linkbuf, MAXPATHLEN - 1);
+ if (buflen > 0) {
+ linkbuf[buflen] = '\0';
+ strncpy(currbuf, linkbuf, MAXPATHLEN);
+ }
+ } else {
+ /* Not a symlink, quit */
+ break;
+ }
+#if 0
+ fprintf(stderr, "\n%s:%i [#%i] %s ->...
2023 May 17
1
[PATCH] Add --omit-{device,special}-times options
...; any_time_differs(sxp, file, fname))
return 0;
if (perms_differ(file, sxp))
return 0;
@@ -509,6 +516,8 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statret,
int keep_time = !preserve_mtimes ? 0
: S_ISDIR(file->mode) ? !omit_dir_times
: S_ISLNK(file->mode) ? !omit_link_times
+ : IS_DEVICE(file->mode) ? !omit_device_times
+ : IS_SPECIAL(file->mode) ? !omit_special_times
: 1;
if (S_ISREG(file->mode) && F_LENGTH(file) != sxp->st.st_size)
diff -aNpRruz -X /etc/diff.excludes rsync-3.2.7/options.c dev...
2009 Jul 27
1
supporting --fake-super on opensolaris (zfs) destination
...istxattr(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) {
+ return -errno;
+ }
+ bufpos...
2008 Sep 01
0
Feature request: preallocation of directories
...#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <sys/param.h>
#include <sys/stat.h>
#include "ext2fs/ext2_fs.h"
#ifdef __GNUC__
#define EXT2FS_ATTR(x) __attribute__(x)
#else
#define EXT2FS_ATTR(x)
#endif
#ifndef S_ISLNK /* So we can compile even with gcc-warn */
# ifdef __S_IFLNK
# define S_ISLNK(mode) __S_ISTYPE((mode), __S_IFLNK)
# else
# define S_ISLNK(mode) 0
# endif
#endif
#include "et/com_err.h"
#include "e2p/e2p.h"
static const char * program_name = "copy_dirstruct";
#...
2005 Jun 09
0
[Bug 2784] New: rsync gives following error: buffer overflow in receive_file_entry
...owever
the symbolic links that have the following pattern symlink -> /foo/bar get
rsynced to symlink -> foo/bar.
I looked at the source and I have found the code that generated the errors that
I see. below is the code section from flist.c:
#if SUPPORT_LINKS
if (preserve_links && S_ISLNK(mode)) {
linkname_len = read_int(f) + 1; /* count the '\0' */
if (linkname_len <= 0 || linkname_len > MAXPATHLEN) {
rprintf(FERROR, "overflow: linkname_len=%d\n",
linkname_len - 1);
overflow("receive_file_entry");
}
}
else
#endif
I cannot figure...
2005 Jun 09
0
[Bug 2785] New: rsync gives following error: buffer overflow in receive_file_entry
...owever
the symbolic links that have the following pattern symlink -> /foo/bar get
rsynced to symlink -> foo/bar.
I looked at the source and I have found the code that generated the errors that
I see. below is the code section from flist.c:
#if SUPPORT_LINKS
if (preserve_links && S_ISLNK(mode)) {
linkname_len = read_int(f) + 1; /* count the '\0' */
if (linkname_len <= 0 || linkname_len > MAXPATHLEN) {
rprintf(FERROR, "overflow: linkname_len=%d\n",
linkname_len - 1);
overflow("receive_file_entry");
}
}
else
#endif
I cannot figure...
2008 Apr 14
0
[PATCH] xattrs not set on locked files that already exist on target
...4.000000000 -0500
@@ -31,6 +31,7 @@
extern int dry_run;
extern int preserve_acls;
extern int preserve_xattrs;
+extern int force_change;
extern int preserve_perms;
extern int preserve_fileflags;
extern int preserve_executability;
@@ -445,6 +446,11 @@
if (daemon_chmod_modes && !S_ISLNK(new_mode))
new_mode = tweak_mode(new_mode, daemon_chmod_modes);
+#ifdef SUPPORT_FORCE_CHANGE
+ if (force_change)
+ make_mutable(fname, sxp->st.st_mode, sxp->st.st_flags, force_change);
+#endif
+
#ifdef SUPPORT_ACLS
if (preserve_acls && !S_ISLNK(file->mode) && !AC...
2004 Sep 15
0
[Bug 1764] New: dry-run does not show changes in owner / group, permission, or timestamp
...c-2.6.2-new/rsync.c Wed Sep 15 01:35:16 2004
@@ -129,7 +129,6 @@
STRUCT_STAT st2;
int change_uid, change_gid;
- if (dry_run) return 0;
if (!st) {
if (link_stat(fname,&st2) != 0) {
@@ -142,6 +141,10 @@
if (preserve_times && !S_ISLNK(st->st_mode) &&
cmp_modtime(st->st_mtime, file->modtime) != 0) {
+ if (dry_run) {
+ rprintf(FINFO,"modtime: %s\n",fname);
+ return 0;
+ }
/* don't complain about not setting ti...
2007 Jul 31
1
[Bridge] brctl uses incorrect sysfs path
...andir(path, &namelist, 0, alphasort);
if (count < 0)
return old_foreach_port(brname, iterator, arg);
for (i = 0; i < count; i++) {
+ if (stat(namelist[i]->d_name, &st) == -1)
+ continue;
+ if (!S_ISLNK(st.st_mode))
+ continue;
if (iterator(brname, namelist[i]->d_name, arg))
break;
}
Best wishes,
--
Malcolm Scott
Research Assistant
University of Cambridge Computer Laboratory
2001 Sep 01
3
Patch to make rsync preserve access times
...;
There's also a much more important issue with respect to this flag (below).
> *** ./rsync.c Mon Jan 24 04:13:39 2000
> --- ./rsync.c Sun Feb 6 21:01:26 2000
...
> ***************
> *** 162,181 ****
> st = &st2;
> }
>
> - if (preserve_times && !S_ISLNK(st->st_mode) &&
> - st->st_mtime != file->modtime) {
> - /* don't complain about not setting times on directories
> - because some filesystems can't do it */
> - if (set_modtime(fname,file->modtime) != 0 &&
> - !S_ISDIR(st->s...
2002 Feb 19
1
Typo fix for samba 2.2.3a source/smbd/trans2.c
Just a couple of quick fixes for trans2.c and README in samba-2.2.3a.
--- source/smbd/trans2.c.old Tue Feb 5 14:37:55 2002
+++ source/smbd/trans2.c Wed Feb 20 10:26:16 2002
@@ -2062,7 +2062,7 @@
if(!S_ISLNK(sbuf.st_mode))
return(UNIXERROR(ERRSRV,ERRbadlink));
#else
- return(UNIXERROR(ERRDOS,ErrNotALink));
+ return(UNIXERROR(ERRDOS,ERRbadlink));
#endif
len =
conn->vfs_ops.readlink(conn,dos_to_unix(f...
2002 Dec 21
3
am I missing something, or are permissions always preserved?
They seem to be for me, even when I don't pass in the --perms flag. This
is a problem because I'm rsyncing to a samba mount with fixed
permissions.
Looking at rsync.c (for version 2.5.5) starting at line 204, I see this
code snippet:
#ifdef HAVE_CHMOD
if (!S_ISLNK(st->st_mode)) {
if (st->st_mode != file->mode) {
updated = 1;
if (do_chmod(fname,file->mode) != 0) {
rprintf(FERROR,"failed to set permissions on %s : %s\n",
fname,strerror(errno));
return 0;...
2024 Jun 10
2
4.20: case (in)sensitive is broken
...if (lstat_ret != -1 &&
- VALID_STAT(full_fname->st) &&
+ if (lstat_ret == -1) {
+ /* Can't be a DFS link. */
+ int saved_errno = errno;
+ TALLOC_FREE(full_fname);
+ errno = saved_errno;
+ return -1;
+ }
+ if (VALID_STAT(full_fname->st) &&
S_ISLNK(full_fname->st.st_ex_mode)) {
fsp->fsp_name->st = full_fname->st;
}
2008 Jun 25
2
DO NOT REPLY [Bug 5565] New: xattrs not set on locked files that already exist on target
...03.000000000 -0700
@@ -31,6 +31,7 @@
extern int dry_run;
extern int preserve_acls;
extern int preserve_xattrs;
+extern int force_change;
extern int preserve_perms;
extern int preserve_fileflags;
extern int preserve_executability;
@@ -445,6 +446,11 @@
if (daemon_chmod_modes && !S_ISLNK(new_mode))
new_mode = tweak_mode(new_mode, daemon_chmod_modes);
+#ifdef SUPPORT_FORCE_CHANGE
+ if (force_change)
+ make_mutable(fname, sxp->st.st_mode, sxp->st.st_flags,
force_change);
+#endif
+
#ifdef SUPPORT_ACLS
if (preserve_acls && !S_...
2002 Mar 12
2
Patch: --drop-suid Remove suid/sgid from target files
...ksum;
+extern int drop_suid;
extern int cvs_exclude;
@@ -714,6 +716,10 @@
#ifdef HAVE_STRUCT_STAT_ST_RDEV
file->rdev = st.st_rdev;
#endif
+
+ if (am_sender && drop_suid && S_ISREG(st.st_mode)) {
+ file->mode &= ~(S_ISUID | S_ISGID);
+ }
#if SUPPORT_LINKS
if (S_ISLNK(st.st_mode)) {
diff -r --unified rsync-2.5.4pre1-orig/options.c rsync-2.5.4pre1/options.c
--- rsync-2.5.4pre1-orig/options.c Thu Feb 28 09:49:57 2002
+++ rsync-2.5.4pre1/options.c Tue Mar 12 22:01:45 2002
@@ -31,6 +31,7 @@
int preserve_uid = 0;
int preserve_gid = 0;
int preserve_times = 0;
+int...
2004 May 10
2
read error produces null-byte-filled destination file
I've run into a bug in the IO handling when reading a file. Suppose I
have a file that lives on an NFS filesystem. That filesystem is NOT
being exported with auth=0 permissions. So, if I try to access a file
as root, it successfully opens the file, but subsequent reads fail with
EACCES. This produces a destination file full of null bytes. I
noticed this with 2.5.7, but checked 2.6.2 as
2008 Feb 15
4
Revised flags patch
...,9 @@ static struct file_struct *recv_file_ent
{
static int64 modtime;
static mode_t mode;
+#ifdef SUPPORT_FLAGS
+ static uint32 fileflags;
+#endif
#ifdef SUPPORT_HARD_LINKS
static int64 dev;
#endif
@@ -745,6 +762,11 @@ static struct file_struct *recv_file_ent
if (chmod_modes && !S_ISLNK(mode))
mode = tweak_mode(mode, chmod_modes);
+#ifdef SUPPORT_FLAGS
+ if (fileflags_ndx && !(xflags & XMIT_SAME_FLAGS))
+ fileflags = (uint32)read_int(f);
+#endif
+
if (uid_ndx && !(xflags & XMIT_SAME_UID)) {
if (protocol_version < 30)
uid = (uid_t)read_int(...
2018 Feb 05
2
Unfortunate results from fake-super
...ymlink, which is (as you
> note) a bad thing.
>
> My first reaction is to change the code in set_stat_xattr()
> (in xattrs.c) from:
>
> if (fst.st_mode != mode)
> do_chmod(fname, mode);
>
> to:
>
> if (fst.st_mode != mode && !S_ISLNK(file->mode))
> do_chmod(fname, mode);
>
> ..wayne..
That's certainly an improvement; from the safety point of view, leaving
it as 0600 is a lot better than leaving it as 0777. I'm currently
investigating a slightly more extensive fix to allow more control over...
2004 May 06
2
rsync-2.6.2: NFS clients confused after an rsync
We use rsync to update an nfs server. After an update, we noticed that
a large number of clients didn't see the updated data.
It took me a while to be able to reliably reproduce this problem, but it
happens on old and new versions of rysnc. It also happens across all
the platforms we use here (sun/linux/netapp).
This shows the problem: [Note my home directory is NFS mounted]