search for: d_name

Displaying 20 results from an estimated 295 matches for "d_name".

Did you mean: __name
2017 Feb 14
0
[PATCH 2/2] GCC 7: Allocate sufficient space for sprintf output.
...^~~~~ or this form: sync.c: In function 'fsync_devices': sync.c:108:50: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size 251 [-Werror=format-truncation=] snprintf (dev_path, sizeof dev_path, "/dev/%s", d->d_name); ^~ Fixed by converting these into dynamic allocation, or making the output buffer larger, whichever was easier. --- cat/filesystems.c | 2 +- daemon/9p.c | 10 +++++++--- daemon/debug.c | 12 ++++++++++-- daemon/devspart...
2009 Jun 03
3
How to get file info of a directory in linux kernel space?
...ir, int depth){ DIR *dp; 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); print...
2009 Jun 03
3
How to get file info of a directory in linux kernel space?
...ir, int depth){ DIR *dp; 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); print...
2017 Feb 14
0
[PATCH v2 2/2] GCC 7: Allocate sufficient space for sprintf output.
...^~~~~ or this form: sync.c: In function 'fsync_devices': sync.c:108:50: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size 251 [-Werror=format-truncation=] snprintf (dev_path, sizeof dev_path, "/dev/%s", d->d_name); ^~ Fixed by converting these into dynamic allocation, or making the output buffer larger, whichever was easier. There is a gnulib macro we can use to make this simpler for integers. It requires a new gnulib module (intprops), but it turns out th...
2009 Aug 03
1
[PATCH] Recognise cd-rom devices in devsparts.c
...**r = NULL; int size = 0, alloc = 0; - DIR *dir; - struct dirent *d; - char buf[256]; - - dir = opendir ("/sys/block"); - if (!dir) { - reply_with_perror ("opendir: /sys/block"); - return NULL; - } - while ((d = readdir (dir)) != NULL) { - if (strncmp (d->d_name, "sd", 2) == 0 || - strncmp (d->d_name, "hd", 2) == 0 || - strncmp (d->d_name, "vd", 2) == 0) { - snprintf (buf, sizeof buf, "/dev/%s", d->d_name); + /* Add a device to the list of devices */ + int add_to_device_list(const char *device) { +...
2017 Jan 19
3
[PATCH 1/2] daemon: Fix part-to-dev when the partition name includes p<N>.
From: Pino Toscano <ptoscano@redhat.com> If the device name ends with a number, Linux uses partition names of the form <device>p<N>. Handle this case by knocking off the 'p' character. --- daemon/devsparts.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/daemon/devsparts.c b/daemon/devsparts.c index 5862ae2..b764f63 100644 --- a/daemon/devsparts.c +++
2017 Feb 14
4
[PATCH v2 0/2] GCC 7: Misc fixes
v1 -> v2: - Use intprops macro suggested by danpb. Rich.
2003 Jan 16
0
[PATCH] Using qstr in ext3_get_parent()
...t->d_inode; if (!(bh = ext3_bread (NULL,dir, 0, 0, err))) goto fail; root = (struct dx_root *) bh->b_data; @@ -345,8 +344,8 @@ } hinfo->hash_version = root->info.hash_version; hinfo->seed = EXT3_SB(dir->i_sb)->s_hash_seed; - if (dentry) - ext3fs_dirhash(dentry->d_name.name, dentry->d_name.len, hinfo); + if (entry) + ext3fs_dirhash(entry->name, entry->len, hinfo); hash = hinfo->hash; if (root->info.unused_flags & 1) { @@ -706,15 +705,15 @@ */ static inline int search_dirblock(struct buffer_head * bh, struct inode *dir, - s...
2011 Aug 17
2
[PATCH] btrfs: fix d_off in the first dirent
...offset" of filldir() for the 2nd dirent for "..") is wrongly assigned in btrfs_real_readdir(), telldir returns same offset for different locations. | # mkfs.btrfs /dev/sdb1 | # mount /dev/sdb1 fs0 | # cd fs0 | # touch file0 file1 | # ../test | telldir: 0 | readdir: d_off = 2, d_name = "." | telldir: 2 | readdir: d_off = 2, d_name = ".." | telldir: 2 | readdir: d_off = 3, d_name = "file0" | telldir: 3 | readdir: d_off = 2147483647, d_name = "file1" | telldir: 2147483647 To fix this problem, pass filp->f_pos (which is loff_t) in...
2017 Feb 14
2
[PATCH 1/2] GCC 7: Add __attribute__((noreturn)) to some usage functions which call exit.
This happens with GCC 7.0.1. The errors were all of the form: qemu-speed-test.c: In function 'main': qemu-speed-test.c:153:7: error: this statement may fall through [-Werror=implicit-fallthrough=] usage (EXIT_SUCCESS); ^~~~~~~~~~~~~~~~~~~~ qemu-speed-test.c:155:5: note: here default: ^~~~~~~ --- builder/index-validate.c | 2 +-
2002 Apr 03
2
cross compilation?
...on. Attached is a patch that *might* make the right paranoid assumptions, but I am not positive. -- bryan --- configure.ac.orig Tue Feb 26 22:12:35 2002 +++ configure.ac Wed Mar 27 14:28:02 2002 @@ -437,20 +437,6 @@ ] ) -AC_MSG_CHECKING([whether struct dirent allocates space for d_name]) -AC_TRY_RUN( - [ -#include <sys/types.h> -#include <dirent.h> -int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));} - ], - [AC_MSG_RESULT(yes)], - [ - AC_MSG_RESULT(no) - AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME) - ] -) - # Check whether user wants S/Key sup...
2018 Oct 30
1
Re: [PATCH nbdkit 4/4] Add floppy plugin.
On 10/30/18 11:42 AM, Richard W.M. Jones wrote: > >>> + errno = 0; >>> + while ((d = readdir (DIR)) != NULL) { >>> + if (strcmp (d->d_name, ".") == 0 || >>> + strcmp (d->d_name, "..") == 0) >>> + continue; strcmp() leaves errno alone (well, POSIX doesn't guarantee that, but no sane implementation of strcmp() would change errno during a string compare) >>> + >>&...
2001 Mar 28
0
sftp client globbing problems on Solaris, Irix, etc
...iff -u -r1.108 acconfig.h --- acconfig.h 2001/03/17 01:15:38 1.108 +++ acconfig.h 2001/03/28 03:28:37 @@ -308,6 +308,9 @@ /* Define if your system glob() function has gl_matchc options in glob_t */ #undef GLOB_HAS_GL_MATCHC +/* Define in your struct dirent expects you to allocate extra space for d_name */ +#undef BROKEN_ONE_BYTE_DIRENT_D_NAME + @BOTTOM@ /* ******************* Shouldn't need to edit below this line ************** */ Index: configure.in =================================================================== RCS file: /var/cvs/openssh/configure.in,v retrieving revision 1.268 diff...
2017 Jan 19
0
[PATCH 2/2] daemon: Return MD partitions in guestfs_list_partitions (RHBZ#1414510).
...ered block device */ static char ** -foreach_block_device (block_dev_func_t func) +foreach_block_device (block_dev_func_t func, bool return_md) { CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (r); DIR *dir; @@ -60,7 +61,9 @@ foreach_block_device (block_dev_func_t func) STREQLEN (d->d_name, "hd", 2) || STREQLEN (d->d_name, "ubd", 3) || STREQLEN (d->d_name, "vd", 2) || - STREQLEN (d->d_name, "sr", 2)) { + STREQLEN (d->d_name, "sr", 2) || + (return_md && + STREQLEN (d-&g...
2012 Dec 05
1
NFS, deleting folder issue
...#### Debugging: I defined my own my_delete_dir and added it to the delete_dir list in mailbox_list_vfuncs In my_delete_dir I just call readdir on that folder, and print the files via syslog. Here's the content of F1 before calling delete_dir: Dec 05 10:29:14 imap(testuser1): my_delete_dir: d_name: "new" inode: 843617 Dec 05 10:29:14 imap(testuser1): my_delete_dir: d_name: "tmp" inode: 843623 Dec 05 10:29:14 imap(testuser1): my_delete_dir: d_name: "cur" inode: 843616 Dec 05 10:29:14 imap(testuser1): my_delete_dir: d_name: "dovecot.index.log" inod...
2002 Jun 29
0
[Bug 321] New: configure does not work when cross compiling
...r runtime detection. Attached is a patch that allows Openssh 3.4p1 to cross-compile. --- openssh-3.4p1/configure.ac Tue Jun 25 15:35:16 2002 +++ openssh-3.4p1.ayr/configure.ac Fri Jun 28 14:21:34 2002 @@ -463,20 +463,6 @@ ] ) -AC_MSG_CHECKING([whether struct dirent allocates space for d_name]) -AC_TRY_RUN( - [ -#include <sys/types.h> -#include <dirent.h> -int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));} - ], - [AC_MSG_RESULT(yes)], - [ - AC_MSG_RESULT(no) - AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME) - ] -) - # Check whether user wants S/Key suppo...
2007 Dec 09
2
v1.1.beta11 released
http://dovecot.org/releases/1.1/beta/dovecot-1.1.beta11.tar.gz http://dovecot.org/releases/1.1/beta/dovecot-1.1.beta11.tar.gz.sig This one should be the last beta release before the first v1.1 release candidate. I'll try to stay away from this list and Dovecot in general for the next 1,5 weeks. I've several exams coming up and I should have started studying for them days ago already.. :)
1999 Feb 22
0
(Fwd) Linux autofs overflow in 2.0.36+
...er@battlemech.nws.net> _____________________________________________________________________________ Summary The autofs kernel module does not check the size of the directory names it receives. It is passed the name and the names length through dentry->d_name.name and dentry->d_name.len respectively. Later on it memcpy()'s the name into a 256 byte buffer, using dentry->d_name.len as the number of bytes to copy, without checking its size. A nonprivilaged user may attempt to cd to a directory name exceeding 255 characters. This overwrites memory...
2009 Aug 06
1
[PATCH] Fix errno check in readdir in devsparts.c
...= opendir ("/sys/block"); @@ -49,8 +48,11 @@ foreach_block_device (block_dev_func_t func) return NULL; } - errno = 0; - while ((d = readdir (dir)) != NULL) { + while(1) { + errno = 0; + struct dirent *d = readdir(dir); + if(NULL == d) break; + if (strncmp (d->d_name, "sd", 2) == 0 || strncmp (d->d_name, "hd", 2) == 0 || strncmp (d->d_name, "vd", 2) == 0 || -- 1.6.2.5
2013 Apr 25
1
[syslinux:rockridge] iso9660.c did not copy terminating 0 of Rock Ridge name
...gt; +++ b/core/fs/iso9660/iso9660.c > @@ -240,7 +240,7 @@ static int iso_readdir(struct file *file, struct dirent *dirent) > /* Try to get Rock Ridge name */ > ret = susp_rr_get_nm(fs, (char *) de, &rr_name, &name_len); > if (ret > 0) { > - memcpy(dirent->d_name, rr_name, name_len); > + memcpy(dirent->d_name, rr_name, name_len + 1); memcpy(dirent->d_name, rr_name, name_len); dirent->d_name[name_len] = '\0'; ? -hpa