Displaying 20 results from an estimated 259 matches for "s_isdir".
Did you mean:
s_ifdir
2005 Dec 05
1
Strange automount problem with samba & LDAP
...and
prints failure for both cases:
code=stat(conn->connectpath,mystatus);
if(code)
DEBUG(0,("stat to (%s) failed!\n",conn->connectpath));
else
DEBUG(0,("stat to (%s) suceeded.\n",conn->connectpath));
code=S_ISDIR(mystatus->st_mode);
if(!code)
DEBUG(0,("S_ISDIR to (%s) failed!\n",conn->connectpath));
else
DEBUG(0,("S_ISDIR to (%s) suceeded.\n",conn->connectpath));
The same code runs without any problem alone (mounts the user's...
2017 Aug 08
1
Re: [PATCH 3/6] daemon: Refine check for Device and Dev_or_Path parameters (RHBZ#1477623).
On Thursday, 3 August 2017 19:13:48 CEST Richard W.M. Jones wrote:
> + fprintf (stderr, "mode = %o\n", statbuf.st_mode);
> + if (S_ISBLK (statbuf.st_mode))
> + /* continue */;
> + else if (S_ISDIR (statbuf.st_mode)) {
> + fprintf (stderr, "S_ISDIR\n");
The two unconditional fprintf() look like debugging leftovers.
> + fd = open (device, O_RDONLY|O_CLOEXEC);
> + if (fd == -1) {
> + if (verbose)
> + fprintf (stderr, "%s: open: %s: %m\n", "...
2006 Jun 02
3
[PATCH] --omit-dir-changes, qsort<>mergesort issues
...T_TIME;
if ((file->mode & CHMOD_BITS) != (st->st_mode & CHMOD_BITS))
iflags |= ITEM_REPORT_PERMS;
- if (preserve_uid && am_root && file->uid != st->st_uid)
+ if (preserve_uid && am_root && file->uid != st->st_uid
+ && !(S_ISDIR(st->st_mode) && omit_dir_changes))
iflags |= ITEM_REPORT_OWNER;
- if (preserve_gid && file->gid != GID_NONE
- && st->st_gid != file->gid)
+ if (preserve_gid && file->gid != GID_NONE && st->st_gid != file->gid
+ &&...
2003 Sep 05
1
new option suggestion '--backup-only'
...re_dest;
extern int link_dest;
+extern int backup_only;
/* choose whether to skip a particular file */
@@ -295,6 +296,9 @@
return;
}
+ if (backup_only && statret == -1 && errno == ENOENT)
+ return;
+
if (statret == 0 &&
!preserve_perms &&
(S_ISDIR(st.st_mode) == S_ISDIR(file->mode))) {
@@ -313,6 +317,8 @@
if (dry_run) return; /* XXXX -- might cause inaccuracies?? -- mbp */
if (statret == 0 && !S_ISDIR(st.st_mode)) {
+ if (backup_only)
+ return;
if (robust_unlink(fname) != 0) {
rprintf(FERROR, RSYNC_NAME...
2004 Jun 02
2
[Patch] for bug 81
Index: namei.c
===================================================================
--- namei.c (revision 968)
+++ namei.c (working copy)
@@ -526,7 +526,7 @@
status = -EBUSY;
- if (!empty_dir(inode)) {
+ if ( S_ISDIR (inode->i_mode) && !empty_dir(inode)) {
LOG_TRACE_STR ("dentry is not empty, cannot delete");
goto bail;
} else if (OCFS_I(inode)->open_hndl_cnt > 0) {
bug 81 description:
Env:
kernel 2.4.20
Dell Pc P4-2.1 512M, 80G
Reproduce S...
2006 Mar 20
1
Rsync acl patch 1.113 compilation problems on cygwin
Hi,
Recently, there have been some fundamental achievements regarding
acl-support on the cygwin platform. I thought that it would be convenient to
offer an acl-patch enabled rsync as a part of the cwrsync package (a yet
another minimalist rsync on cygwin solution). I get some compilation errors.
What I did:
- Downloaded acl patch v1.113 from rsync site
- Run commands below In the rsync source
2005 Jan 31
1
[patch] add "--ignore" option
...l))
- return NULL;
+ if (filter_level != NO_FILTERS) {
+ if (is_excluded(thisname, 0, filter_level) ==
M_EXCLUDE)
+ return NULL;
+ }
if (save_errno == ENOENT) {
#if SUPPORT_LINKS
/* Avoid "vanished" error if symlink points nowhere.
*/
@@ -830,8 +837,12 @@
&& S_ISDIR(st.st_mode))
flags |= FLAG_MOUNT_POINT;
- if (is_excluded(thisname, S_ISDIR(st.st_mode) != 0, filter_level))
- return NULL;
+ {
+ enum matchtype m = is_excluded(thisname, S_ISDIR(st.st_mode) !=
0, filter_level);
+ if ((m == M_EXCLUDE) || (m == M_IGNORE)) {
+ return NULL;
+ }
+ }
i...
2009 Jun 03
3
How to get file info of a directory in linux kernel space?
...struct dirent *entry;
struct stat statbuf;
if((dp = opendir(dir)) == NULL){
fprintf(stderr,"cannot open directory: %s\n",dir);
return;
}
chdir(dir);
while((entry = readdir(dp)) != NULL){
lstat(entry->d_name,&statbuf);
if(S_ISDIR(statbuf.st_mode)){
if(strcmp("..",entry->d_name) == 0||
strcmp(".",entry->d_name) == 0)
continue;
printf("%*s%s/\n",depth,"",entry->d_name);
printdir(entry->d_name,depth+4);...
2009 Jun 03
3
How to get file info of a directory in linux kernel space?
...struct dirent *entry;
struct stat statbuf;
if((dp = opendir(dir)) == NULL){
fprintf(stderr,"cannot open directory: %s\n",dir);
return;
}
chdir(dir);
while((entry = readdir(dp)) != NULL){
lstat(entry->d_name,&statbuf);
if(S_ISDIR(statbuf.st_mode)){
if(strcmp("..",entry->d_name) == 0||
strcmp(".",entry->d_name) == 0)
continue;
printf("%*s%s/\n",depth,"",entry->d_name);
printdir(entry->d_name,depth+4);...
2004 Feb 02
1
[PATCH] --one-file-system and automounter
...ld be skipped
- when one_file_system is set. We bascally only want to include
- the mount points - but they can be hard to find! */
-static int skip_filesystem(char *fname, STRUCT_STAT * st)
-{
- STRUCT_STAT st2;
- char *p = strrchr(fname, '/');
-
- /* skip all but directories */
- if (!S_ISDIR(st->st_mode))
- return 1;
-
- /* if its not a subdirectory then allow */
- if (!p)
- return 0;
-
- *p = 0;
- if (link_stat(fname, &st2)) {
- *p = '/';
- return 0;
- }
- *p = '/';
-
- return (st2.st_dev != filesystem_dev);
-}
-
#define STRDUP(ap, p) (ap ? string_area_strd...
2014 Dec 24
0
[PATCH 1/8] extlinux/main.c: support unmounted ext2/3/4 filesystem
...te_only, struct stat st)
{
- struct stat st, fst;
+ struct stat fst;
int devfd, rv;
const char *devname;
- devfd = open_device(path, &st, &devname);
- if (devfd < 0)
- return 1;
+ /* Support dir, ext2, ext3 and ext4 filesystem (device or file block) */
+ if S_ISDIR(st.st_mode) {
+ devfd = open_device(path, &st, &devname);
+ if (devfd < 0)
+ return 1;
+ } else if (S_ISBLK(st.st_mode) || S_ISREG(st.st_mode)) {
+ if ((devfd = open(path, O_RDWR | O_SYNC)) < 0) {
+ fprintf(stderr, "%s: cannot open de...
2023 May 17
1
[PATCH] Add --omit-{device,special}-times options
...rn int delete_before;
extern int delete_during;
@@ -482,7 +484,12 @@ int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp)
return 0;
#endif
} else {
- if (preserve_mtimes && any_time_differs(sxp, file, fname))
+ int keep_time = !preserve_mtimes ? 0
+ : S_ISDIR(file->mode) ? !omit_dir_times
+ : IS_DEVICE(file->mode) ? !omit_device_times
+ : IS_SPECIAL(file->mode) ? !omit_special_times
+ : 1;
+ if (keep_time && any_time_differs(sxp, file, fname))
return 0;
if (perms_differ(file, sxp))
return 0;
@@ -509,6 +516,8 @...
2004 Dec 13
2
[LLVMdev] Which StatusInfo fields should have values set when dealing with win32 platform
.../by_handle_file_information_str.asp)
from windows instead of the unix stuff in getStatusInfo:
--- (excerpt start) -------------
info.fileSize = buf.st_size;
info.modTime.fromEpochTime(buf.st_mtime);
info.mode = buf.st_mode;
info.user = buf.st_uid;
info.group = buf.st_gid;
info.isDir = S_ISDIR(buf.st_mode);
if (info.isDir && path[path.length()-1] != '/')
path += '/';
--- (excerpt end) -------------
The getStatusInfo is used in the code of gccld and is missing in win32
Path.cpp file.
Henrik.
=============================================================
He...
2009 May 29
1
[PATCH v2] klibc-utils: add simple ls
...'S');
+
+ putchar(STAT_ISSET(st->st_mode, S_IROTH) ? 'r' : '-');
+ putchar(STAT_ISSET(st->st_mode, S_IWOTH) ? 'w' : '-');
+
+ !STAT_ISSET(st->st_mode, S_ISVTX) ?
+ putchar(STAT_ISSET(st->st_mode, S_IXOTH) ? 'x' : '-') :
+ putchar(S_ISDIR(st->st_mode) ? 't' : 'T');
+
+ if (S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode)) {
+ rc = asprintf(&fmt," %%%dju %%%dju %%%dju %%%du,%%%du %%s",
+ max_nlinks, max_uid, max_gid, max_maj, max_min);
+ if (rc == -1) {
+ perror("asprintf&quo...
2009 May 28
1
[PATCH] klibc-utils: add minils
...;st_mode, S_IROTH) ? "r" : "-",
+ STAT_ISSET(st->st_mode, S_IWOTH) ? "w" : "-");
+
+ !STAT_ISSET(st->st_mode, S_ISVTX) ?
+ printf ("%s", STAT_ISSET(st->st_mode, S_IXOTH) ? "x" : "-") :
+ printf ("%s", S_ISDIR(st->st_mode) ? "t" : "T");
+
+ sz = snprintf(NULL, 0, " %%%dju %%%dju %%%dju", max_nlinks, max_uid, max_gid);
+ if ((fmt = malloc(max_size + sz + 1)) == NULL) {
+ perror("malloc");
+ exit(1);
+ }
+
+ if (S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode)...
2006 Dec 29
3
[git patches] ocfs2 fixes
...uncating pages because truncate_inode_pages waits
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 9fd590b..10953a5 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -149,6 +149,17 @@ int ocfs2_should_update_atime(struct ino
((inode->i_sb->s_flags & MS_NODIRATIME) && S_ISDIR(inode->i_mode)))
return 0;
+ /*
+ * We can be called with no vfsmnt structure - NFSD will
+ * sometimes do this.
+ *
+ * Note that our action here is different than touch_atime() -
+ * if we can't tell whether this is a noatime mount, then we
+ * don't know whether to trust th...
2017 May 26
9
[Bug 12806] New: Deleting in a row of hardlinked snapshots resets file permissions.
https://bugzilla.samba.org/show_bug.cgi?id=12806
Bug ID: 12806
Summary: Deleting in a row of hardlinked snapshots resets file
permissions.
Product: rsync
Version: 3.1.0
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P5
Component: core
2015 Mar 12
3
location of dovecot.rawlog-directory
How is it possible to have the dovecot.rawlog-directory outside the
mail_location? A link to another directory is not because it is checked
in rawlog.c S_ISDIR to directory.
2014 Dec 01
2
Hide unreadeable directory
Hello,
I am using samba 3.6.6
I would like to use the option "hide unreadable = yes" but only for directories because the actual option slow down the access to directories with a large number of files and I don't need to hide these files.
Is it possible and how can I do this ? And, will it improve directory access ?
Thanks
--
David
2017 Jun 08
0
[Bug 12806] Deleting in a row of hardlinked snapshots resets file permissions.
...s)
}
strlcpy(p, fp->basename, remainder);
- if (!(fp->mode & S_IWUSR) && !am_root && fp->flags & FLAG_OWNED_BY_US)
- do_chmod(fname, fp->mode | S_IWUSR);
/* Save stack by recursing to ourself directly. */
if (S_ISDIR(fp->mode)) {
+ if (!(fp->mode & S_IWUSR) && !am_root && fp->flags &
FLAG_OWNED_BY_US)
+ do_chmod(fname, fp->mode | S_IWUSR);
if (delete_dir_contents(fname, flags | DEL_RECURSE) != DR_SUCCESS)
ret = DR_NOT_EM...