Rich Felker
c0fe5b9da9
check for fd exhaustion in forkpty
...
we cannot report failure after forking, so the idea is to ensure prior
to fork that fd 0,1,2 exist. this will prevent dup2 from possibly
hitting a resource limit and failing in the child process. fcntl
rather than dup2 is used prior to forking to avoid race conditions.
2011-07-22 00:25:56 -04:00
Rich Felker
d40e344f7b
incorrect check for open failure in openpty function
...
-1, not 0, indicates failure
2011-07-22 00:23:36 -04:00
Rich Felker
6250c0be4b
wordexp cannot use we_offs unless WRDE_DOOFFS flag is set
...
previously, a potentially-indeterminate value from we_offs was being
used, resulting in wrong we_wordc and subsequent crashes in the
caller.
2011-06-25 18:54:33 -04:00
Rich Felker
d43ff110bc
fix memory leak on failure in realpath
2011-06-18 07:41:14 -04:00
Rich Felker
9a59faab3c
add useless, obsolescent function ulimit
2011-05-29 14:09:03 -04:00
Rich Felker
10d7561db5
properly create new session/controlling terminal in forkpty
2011-04-20 21:01:42 -04:00
Rich Felker
4921ce0867
implement (nonstandard) forkpty
2011-04-20 20:55:13 -04:00
Rich Felker
145c05345d
block cancellation in wordexp, handle more errors
2011-04-19 23:42:56 -04:00
Rich Felker
f0fc95d439
avoid malloc of potentially-large string in wordexp
2011-04-19 23:37:57 -04:00
Rich Felker
df9e11bb06
protect ftw and nftw against cancellation
2011-04-18 21:17:03 -04:00
Rich Felker
d2c604d5a4
protect syslog against cancellation
...
these functions are allowed to be cancellation points, but then we
would have to install cleanup handlers to avoid termination with locks
held.
2011-04-18 21:11:23 -04:00
Rich Felker
e98bdca9df
minimal realpath implementation using /proc
...
clean and simple, but fails when the caller does not have permissions
to open the file for reading or when /proc is not available. i may
replace this with a full implementation later, possibly leaving this
version as an optimization to use when it works.
2011-04-17 17:32:36 -04:00
Rich Felker
90f09a0dde
remove stupid debug code in wordexp
2011-04-15 12:07:26 -04:00
Rich Felker
d251c2645c
implement wordexp. first try, may be buggy. intended to be safe.
2011-04-15 12:06:34 -04:00
Rich Felker
19c1830eaa
simplify syslog, add vsyslog interface (nonstandard)
...
with datagram sockets, depending on fprintf not to flush the output
early was very fragile; the new version simply uses a small fixed-size
buffer. it could be updated to dynamic-allocate large buffers if
needed, but i can't envision any admin being happy about finding
64kb-long lines in their syslog...
2011-04-13 18:32:33 -04:00
Rich Felker
a77411a50d
remove useless SIGPIPE protection from syslog
...
per the standard, SIGPIPE is not generated for SOCK_DGRAM.
2011-04-13 17:51:45 -04:00
Rich Felker
a444ee3410
fix syslog (corrected SIGPIPE blocking, and using dgram instead of stream)
...
it actually appears the hacks to block SIGPIPE are probably not
necessary, and potentially harmful. if i can confirm this, i'll remove
them.
2011-04-13 17:24:25 -04:00
Rich Felker
91e836fda7
implement getgrouplist (for initgroups), formerly dummied-out
2011-04-13 09:39:47 -04:00
Rich Felker
750b738e53
add ptsname_r (nonstandard) and split ptsname (standard) to separate file
...
this eliminates the ugly static buffer in programs that use ptsname_r.
2011-04-13 08:35:32 -04:00
Rich Felker
c546be175c
move bswap functions to static inline in byteswap.h
2011-04-12 13:04:17 -04:00
Rich Felker
4f4ba4c02f
fix broken bswap_32
2011-04-12 12:18:11 -04:00
Rich Felker
0161244784
remove ugly warning-suppression hack from crypt - this invokes UB!
2011-04-11 01:50:26 -04:00
Rich Felker
9ae8d5fc71
fix all implicit conversion between signed/unsigned pointers
...
sadly the C language does not specify any such implicit conversion, so
this is not a matter of just fixing warnings (as gcc treats it) but
actual errors. i would like to revisit a number of these changes and
possibly revise the types used to reduce the number of casts required.
2011-03-25 16:34:03 -04:00
Rich Felker
aa398f56fa
global cleanup to use the new syscall interface
2011-03-20 00:16:43 -04:00
Rich Felker
bad481266e
fix compile failure: legacy cuserid needs to define feature test
2011-02-16 09:30:56 -05:00
Rich Felker
f7eb91e795
fix getrlimit handling on 32-bit systems, and ease porting to 64-bit
2011-02-15 05:42:27 -05:00
Rich Felker
0b44a0315b
initial check-in, version 0.5.0
2011-02-12 00:22:29 -05:00