christos
4245319fac
use VIS_NOLOCALE
2015-05-23 11:48:13 +00:00
mlelstv
b4b5970a1f
strvisx is used here to encode binary data, but the encoding
...
depends on locale settings and the result might not be accepted
or even misinterpreted by the strunvis decoder. As a workaround
encode manually as a string of octal numbers.
strvisx should learn how enforce such an encoding by itself.
2015-05-23 09:18:01 +00:00
christos
70c8a4b907
fix incorrect type
2015-02-05 16:00:39 +00:00
christos
9a513d9643
make more descriptors that we open as close-on-exec
2014-09-18 13:58:20 +00:00
pooka
0c778f0d54
Avoid strict-alias problem flagged by certain compilers (e.g. Centos one):
...
libc/gen/utmpx.c:89: error: dereferencing pointer 'otv' does break strict-aliasing rules
reviewed by Christos (thanks!)
2013-09-05 17:35:11 +00:00
christos
3d365e7447
fix old style definitions; XXX: gcc should have picked them up but it did not.
2012-06-24 15:26:02 +00:00
christos
c5e820cae4
PR/45989: Martin Husemann: lint invocation does include -w only on i386
...
- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
builds)
approved by core@
2012-03-13 21:13:30 +00:00
christos
9292cfb210
close on exec fixes:
...
- open + fcntl -> open O_CLOEXEC
- configuration database file descriptors that can stay open are now opened
fopen(db, "re")
2011-10-15 23:00:01 +00:00
christos
369862dcef
Never invoke utmp_update() recursively if we are root. Instead close the
...
read-only file so it can be opened later. It can happen when a setuid
program utmp_update, seteuid(ruid) -> getutxent() -> seteuid(0) -> pututxent()
2011-09-17 01:52:29 +00:00
christos
461a86f9bd
merge christos-time_t
2009-01-11 02:45:45 +00:00
martin
ce099b4099
Remove clause 3 and 4 from TNF licenses
2008-04-28 20:22:51 +00:00
christos
52e2f11be9
PR/35129: David A. Holland: exit in utmpx code should be _exit
2006-11-26 17:33:23 +00:00
christos
5b84b3983f
compat core reorg.
2005-09-13 01:44:08 +00:00
christos
d8edf257eb
Don't create the lastlogx file with 0 mode.
2004-11-11 22:14:20 +00:00
wiz
4bfb9a4429
Add __warn_references for deprecated lastlogxname. Okayed by christos.
2003-09-06 16:42:10 +00:00
wiz
31fd31ccf7
Make getlastlogx have the pathname to the lastlogx database as first
...
argument, to be consistent with updlastlogx.
Approved by christos, reviewed by kleink.
[The lastlogxname function should not be used any longer.]
2003-08-26 16:48:32 +00:00
matt
f847c1a7f3
When updating wtmpx, if the write fails make sure to close the file (to
...
release the lock held on it). Use O_SHLOCK when adding just one record
since O_APPEND will enforce the atomicity that is required.
2003-08-25 23:09:37 +00:00
kleink
45cc3e349e
Need namespace.h to generate references to internal names.
2003-08-24 15:14:18 +00:00
christos
ea5d0d4403
keep track if we have the file opened as readonly or readwrite, so that
...
we don't need to call update_utmp, if our euid has changed, but we still
have a write reference to the file. Solves problem with chrooting processes.
2003-02-26 19:23:25 +00:00
christos
39f2f97867
lib/19176: Onno van der Linden: execl is called with too few arguments.
2002-11-26 16:52:07 +00:00
itojun
233424cdc2
make sure to bound string operation by strlcpy
...
(there are bunch of "strcpy is safe" comments, i think we should change them
to strlcpy as much as possible)
2002-11-17 20:49:33 +00:00
wiz
68ab92d7a4
Add some _DIAGASSERTS(). Ok'd by christos.
2002-10-25 20:42:02 +00:00
christos
fb0b215b6c
fix typo
2002-09-28 01:43:24 +00:00
christos
c73d854002
check for write and close errors, from wiz
2002-09-28 01:34:36 +00:00
wiz
8e14b98adf
Move comment that says 'the following are extensions' to the right place.
...
Approved by christos.
2002-09-26 17:08:42 +00:00
christos
a2e4cf52ec
use the fname we passed in.
2002-07-28 00:45:11 +00:00
christos
fef92308ac
add lastlogx implementation.
2002-07-27 19:38:29 +00:00
christos
d1ccf94413
reset fp when we are done with it.
2002-07-27 15:44:45 +00:00
simonb
e438da348e
Sprinkle some KNF.
2002-07-23 00:03:36 +00:00
christos
6d2cc5b8e6
- open for r+, then w+, then r.
...
- fix fread and fwrite error checking.
2002-04-15 16:47:03 +00:00
christos
6fa9e9789f
add two more gnu-like functions.
2002-04-04 19:42:14 +00:00
simonb
2ebbd79a63
Include <stdlib.h> for exit() prototype.
2002-03-11 03:29:49 +00:00
christos
3e7f0b7101
add updwtmpx(); requested by tron.
2002-03-05 16:16:02 +00:00
christos
002dc4be11
catch up with ut_name->ut_user change
2002-02-25 20:19:26 +00:00
christos
510f6a45d4
A simple utmpx implementation. Nothing uses it yet.
...
TODO: write the lastlog*() stuff.
2002-02-22 20:11:44 +00:00