Tree [47bb31] master /
 History



File Date Author Commit
 include 2013-07-17 Markus Duft Markus Duft [47bb31] added wchar.h, fixed sysconf test
 progs 2011-06-10 Markus Duft Markus Duft [8da709] add ldd, adapt makefile accordingly
 scripts 2010-07-15 mduft mduft [6a8cc5] intermediate check-in
 test 2013-07-17 Markus Duft Markus Duft [47bb31] added wchar.h, fixed sysconf test
 .gitignore 2011-05-25 Markus Duft Markus Duft [aaef0e] ignore generated header
 Makefile 2011-06-10 Markus Duft Markus Duft [8da709] add ldd, adapt makefile accordingly
 README 2011-05-16 Markus Duft Markus Duft [8bd296] fsync and fflush for sync() and futimes() flush...
 TODO 2011-05-03 Markus Duft Markus Duft [fd74fd] added headers to compensate dumb mistakes / dif...
 access.c 2011-04-29 Markus Duft Markus Duft [640cbe] fixed access, added getcwd
 actcache.c 2010-07-22 Markus Duft Markus Duft [231680] added more tracing, fixed bug in passwd, possib...
 actcache.h 2010-05-10 mduft mduft [65ddde] finishing touches for release.
 chown.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 close.c 2011-05-13 Markus Duft Markus Duft [d4a4df] added sync() and futimes() call
 creat.c 2011-05-13 Markus Duft Markus Duft [1bc20f] hmm.. fixing.
 dbgwrap.c 2011-05-23 Markus Duft Markus Duft [6be9a1] added fixes for interix 5.2
 dup.c 2011-05-16 Markus Duft Markus Duft [ce2f1d] added dup, dup2 and futimes data duplication.
 dup2.c 2011-05-16 Markus Duft Markus Duft [ce2f1d] added dup, dup2 and futimes data duplication.
 env_cron.c 2010-07-15 mduft mduft [6a8cc5] intermediate check-in
 env_login.c 2010-07-15 mduft mduft [6a8cc5] intermediate check-in
 env_winlogin.c 2010-07-15 mduft mduft [6a8cc5] intermediate check-in
 fchown.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 fclose.c 2011-05-13 Markus Duft Markus Duft [d4a4df] added sync() and futimes() call
 fflush.c 2011-05-16 Markus Duft Markus Duft [adeeeb] hmmmm.
 fgetc.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 fgetwc.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 fopen.c 2011-05-13 Markus Duft Markus Duft [1bc20f] hmm.. fixing.
 fork.c 2010-11-04 Markus Duft Markus Duft [f4b36d] minor fixes - interix3 build fixed.
 fputs.c 2011-05-13 Markus Duft Markus Duft [cfe472] reset timestamp on dirtyness
 fputws.c 2011-05-13 Markus Duft Markus Duft [cfe472] reset timestamp on dirtyness
 fread.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 freopen.c 2011-05-13 Markus Duft Markus Duft [1bc20f] hmm.. fixing.
 fstat.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 fsync.c 2011-05-16 Markus Duft Markus Duft [adeeeb] hmmmm.
 futimes.c 2011-05-23 Markus Duft Markus Duft [6be9a1] added fixes for interix 5.2
 futimes.h 2011-05-23 Markus Duft Markus Duft [6be9a1] added fixes for interix 5.2
 fwrite.c 2011-05-13 Markus Duft Markus Duft [cfe472] reset timestamp on dirtyness
 getc.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 getchar.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 getcwd.c 2011-04-29 Markus Duft Markus Duft [640cbe] fixed access, added getcwd
 geteuid.c 2010-07-22 Markus Duft Markus Duft [231680] added more tracing, fixed bug in passwd, possib...
 getgrent.c 2010-07-22 Markus Duft Markus Duft [231680] added more tracing, fixed bug in passwd, possib...
 getgrent_nomembers.c 2010-07-22 Markus Duft Markus Duft [231680] added more tracing, fixed bug in passwd, possib...
 getgrgid.c 2010-07-22 Markus Duft Markus Duft [231680] added more tracing, fixed bug in passwd, possib...
 getgrgid_ex.c 2011-05-25 Markus Duft Markus Duft [05e7db] new auto-detection of target interix.
 getgrgid_ex_r.c 2011-06-15 Markus Duft Markus Duft [9dde93] fixed user database handling
 getgrgid_nomembers.c 2010-07-22 Markus Duft Markus Duft [231680] added more tracing, fixed bug in passwd, possib...
 getgrgid_nomembers_r.c 2011-06-15 Markus Duft Markus Duft [9dde93] fixed user database handling
 getgrgid_r.c 2011-06-15 Markus Duft Markus Duft [9dde93] fixed user database handling
 getgrnam.c 2010-07-22 Markus Duft Markus Duft [231680] added more tracing, fixed bug in passwd, possib...
 getgrnam_nomembers.c 2010-07-22 Markus Duft Markus Duft [231680] added more tracing, fixed bug in passwd, possib...
 getgrnam_nomembers_r.c 2011-06-15 Markus Duft Markus Duft [9dde93] fixed user database handling
 getgrnam_r.c 2011-06-15 Markus Duft Markus Duft [9dde93] fixed user database handling
 getgroups.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 getpwent.c 2010-07-22 Markus Duft Markus Duft [231680] added more tracing, fixed bug in passwd, possib...
 getpwnam.c 2010-07-22 Markus Duft Markus Duft [231680] added more tracing, fixed bug in passwd, possib...
 getpwnam_r.c 2011-06-15 Markus Duft Markus Duft [9dde93] fixed user database handling
 getpwuid.c 2010-07-22 Markus Duft Markus Duft [231680] added more tracing, fixed bug in passwd, possib...
 getpwuid_ex.c 2010-07-22 Markus Duft Markus Duft [231680] added more tracing, fixed bug in passwd, possib...
 getpwuid_ex_r.c 2011-06-15 Markus Duft Markus Duft [9dde93] fixed user database handling
 getpwuid_r.c 2011-06-15 Markus Duft Markus Duft [9dde93] fixed user database handling
 getuid.c 2010-07-22 Markus Duft Markus Duft [231680] added more tracing, fixed bug in passwd, possib...
 getwc.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 getwchar.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 group.c 2010-07-19 mduft mduft [22bf4f] different build-dir, README added, debugging re...
 group_from_gid.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 lchown.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 libc.c 2010-07-19 Markus Duft Markus Duft [af7ca0] debug related improvements
 lstat.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 msgctl.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 open.c 2011-05-13 Markus Duft Markus Duft [d4a4df] added sync() and futimes() call
 passwd.c 2010-10-21 mduft mduft [4551ec] fixed passwd mapping, updated readme, addes str...
 poll.c 2010-10-27 Markus Duft Markus Duft [497108] removed unused variable - fixed strto[u]ll impl...
 pread.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 preload.c 2010-11-02 Markus Duft Markus Duft [c688f2] added more debug output control
 puts.c 2011-05-13 Markus Duft Markus Duft [d4a4df] added sync() and futimes() call
 putws.c 2011-05-13 Markus Duft Markus Duft [d4a4df] added sync() and futimes() call
 pwrite.c 2011-05-13 Markus Duft Markus Duft [cfe472] reset timestamp on dirtyness
 read.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 readv.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 select.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 semctl.c 2010-11-04 Markus Duft Markus Duft [f4b36d] minor fixes - interix3 build fixed.
 setegid.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 seteuid.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 setgid.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 setreuid.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 setuid.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 setuser.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 shmctl.c 2010-11-04 Markus Duft Markus Duft [f4b36d] minor fixes - interix3 build fixed.
 stat.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 strtoll.c 2010-10-27 Markus Duft Markus Duft [497108] removed unused variable - fixed strto[u]ll impl...
 strtoull.c 2010-10-27 Markus Duft Markus Duft [497108] removed unused variable - fixed strto[u]ll impl...
 suacomp.h 2011-05-25 Markus Duft Markus Duft [05e7db] new auto-detection of target interix.
 sync.c 2011-05-13 Markus Duft Markus Duft [d4a4df] added sync() and futimes() call
 sync.h 2011-05-13 Markus Duft Markus Duft [d4a4df] added sync() and futimes() call
 sysconf.c 2011-09-12 Markus Duft Markus Duft [34be4b] lower arg_max limit a little, as xargs started ...
 uidtontsid.c 2010-11-02 Markus Duft Markus Duft [e26122] oups - wrong return type!
 uidtontsid_r.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 user_from_uid.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 utimes.c 2011-05-25 Markus Duft Markus Duft [05e7db] new auto-detection of target interix.
 wcs_chown.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 wcs_lchown.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 wcs_lstat.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 wcs_open.c 2011-05-13 Markus Duft Markus Duft [d4a4df] added sync() and futimes() call
 wcs_stat.c 2010-11-02 Markus Duft Markus Duft [f17092] better tracing.
 write.c 2011-05-13 Markus Duft Markus Duft [cfe472] reset timestamp on dirtyness
 writev.c 2011-05-13 Markus Duft Markus Duft [cfe472] reset timestamp on dirtyness

Read Me

SUACOMP - A Library complementing the SUA libc.
-----------------------------------------------

this library is licensed under the BEER-WARE LICENSE, which reads like this:

 /* ----------------------------------------------------------------------------
  *  "THE BEER-WARE LICENSE" (Revision 42):
  *  <mduft@gentoo.org> wrote this file.  As long as you retain this notice you
  *  can do whatever you want with this stuff. If we meet some day, and you think
  *  this stuff is worth it, you can buy me a beer in return.   Markus Duft
  *  ---------------------------------------------------------------------------- */

Also, IMHO, you will probably have to drink some beer before reading the source...

HOW TO BUILD:
-------------

you need to define the SHARED_LIBC and STATIC_LIBC variables on the make command line
to be able to build the libraries. Be sure to specify the lib.so.<version> variant of
the shared libc (with FULL version!). on interix 3.5 this is '3.5' on all newer ones
it is '5.2' ('3.5' exists there, but DON'T use it!).

 $ make SHARED_LIBC=/usr/lib/libc.so.5.2 STATIC_LIBC=/usr/lib/libc.a

Additionally to the LIBC flags, you can add -DITX_PRELOADABLE to the CFLAGS, to build
the library so that it can be used with LD_PRELOAD (which requires an extra hack)...

HOW TO CHECK:
-------------

currently the test suite is not too big, but tests a whole lot of the basic functionality,
like uid/gid/username/groupname mapping from and to interix, etc. You too need to specify
(at least) SHARED_LIBC. The same rules apply as for building.
Additionally TEST_VERBOSE=1 can be passed to make to increase to verbosity of the test
suite.

$ make SHARED_LIBC=/usr/lib/libc.so.5.2 check

example to get very verbose output:

$ SUACOMP_DEBUG_OUT=stderr make SHARED_LIBC=/usr/lib/libc.so.5.2 \
    STATIC_LIBC=/usr/lib/libc.a CFLAGS="-D_DEBUG -D_DEBUG_TRACE" check TEST_VERBOSE=1

HOW TO INSTALL:
---------------

again, SHARED_LIBC and STATIC_LIBC need to be specified, like when building. Additionally,
PREFIX needs to be specified. Optionally DESTDIR can be specified too.

 $ make SHARED_LIBC=/usr/lib/libc.so.5.2 STATIC_LIBC=/usr/lib/libc.a PREFIX=/some/prefix

or

 $ make SHARED_LIBC=/usr/lib/libc.so.5.2 STATIC_LIBC=/usr/lib/libc.a PREFIX=/some/prefix \
	DESTDIR=/where/to/copy/instead/of/prefix

Attention: as suacomp brings a long a few libraries and headers that overrule system libs
and headers, it is not possible to install the package with PREFIX beeing any of "/", "/usr"
or "/usr/" to prevent system files from beeing overwritten. suacomp is meant to be installed
into some arbitrary location. this location needs to be added to all compilations, so that
suacomp is found before (!) /usr/lib/libc.* when searching for libc. this probably means
wrapping/patching the compiler and linker with scripts or other means. this is exactly how
the gentoo prefix for interix toolchain works.

TROUBLESHOOTING:
----------------

the libraries can be built with various debug informations. to enable them, put the
according flag(s) in the CFLAGS variable for make like this:

 $ make CFLAGS="-Wall -g -D_DEBUG -D_DEBUG_PASSWD" SHARED_LIBC=... STATIC_LIBC=...

availbale flags ATM are:

	_DEBUG				enable general debug output
	_DEBUG_ACTCACHE		enable output regarding file descriptor activity caching.
	_DEBUG_MAPPING		enable output regarding uid/gid/name mapping.
	_DEBUG_DYNLOAD		enable output regarding dynamic loading, function lookup, etc.

at runtime, you can influence the debug output behaviour with a view environment
variables. those are:

    SUACOMP_DEBUG_OUT        location where to put output. either a filename, or one of
                             the special locations "null", "stdout", "stderr".
    SUACOMP_DEBUG_OUT_MODE   the mode with which the file is opened. this is a string
                             as accepted by fopen(3) as "mode" parameter, default is "w"
    SUACOMP_DEBUG_OUT_SUFFIX if set, s suffix is appended to the output filename of each
                             started process. this can be any combination of:
                                pid     the process' id
                                name    the process basename (taken from argv[0])
                             those can be seperated by any of ' ' (blank), '\t' (tab), 
                             ',' (comma) or '|' (pipe/or).
    SUACOMP_DEBUG_FILTER     filter processes emmittgin debug output based on argv[0]
                             of each process. multiple filters seperated by ' ', '\t',
                             ',' or '|' are allowd. the process' argv[0] is checked
                             whether it contains (strstr()) any of the filters, and
                             debug output is only enabled if one of them matches.
                             for example setting to 'a.out' will allow debug output
                             for all processes containing a.out in argv[0]. thus
                             './a.out', '/path/to/a.out' and 'a.out' are all valid.


IMPLEMENTATION RELATED NOTES:
-----------------------------

 * poll()

   The current implementation has one small caveat: It does not detect a romte end
   pipe beeing closed. Normally, poll() should return POLLHUP if the remote end of
   a pipe closed, but this implementation returns POLLOUT | POLLWRNORM instead.
   This is, because the Interix libc provides no means of detecting this situation
   using select() or any other provided API.
   Otherwise, the poll implementation is tested with the test case also found in
   gnulib, which should test more or less all possible use cases for poll().
 
 * strotoll(), strtoull()

   Those functions do nothing except wrap around strtoq and strtouq, which are
   well available on interix. this is just for compatibility with more or less
   broken packages, not doing any checks.
   Be aware that no header file containing the signature is given, as this is
   there only to satisfy packages assuming it is there.
 
 * authenticateuser(), exec*_asuser()

   The authenticateuser() function is deprecated and as such not supported by suacomp.
   Use the setuser() function with the SU_CHECK flag instead. The exec*_asuser()
   functions are not (yet) wrapped by suacomp. It should work equally well to do a
   setuser() with SU_COMPLETE and a normal exec*() after that.

 * sysconf()

   Some of the values returned by sysconf() (the _SC_ARG_MAX value in particular)
   are plain wrong, as they won't work out when used. The suacomp sysconf() mangles
   the original values to known good values for all current interix versions.

   (for example _SC_ARG_MAX is changed from 1MB to near 56K, which is the highest
   working value at the moment)

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks