aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2015-11-03 10:54:07 +0100
committerAndreas Schneider <asn@samba.org>2015-11-03 12:17:29 +0100
commit18a60576e396c3944b72a5e631957393a5db05b1 (patch)
tree7d9a58a7a633cdb5a94cbcaf4e68ecdd5c091b59
parent4ae50736aab63bbcb6ddce6b84aa9e7228a0d531 (diff)
downloaduid_wrapper-18a60576e396c3944b72a5e631957393a5db05b1.tar.gz
uid_wrapper-18a60576e396c3944b72a5e631957393a5db05b1.tar.xz
uid_wrapper-18a60576e396c3944b72a5e631957393a5db05b1.zip
doc: Document missing options
Signed-off-by: Andreas Schneider <asn@samba.org>
-rw-r--r--doc/uid_wrapper.143
-rw-r--r--doc/uid_wrapper.1.txt36
2 files changed, 74 insertions, 5 deletions
diff --git a/doc/uid_wrapper.1 b/doc/uid_wrapper.1
index 0faff95..c66d143 100644
--- a/doc/uid_wrapper.1
+++ b/doc/uid_wrapper.1
@@ -2,12 +2,12 @@
.\" Title: uid_wrapper
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 2014-07-11
+.\" Date: 2015-11-03
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "UID_WRAPPER" "1" "2014\-07\-11" "\ \&" "\ \&"
+.TH "UID_WRAPPER" "1" "2015\-11\-03" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -139,6 +139,25 @@ If you need to see what is going on in uid_wrapper itself or try to find a bug,
3 = TRACE
.RE
.RE
+.PP
+\fBUID_WRAPPER_MYUID\fR
+.RS 4
+This environment variable can be used to tell uid_wrapper to let geteuid() return the real (instead of the faked) UID of the user who started the process with uid_wrapper\&.
+.RE
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+uid_t uid;
+
+setenv("UID_WRAPPER_MYUID", "1", 1);
+uid = geteuid();
+unsetenv("UID_WRAPPER_MYUID");
+.fi
+.if n \{\
+.RE
+.\}
.SH "EXAMPLE"
.sp
.if n \{\
@@ -146,8 +165,26 @@ If you need to see what is going on in uid_wrapper itself or try to find a bug,
.\}
.nf
$ LD_PRELOAD=libuid_wrapper\&.so UID_WRAPPER=1 UID_WRAPPER_ROOT=1 id
-uid=0(root) gid=0(root) groups=100(users),0(root)
+uid=0(root) gid=0(root) 0(root)
.fi
.if n \{\
.RE
.\}
+.SH "WORKAROUNDS"
+.sp
+If you need to write code that behaves differently depending on whether uid_wrapper is enabled or not, for example in cases where you have to file permissions, you can predefine the uid_wrapper_enabled() function in your project as follows:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+bool uid_wrapper_enabled(void)
+{
+ return false;
+}
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+Since uid_wrapper overloads this function if enabled, you can use it in your code to detect uid_wrapper\&.
diff --git a/doc/uid_wrapper.1.txt b/doc/uid_wrapper.1.txt
index dec69e6..699d2c1 100644
--- a/doc/uid_wrapper.1.txt
+++ b/doc/uid_wrapper.1.txt
@@ -1,6 +1,6 @@
uid_wrapper(1)
==============
-:revdate: 2014-07-11
+:revdate: 2015-11-03
NAME
----
@@ -50,8 +50,40 @@ debug symbols.
- 2 = DEBUG
- 3 = TRACE
+*UID_WRAPPER_MYUID*::
+
+This environment variable can be used to tell uid_wrapper to let geteuid()
+return the real (instead of the faked) UID of the user who started the process
+with uid_wrapper.
+
+--------------------------------------
+uid_t uid;
+
+setenv("UID_WRAPPER_MYUID", "1", 1);
+uid = geteuid();
+unsetenv("UID_WRAPPER_MYUID");
+--------------------------------------
+
EXAMPLE
-------
$ LD_PRELOAD=libuid_wrapper.so UID_WRAPPER=1 UID_WRAPPER_ROOT=1 id
- uid=0(root) gid=0(root) groups=100(users),0(root)
+ uid=0(root) gid=0(root) 0(root)
+
+WORKAROUNDS
+-----------
+
+If you need to write code that behaves differently depending on whether
+uid_wrapper is enabled or not, for example in cases where you have to file
+permissions, you can predefine the uid_wrapper_enabled() function in your
+project as follows:
+
+--------------------------------------
+bool uid_wrapper_enabled(void)
+{
+ return false;
+}
+--------------------------------------
+
+Since uid_wrapper overloads this function if enabled, you can use it in your
+code to detect uid_wrapper.