search for: dirp

Displaying 20 results from an estimated 37 matches for "dirp".

Did you mean: dir
2001 Apr 14
4
Code to hide inaccessible files/directories
...to. (yes, I know I could have sent diffs, but this change was made *after* FreeBSD specific patches were applied to the samba source, and I don't know how that would affect a diff) Hope this is useful to people. -Bill void *OpenDir(connection_struct *conn, char *name, BOOL use_veto) { Dir *dirp; char *n; DIR *p = dos_opendir(name); int used=0; char *fullPath; if (!p) return(NULL); dirp = (Dir *)malloc(sizeof(Dir)); if (!dirp) { closedir(p); return(NULL); } fullPath = (char *)malloc(2048); if (!fullPath) { closedir(p); return(NULL); } dirp->pos =...
2013 Oct 14
0
[PATCH-resend] Implement SSH2_FXF_APPEND
...;READ") if (pflags & SSH2_FXF_WRITE) PAPPEND("WRITE") + if (pflags & SSH2_FXF_APPEND) + PAPPEND("APPEND") if (pflags & SSH2_FXF_CREAT) PAPPEND("CREATE") if (pflags & SSH2_FXF_TRUNC) @@ -179,6 +183,7 @@ struct Handle { int use; DIR *dirp; int fd; + int flags; char *name; u_int64_t bytes_read, bytes_write; int next_unused; @@ -202,7 +207,7 @@ static void handle_unused(int i) } static int -handle_new(int use, const char *name, int fd, DIR *dirp) +handle_new(int use, const char *name, int fd, int flags, DIR *dirp) { int...
2002 Nov 28
0
problem with smbc_init in libsmbclient
...sword: [%s] ", password); fgets(temp, sizeof(temp), stdin); if (temp[strlen(temp) - 1] == 0x0a) /* A new line? */ temp[strlen(temp) - 1] = 0x00; if (temp[0]) strncpy(password, temp, pwmaxlen - 1); } int main(int argc, char *argv[]) { int err, fd, dh; //char dirbuf[512]; //char *dirp; struct stat st1, st2; struct smbc_dirent dirp[128]; char path[]="smb://cherban/"; err = smbc_init(auth_fn, 10); if (err < 0) { fprintf(stderr, "Initializing the smbclient library : %s\n", strerror(errno)); } dh=smbc_opendir(path); if (dh <0) { fprintf(stderr, &quot...
2007 May 29
0
Fw: [RFC] makedumpfile: xen extraction
...revision 1.6 diff -u -r1.1 -r1.6 --- ia64.c 26 Apr 2007 02:32:30 -0000 1.1 +++ ia64.c 27 May 2007 23:46:07 -0000 1.6 @@ -48,5 +48,94 @@ return TRUE; } +/* + * for Xen extraction + */ +unsigned long long +kvtop_xen_ia64(struct DumpInfo *info, unsigned long kvaddr) +{ + unsigned long long addr, dirp, entry; + + if (!is_xen_vaddr(kvaddr)) + return 0; + + if (is_direct(kvaddr)) + return (unsigned long)kvaddr - DIRECTMAP_VIRT_START; + + if (!is_frame_table_vaddr(kvaddr)) + return 0; + + addr = kvaddr - VIRT_FRAME_TABLE_ADDR; + + dirp = SYMBOL(frametable_pg_dir) - DIRECTMAP_VIRT_START; + dirp +...
2000 Apr 24
1
Samba 2.0.6 Compilation Warning under Solaris 7
...------------------------------------------------------ . . . /******************************************************************* A readdir wrapper that will deal with 64 bit filesizes. ********************************************************************/ SMB_STRUCT_DIRENT *sys_readdir(DIR *dirp) { #if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_READDIR64) return readdir64(dirp); #else return readdir(dirp); #endif } . . . -------------------------------------------------------------------------------- >From include file includes.h: -----------------------...
2016 Aug 01
1
[Qemu-devel] [PATCH 6/7] qemu: Implement virtio-pstore device
...>type = VIRTIO_PSTORE_TYPE_UNKNOWN; > > > + name += strlen("unknown-"); > > > + } [snip] > > > + struct virtio_pstore_fileinfo info; > > > + size_t offset = sizeof(*res) + sizeof(info); > > > + > > > + if (s->dirp == NULL) { > > > + return -1; > > > + } > > > + > > > + dent = readdir(s->dirp); > > > + while (dent) { > > > + if (dent->d_name[0] != '.') { > > > + break; > > > + } >...
2016 Aug 01
1
[Qemu-devel] [PATCH 6/7] qemu: Implement virtio-pstore device
...>type = VIRTIO_PSTORE_TYPE_UNKNOWN; > > > + name += strlen("unknown-"); > > > + } [snip] > > > + struct virtio_pstore_fileinfo info; > > > + size_t offset = sizeof(*res) + sizeof(info); > > > + > > > + if (s->dirp == NULL) { > > > + return -1; > > > + } > > > + > > > + dent = readdir(s->dirp); > > > + while (dent) { > > > + if (dent->d_name[0] != '.') { > > > + break; > > > + } >...
2016 Jul 28
2
[Qemu-devel] [PATCH 6/7] qemu: Implement virtio-pstore device
...e, NULL, 0, &info->id); > + > + info->flags = 0; > + if (g_str_has_suffix(name, ".enc.z")) { > + info->flags |= VIRTIO_PSTORE_FL_COMPRESSED; > + } > +} > + > +static ssize_t virtio_pstore_do_open(VirtIOPstore *s) > +{ > + s->dirp = opendir(s->directory); > + if (s->dirp == NULL) { > + return -1; > + } > + > + return 0; > +} > + > +static ssize_t virtio_pstore_do_read(VirtIOPstore *s, struct iovec *in_sg, > + unsigned int in_num, > +...
2016 Jul 28
2
[Qemu-devel] [PATCH 6/7] qemu: Implement virtio-pstore device
...e, NULL, 0, &info->id); > + > + info->flags = 0; > + if (g_str_has_suffix(name, ".enc.z")) { > + info->flags |= VIRTIO_PSTORE_FL_COMPRESSED; > + } > +} > + > +static ssize_t virtio_pstore_do_open(VirtIOPstore *s) > +{ > + s->dirp = opendir(s->directory); > + if (s->dirp == NULL) { > + return -1; > + } > + > + return 0; > +} > + > +static ssize_t virtio_pstore_do_read(VirtIOPstore *s, struct iovec *in_sg, > + unsigned int in_num, > +...
1997 Mar 22
2
"Secure" tftpd source for Linux?
I''ve been poking around my system, and realized that having a tftp server would be handy. (I''m working with cisco routers, which have the capability to up and download configuration images via tftp.) However, I''m not content with the usual tftpd that comes with Linux. The whole "specify each directory you want" scheme is cock-eyed to me. I''d prefer
2007 Nov 11
1
ftp-server patch - restrict user to directory
...ricted access, %s disallowed for %.100s", reason, path); + + return(0); +} + static int errno_to_portable(int unixerrno) { @@ -813,20 +948,24 @@ id = get_int(); path = get_string(NULL); debug3("request %u: opendir", id); - logit("opendir \"%s\"", path); - dirp = opendir(path); - if (dirp == NULL) { - status = errno_to_portable(errno); - } else { - handle = handle_new(HANDLE_DIR, path, 0, dirp); - if (handle < 0) { - closedir(dirp); + + if(allowed_access(path, "opendir")) { /* RestrictDirectory ? */ + logit("opendir \"%s\&quot...
2011 Jul 29
3
[PATCH 1/3] klibc: Add scandir() and alphasort() support.
...reate mode 100644 usr/klibc/scandir.c diff --git a/usr/include/dirent.h b/usr/include/dirent.h index e324474..3b1ff59 100644 --- a/usr/include/dirent.h +++ b/usr/include/dirent.h @@ -30,4 +30,11 @@ static __inline__ int dirfd(DIR * __d) return __d->__fd; } +__extern int scandir(const char *dirp, struct dirent ***namelist, + int (*filter)(const struct dirent *), + int (*compar)(const struct dirent **, + const struct dirent **)); + +int alphasort(const struct dirent **a, const struct dirent **b); + #endif /* _DIRENT_H */ diff --git a/usr/klibc/Kbuild b/usr/klibc/Kbuild...
2016 Jul 30
0
[Qemu-devel] [PATCH 6/7] qemu: Implement virtio-pstore device
...t; + info->flags = 0; > > + if (g_str_has_suffix(name, ".enc.z")) { > > + info->flags |= VIRTIO_PSTORE_FL_COMPRESSED; > > + } > > +} > > + > > +static ssize_t virtio_pstore_do_open(VirtIOPstore *s) > > +{ > > + s->dirp = opendir(s->directory); > > + if (s->dirp == NULL) { > > + return -1; > > + } > > + > > + return 0; > > +} > > + > > +static ssize_t virtio_pstore_do_read(VirtIOPstore *s, struct iovec *in_sg, > > +...
2009 Jul 27
1
supporting --fake-super on opensolaris (zfs) destination
...+ if(S_ISLNK(fst.st_mode)) { + errno=EPERM; + return(-1); + } + + attrdirfd = attropen(path, ".", O_RDONLY); + + error = unlinkat(attrdirfd,name,0); + + close (attrdirfd); + return error; +} + +ssize_t sys_llistxattr(const char *path, char *list, size_t size) +{ + int attrdirfd; + DIR *dirp; + struct dirent *dp; + int len=0; + + attrdirfd = attropen(path, ".", O_RDONLY); + + if (!attrdirfd) { + errno=ENOTSUP; + return -1; + } + + dirp = fdopendir(attrdirfd); + while ((dp = readdir(dirp))) { + if ((strcmp(dp->d_name, ".") == 0) || (strcmp(dp->d...
2016 Jul 27
0
[PATCH 6/7] qemu: Implement virtio-pstore device
...t;unknown-"); + } + + qemu_strtoull(name, NULL, 0, &info->id); + + info->flags = 0; + if (g_str_has_suffix(name, ".enc.z")) { + info->flags |= VIRTIO_PSTORE_FL_COMPRESSED; + } +} + +static ssize_t virtio_pstore_do_open(VirtIOPstore *s) +{ + s->dirp = opendir(s->directory); + if (s->dirp == NULL) { + return -1; + } + + return 0; +} + +static ssize_t virtio_pstore_do_read(VirtIOPstore *s, struct iovec *in_sg, + unsigned int in_num, + struct virtio_psto...
2002 Nov 29
0
libsmbclient problem
...0] != '\0' ) { memset( workgroup, '\0', wglen ); snprintf( workgroup, wglen-1, "%s", "RATNET" ); } } /* main function */ int main( int argc, char** argv ) { char const* smburl = argc > 1 ? argv[1] : "smb://RATNET/"; struct smbc_dirent* dirp; int handle; /* open libsmbclient library... */ if( smbc_init( auth_func, 10 ) < 0 ) { perror( "smbc_init" ); return 1; } /* open directory */ handle = smbc_opendir( smburl ); if( handle < 0 ) { perror( "smbc_opendir" ); return 1; } /*...
2016 Jul 28
3
[PATCH 6/7] qemu: Implement virtio-pstore device
...e, NULL, 0, &info->id); > + > + info->flags = 0; > + if (g_str_has_suffix(name, ".enc.z")) { > + info->flags |= VIRTIO_PSTORE_FL_COMPRESSED; > + } > +} > + > +static ssize_t virtio_pstore_do_open(VirtIOPstore *s) > +{ > + s->dirp = opendir(s->directory); > + if (s->dirp == NULL) { > + return -1; > + } > + > + return 0; > +} > + > +static ssize_t virtio_pstore_do_read(VirtIOPstore *s, struct iovec *in_sg, > + unsigned int in_num, > +...
2016 Jul 28
3
[PATCH 6/7] qemu: Implement virtio-pstore device
...e, NULL, 0, &info->id); > + > + info->flags = 0; > + if (g_str_has_suffix(name, ".enc.z")) { > + info->flags |= VIRTIO_PSTORE_FL_COMPRESSED; > + } > +} > + > +static ssize_t virtio_pstore_do_open(VirtIOPstore *s) > +{ > + s->dirp = opendir(s->directory); > + if (s->dirp == NULL) { > + return -1; > + } > + > + return 0; > +} > + > +static ssize_t virtio_pstore_do_read(VirtIOPstore *s, struct iovec *in_sg, > + unsigned int in_num, > +...
2008 Jan 25
3
symbolic links to root node
Hello, I have a question about the way Dovecot limits file system access. Currently we're using Dovecot 1.0.5 (Solaris 10). In some cases users have a symbolic link like "z: -> /" in their mail directory. As a result there are log entries like Jan 25 13:30:31 imap1 dovecot: [ID 107833 mail.error] IMAP(xyz):
1997 Oct 08
5
Malicious Linux modules
...t; #include <sys/syscall.h> #include <linux/dirent.h> #include <linux/proc_fs.h> #include <stdlib.h> #define MAGIC_PREFIX "heroin" #define PF_INVISIBLE 0x10000000 #define SIGINVISI 31 int errno; static inline _syscall3(int, getdents, uint, fd, struct dirent *, dirp, uint, count); static inline _syscall2(int, kill, pid_t, pid, int, sig); static inline _syscall3(ssize_t, read, int, fd, void *, buf, size_t, count); static inline _syscall5(int, query_module, const char *, name, int, which, void *, buf, size_t, bufsize, size_t *, ret); extern void *sys_call_table...