uid=uid_t
The real user ID of the user invoking s\bsu\bud\bdo\bo.
+ umask=octal
+ The invoking user's file creation mask. Only available
+ starting with API version 1.10.
+
user=string
The name of the user invoking s\bsu\bud\bdo\bo.
The _\be_\bx_\be_\bc_\bf_\bd entry was added to the command_info list.
Version 1.10 (sudo 1.8.19)
- The _\bi_\bo_\bl_\bo_\bg_\b__\bg_\br_\bo_\bu_\bp, _\bi_\bo_\bl_\bo_\bg_\b__\bm_\bo_\bd_\be, and _\bi_\bo_\bl_\bo_\bg_\b__\bu_\bs_\be_\br entries were added to
- the command_info list.
+ The _\bu_\bm_\ba_\bs_\bk entry was added to the user_info list. The _\bi_\bo_\bl_\bo_\bg_\b__\bg_\br_\bo_\bu_\bp,
+ _\bi_\bo_\bl_\bo_\bg_\b__\bm_\bo_\bd_\be, and _\bi_\bo_\bl_\bo_\bg_\b__\bu_\bs_\be_\br entries were added to the command_info
+ list.
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
sudo.conf(4), sudoers(4), sudo(1m)
file distributed with s\bsu\bud\bdo\bo or https://www.sudo.ws/license.html for
complete details.
-Sudo 1.8.19 November 8, 2016 Sudo 1.8.19
+Sudo 1.8.19 November 17, 2016 Sudo 1.8.19
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.TH "SUDO_PLUGIN" "5" "November 8, 2016" "Sudo @PACKAGE_VERSION@" "File Formats Manual"
+.TH "SUDO_PLUGIN" "5" "November 17, 2016" "Sudo @PACKAGE_VERSION@" "File Formats Manual"
.nh
.if n .ad l
.SH "NAME"
The real user ID of the user invoking
\fBsudo\fR.
.TP 6n
+umask=octal
+The invoking user's file creation mask.
+Only available starting with API version 1.10.
+.TP 6n
user=string
The name of the user invoking
\fBsudo\fR.
.TP 6n
Version 1.10 (sudo 1.8.19)
The
+\fIumask\fR
+entry was added to the
+\fRuser_info\fR
+list.
+The
\fIiolog_group\fR,
\fIiolog_mode\fR,
and
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd November 8, 2016
+.Dd November 17, 2016
.Dt SUDO_PLUGIN @mansectform@
.Os Sudo @PACKAGE_VERSION@
.Sh NAME
.It uid=uid_t
The real user ID of the user invoking
.Nm sudo .
+.It umask=octal
+The invoking user's file creation mask.
+Only available starting with API version 1.10.
.It user=string
The name of the user invoking
.Nm sudo .
list.
.It Version 1.10 (sudo 1.8.19)
The
+.Em umask
+entry was added to the
+.Li user_info
+list.
+The
.Em iolog_group ,
.Em iolog_mode ,
and
#endif
}
+ user_umask = (mode_t)-1;
for (cur = info->user_info; *cur != NULL; cur++) {
if (MATCHES(*cur, "user=")) {
if ((user_name = strdup(*cur + sizeof("user=") - 1)) == NULL)
}
continue;
}
+ if (MATCHES(*cur, "umask=")) {
+ p = *cur + sizeof("umask=") - 1;
+ sudo_user.umask = sudo_strtomode(p, &errstr);
+ if (errstr != NULL) {
+ sudo_warnx(U_("%s: %s"), *cur, U_(errstr));
+ goto bad;
+ }
+ continue;
+ }
}
if ((user_runhost = strdup(remhost ? remhost : user_host)) == NULL)
goto oom;
goto bad;
}
- /* Stash initial umask for later use. */
- user_umask = umask(SUDO_UMASK);
- umask(user_umask);
+ /* umask is only set in user_info[] for API 1.10 and above. */
+ if (user_umask == (mode_t)-1) {
+ user_umask = umask(0);
+ umask(user_umask);
+ }
/* Some systems support fexecve() which we use for digest matches. */
cmnd_fd = -1;
{
char *cp, **user_info, path[PATH_MAX];
unsigned int i = 0;
+ mode_t mask;
struct passwd *pw;
int fd;
debug_decl(get_user_info, SUDO_DEBUG_UTIL)
if ((cp = get_user_groups(ud)) != NULL)
user_info[++i] = cp;
+ mask = umask(0);
+ umask(mask);
+ if (asprintf(&user_info[++i], "umask=0%o", (unsigned int)mask) == -1)
+ goto oom;
+
if (getcwd(path, sizeof(path)) != NULL) {
user_info[++i] = sudo_new_key_val("cwd", path);
if (user_info[i] == NULL)