search for: fdopen

Displaying 20 results from an estimated 119 matches for "fdopen".

2016 Nov 13
1
Memory leak with tons of closed connections
Using dup() before fdopen() (and calling fclose() on the connection when it is closed) indeed fixes the memory leak. FYI, Gabor Index: src/main/connections.c =================================================================== --- src/main/connections.c (revision 71653) +++ src/main/connections.c (working copy) @@ -576,7 +...
2014 Apr 09
0
[klibc:master] Move architecture-specific initialization to arch/
...de/arch/i386/klibc/archconfig.h | 3 +++ usr/include/klibc/sysconfig.h | 9 +++++++++ usr/klibc/arch/i386/Kbuild | 2 +- usr/klibc/arch/i386/archinit.c | 18 ++++++++++++++++++ usr/klibc/libc_init.c | 21 +++++++++------------ usr/klibc/stdio/fdopen.c | 2 +- 6 files changed, 41 insertions(+), 14 deletions(-) diff --git a/usr/include/arch/i386/klibc/archconfig.h b/usr/include/arch/i386/klibc/archconfig.h index b409a21..d8db763 100644 --- a/usr/include/arch/i386/klibc/archconfig.h +++ b/usr/include/arch/i386/klibc/archconfig.h...
2007 Jan 03
1
file descriptor leak?
We are having problems with the latest Dovecot 1.0 (RC15) regarding file descriptors > 255 being handed off to fdopen() via crypt() via PAM(?). This is a problem on Solaris 10 due to the fact that the stdio library does not support file descriptors > 255 (in order to remain binary-compatibile with older binaries). Here are the messages we run into if we get too many (~250?) concurrent IMAP/POP sessions: Jan...
2016 Nov 11
2
Memory leak with tons of closed connections
On Fri, Nov 11, 2016 at 12:08 PM, Martin Maechler <maechler at stat.math.ethz.ch> wrote: >>>>>> Gergely Dar?czi <daroczig at rapporter.net> >>>>>> on Thu, 10 Nov 2016 16:48:12 +0100 writes: > > > Dear All, > > I'm developing an R application running inside of a Java daemon on > > multiple threads, and
2019 Oct 17
2
[PATCH nbdkit] server: Allow file descriptors to be passed to nbdkit_read_password.
...rd) == -1) + return -1; + } + /* Read password from a file. */ else if (value[0] == '+') { int fd; @@ -457,22 +468,8 @@ nbdkit_read_password (const char *value, char **password) nbdkit_error ("open %s: %m", &value[1]); return -1; } - fp = fdopen (fd, "r"); - if (fp == NULL) { - nbdkit_error ("fdopen %s: %m", &value[1]); - close (fd); + if (read_password_from_fd (&value[1], fd, password) == -1) return -1; - } - r = getline (password, &n, fp); - err = errno; - fclose (fp); -...
2018 Feb 01
2
AuthDatabase CheckPassword broken?
...sed to be the password. > > > > Why is this no longer working? How can I fix it? > > > > THX --Mark > Our CI has test > > #!/usr/bin/env python > # -*- coding: utf-8 -*- > import os, sys > > DOVECOT_PW_FD = 3 > > def checkPassword(): > ? with os.fdopen(DOVECOT_PW_FD, 'r') as s: > ??? data = s.read().split("\0") > ??? if data[0] != "testuser" or data[1] != "pass": > ????? return False > ??? os.environ["USER"] = data[0] > ??? os.environ["EXTRA"] = "userdb_uid=vmail userdb...
2002 Jan 07
0
rsync-2.5.1 / zlib patches
...* For conditions of distribution and use, see copyright notice in zlib.h @@ -13,7 +14,11 @@ #ifndef _Z_UTIL_H #define _Z_UTIL_H +#ifdef __VMS +#include "rsync.h" +#else #include "../rsync.h" +#endif #include "zlib.h" #if 0 @@ -137,9 +142,11 @@ # define fdopen(fd,mode) NULL /* No fdopen() */ #endif -#if (defined(_MSC_VER) && (_MSC_VER >= 600)) +#ifdef _MSC_VER +#if _MSC_VER >= 600 # define fdopen(fd,type) _fdopen(fd,type) #endif +#endif /* Common defaults */ @@ -155,7 +162,11 @@ /* functions */ #ifdef HAVE...
2019 Mar 28
0
[PATCH v2 4/4] OCaml tools: output messages into JSON for machine readable
...rt json +import os +import sys +import unittest + +exe = "tools_messages_tests" + +if sys.version_info >= (3, 4): + def set_fd_inheritable(fd): + os.set_inheritable(fd, True) +else: + def set_fd_inheritable(fd): + pass + + +if sys.version_info >= (3, 0): + def fdopen(fd, mode): + return open(fd, mode) + + def isModuleInstalled(mod): + import importlib + return bool(importlib.util.find_spec(mod)) +else: + def fdopen(fd, mode): + return os.fdopen(fd, mode) + + def isModuleInstalled(mod): + import imp + try: +...
2015 Oct 22
8
RFC: Inlining report
...f the report. Omitted parts are indicated by .... in the report.) ---- Begin Inlining Report ---- Option Values: inline-threshold: 225 inlinehint-threshold: 325 inlinecold-threshold: 225 inlineoptsize-threshold: 15 COMPILE FUNC: fopen_output_safely -> EXTERN: open -> EXTERN: fdopen -> EXTERN: close DEAD STATIC FUNC: setExit DEAD STATIC FUNC: copyFileName DEAD STATIC FUNC: showFileNames DEAD STATIC FUNC: stat .... COMPILE FUNC: cleanUpAndFail -> llvm.lifetime.start [[Callee is intrinsic]] -> INLINE: stat (35<=487) <<Callee is single...
2000 Oct 10
4
Mac Ogg Vorbis Player
...release doesn't seem to fix the "tearing sound" problem. I think this might be related to problems using low-level Ogg Vorbis code as opposed to VorbisFile, but we don't have VorbisFile on Mac yet (I can't see it working very well with Mac HFS functions until Codewarrior gets fdopen() support). The reason I think this is that on linux, the targets that use VorbisFile (ogg123, xmms plugin) do not clip (at least not with the tearing sound associated with the Mac player), while the decoder_example (which uses lower-level functions) reports clipping (though I have yet to test the...
2019 Oct 17
0
Re: [PATCH nbdkit] server: Allow file descriptors to be passed to nbdkit_read_password.
...r). However that was contrary to the documentation, and this > commit now prevents that. > --- > > +static int > +read_password_from_fd (const char *what, int fd, char **password) > +{ > + FILE *fp; > + size_t n; > + ssize_t r; > + int err; > + > + fp = fdopen (fd, "r"); > + if (fp == NULL) { > + nbdkit_error ("fdopen %s: %m", what); > + close (fd); > + return -1; > + } > + r = getline (password, &n, fp); This prevents a password from containing a newline. Is that a problem? Can a password contain...
2018 Feb 02
0
AuthDatabase CheckPassword broken?
Script didn't run: File "/root/tmp/checkpwtest.py", line 8 o?= with os.fdopen(DOVECOT_PW_FD, 'r') as s: ^ SyntaxError: invalid syntax --Mark -----Original Message----- From: Mark Foley <mfoley at ohprs.org> Date: Thu, 01 Feb 2018 15:34:15 -0500 Organization: Ohio Highway Patrol Retirement System To: dovecot at dovecot.org Subject: Re: AuthDatabase CheckPa...
2004 Aug 06
0
Sun audio driver for speexdec
...include <fcntl.h> +#ifndef AUDIO_ENCODING_SLINEAR +#define AUDIO_ENCODING_SLINEAR AUDIO_ENCODING_LINEAR /* Solaris */ +#endif #endif #include <string.h> @@ -166,6 +174,32 @@ FILE *out_file_open(char *outFile, int r close(audio_fd); exit(1); } + fout = fdopen(audio_fd, "w"); +#elif defined HAVE_SYS_AUDIOIO_H + audio_info_t info; + int audio_fd; + + audio_fd = open("/dev/audio", O_WRONLY); + if (audio_fd<0) + { + perror("Cannot open /dev/audio"); + exit(1); + } + + AUDIO...
2016 Nov 11
0
Memory leak with tons of closed connections
...ew of R itself. Yes, R does not know about it, it does not manage this memory (any more), but the R process requested this memory from the OS, and never gave it back, which is basically the definition of a memory leak. No? I think the leak is because 'stdin' is special and R opens it with fdopen(): https://github.com/wch/r-source/blob/f8cdadb769561970cc42776f563043ea5e12fe05/src/main/connections.c#L561-L579 and then it does not close it: https://github.com/wch/r-source/blob/f8cdadb769561970cc42776f563043ea5e12fe05/src/main/connections.c#L636 I understand that R cannot fclose the FILE*, b...
2001 Feb 21
0
Private key files closed twice --
...he two routines to do their own closing but moves the `close(fd)' in "load_private_key" into the default position only. -- Paul Townsend (aab at purdue.edu) =-=-=-=-=-= --- authfile.c.orig Thu Feb 8 21:11:24 2001 +++ authfile.c Tue Feb 20 19:27:20 2001 @@ -446,6 +446,7 @@ fp = fdopen(fd, "r"); if (fp == NULL) { error("fdopen failed"); + close(fd); return 0; } pk = PEM_read_PrivateKey(fp, NULL, NULL, (char *)passphrase); @@ -536,10 +537,11 @@ case KEY_RSA: case KEY_UNSPEC: ret = load_private_key_ssh2(fd, passphrase, key, comment_return); +...
2000 Apr 22
0
meta socket
oi (ok now in english just in case), How about using fdopen() on the meta socket, so you can use constructions like this on the socket: file=fdopen(fd,"r+"); ... fgets(buf,BUFSIZE,file); sscanf(buf,"%bladiebla",&variables); (fscanf seeks and that's not nice on sockets, so that's why this.) This seems a lot easier to me tha...
2002 Nov 25
0
Linux and Samba Code
...t;exiting...\n", MINPWLEN); exit(1); } } /* get a private stderr, then close stderr/stdout to silence pwd programs */ if ((fd=dup(2)) < 0) { fprintf(stderr, "Strange! Couldn't dup error-output fd, exiting...\n"); exit(1); } if ((mystderr=fdopen(fd, "w"))== NULL) { fprintf(stderr, "Strange! Couldn't fdopen new stderr fd, exiting...\n"); exit(1); } close(1); close(2); /* detach from controlling tty to get password programs to read stdin */ if ((fd=open("/dev/tty", O_RDWR))>= 0) {...
2002 Jan 30
1
Patch: update zlib/* to 1.1.3
...face to zlib now in Python 1.5 (Jeremy Hylton) +- new Makefile.riscos (Rich Walker) +- initialize static descriptors in trees.c for embedded targets (Nick Smith) +- use "foo-gz" in example.c for RISCOS and VMS (Nick Smith) +- add the OS/2 files in Makefile.in too (Andrew Zabolotny) +- fix fdopen and halloc macros for Microsoft C 6.0 (Tom Lane) +- fix maketree.c to allow clean compilation of inffixed.h (Mark) +- fix parameter check in deflateCopy (Gunther Nikl) +- cleanup trees.c, use compressed_len only in debug mode (Christian Spieler) +- Many portability patches by Christian Spieler: +...
2006 Jan 20
1
Bug: Copying several files to non-directory.
Dear openssh people, Here's something to try: $ echo a >a $ echo b >b $ echo c >c $ $ scp a b c $ $ echo $? 1 $ cat a b c a b b Ouch! Also, for comparison: $ cp a b c cp: copying multiple files, but last argument `c' is not a directory Try `cp --help' for more information. $ rcp a b c rcp: c: Not a directory. $ Note that the cp behavior is specified in SuSv2.
2018 Feb 01
2
AuthDatabase CheckPassword broken?
I had been using the CheckPassword authentication interface with dovecot 2.2.15, https://wiki2.dovecot.org/AuthDatabase/CheckPassword, and it was working. After upgrading to 2.2.33.2 CheckPassword no longer works. The referenced wiki page says, Checkpassword Interface Read <username> NUL <password> NUL from fd 3. I've checked the information read from fd 3 with 2.2.33.2