191 lines
5.3 KiB
HTML
191 lines
5.3 KiB
HTML
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||
|
<html>
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||
|
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
|
||
|
<title>qsysetuid()--Set User ID</title>
|
||
|
<!-- Begin Header Records ========================================== -->
|
||
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
||
|
<!-- US Government Users Restricted Rights -->
|
||
|
<!-- Use, duplication or disclosure restricted by -->
|
||
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
||
|
<!-- Change History: -->
|
||
|
<!-- YYMMDD USERID Change description -->
|
||
|
<!-- file cleaned -->
|
||
|
<!-- QSYSETUI SCR450 A converted by B2H R4.1 (346) (CMS) by V2DCIJB -->
|
||
|
<!-- at RCHVMW2 on 5 Oct 1999 at 15:27:14 -->
|
||
|
<!-- This file has undergone html cleanup June 2002 by JET -->
|
||
|
<!--End Header Records -->
|
||
|
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
|
||
|
</head>
|
||
|
<body>
|
||
|
<a name="Top_Of_Page"></a>
|
||
|
<!-- Java sync-link -->
|
||
|
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript">
|
||
|
</script>
|
||
|
|
||
|
<h2>qsysetuid()--Set User ID</h2>
|
||
|
|
||
|
<div class="box" style="width: 60%;">
|
||
|
<br>
|
||
|
Syntax<br>
|
||
|
|
||
|
|
||
|
<pre>
|
||
|
#include <qsysetid.h>
|
||
|
|
||
|
int qsysetuid(uid_t uid);
|
||
|
</pre>
|
||
|
|
||
|
Service Program Name: QSYSETIDS<br>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
Default Public Authority: *USE<br>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
Threadsafe: Yes<br>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
</div>
|
||
|
|
||
|
<p>If the thread has *ALLOBJ special authority, <strong>qsysetuid()</strong>
|
||
|
sets the real, effective, and saved user ID to <em>uid</em>.</p>
|
||
|
|
||
|
<p>If the thread does not have *ALLOBJ special authority, but <em>uid</em> is
|
||
|
equal to the real, effective or saved user ID, <strong>qsysetuid()</strong>
|
||
|
sets the effective user ID to <em>uid</em>. The real and saved user IDs remain
|
||
|
unchanged.</p>
|
||
|
|
||
|
<p>Job scoped locks with a lock state of *SHRRD are held on the user profiles
|
||
|
associated with the real user ID, effective user ID, saved user ID, real group
|
||
|
ID, effective group ID, saved group ID, and all of the supplemental groups.</p>
|
||
|
|
||
|
<br>
|
||
|
<h3>Parameters</h3>
|
||
|
|
||
|
<dl>
|
||
|
<dt><strong><em>uid</em></strong></dt>
|
||
|
|
||
|
<dd>(Input) User ID.
|
||
|
|
||
|
<p>This field must contain one of the following values:</p>
|
||
|
|
||
|
<dl>
|
||
|
<dt><strong>0 to 4294967294</strong></dt>
|
||
|
|
||
|
<dd>The user ID value for the set operation.</dd>
|
||
|
</dl>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
<br>
|
||
|
<h3>Authorities and Locks</h3>
|
||
|
|
||
|
<dl>
|
||
|
<dt><strong>*ALLOBJ special authority</strong></dt>
|
||
|
|
||
|
<dd>*ALLOBJ special authority is required if <em>uid</em> is not equal to the
|
||
|
real, effective, or saved user ID.<br>
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong>User profile associated with <em>uid</em> lock</strong></dt>
|
||
|
|
||
|
<dd>*SHRRD</dd>
|
||
|
</dl>
|
||
|
|
||
|
<br>
|
||
|
<h3>Return Value</h3>
|
||
|
|
||
|
<dl>
|
||
|
<dt><strong>0</strong></dt>
|
||
|
|
||
|
<dd><strong>qsysetuid()</strong> was successful.<br>
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong>-1</strong></dt>
|
||
|
|
||
|
<dd><strong>qsysetuid()</strong> was not successful. <em>errno</em> is set to
|
||
|
indicate the error.</dd>
|
||
|
</dl>
|
||
|
|
||
|
<br>
|
||
|
<h3>Error Conditions</h3>
|
||
|
|
||
|
<p>If <strong>qsysetuid()</strong> is not successful, <em>errno</em> indicates
|
||
|
one of the following errors.</p>
|
||
|
|
||
|
<table cellpadding="5">
|
||
|
<!-- cols="25 75" -->
|
||
|
|
||
|
<tr>
|
||
|
<th align="left" valign="bottom">Error condition</th>
|
||
|
<th align="left" valign="bottom">Additional information</th>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td align="left" valign="top">
|
||
|
<em>[<a href="unix14.htm#EAGAIN">EAGAIN</a>]</em></td>
|
||
|
|
||
|
<td align="left" valign="top">
|
||
|
<p>User profile associated with the <em>uid</em> is locked. Try again.</p>
|
||
|
</td></tr>
|
||
|
|
||
|
<tr><td align="left" valign="top"><em>[<a href="unix14.htm#EDAMAGE">EDAMAGE</a>]</em></td>
|
||
|
|
||
|
<td align="left" valign="top">
|
||
|
<p>The user profile associated with the <em>uid</em> or an internal system
|
||
|
object is damaged.</p>
|
||
|
</td></tr>
|
||
|
|
||
|
<tr>
|
||
|
<td align="left" valign="top">
|
||
|
<em>[<a href="unix14.htm#EINVAL">EINVAL</a>]</em></td>
|
||
|
|
||
|
<td align="left" valign="top">
|
||
|
<p>The value of the <em>gid</em> argument is not valid. Following are possible
|
||
|
reasons:</p>
|
||
|
<ul compact>
|
||
|
<li>Out of range.</li>
|
||
|
<li>Not associated with a user profile.</li>
|
||
|
</ul>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr><td align="left" valign="top"><em>[<a href="unix14.htm#ENOTSUP">ENOTSUP</a>]</em></td>
|
||
|
|
||
|
<td align="left" valign="top">
|
||
|
<p>Operation not supported. The user profile associated with this <em>uid</em>
|
||
|
specifies OWNER(*GRPPRF), but the user profile's first group is not the current
|
||
|
effective group, nor is it in the list of supplemental groups.</p>
|
||
|
</td></tr>
|
||
|
|
||
|
<tr><td align="left" valign="top"><em>[<a href="unix14.htm#EPERM">EPERM</a>]</em></td>
|
||
|
|
||
|
<td align="left" valign="top">
|
||
|
<p>Operation not permitted. The thread does not have *ALLOBJ special authority
|
||
|
and <em>uid</em> is not the same as the real, effective or saved user ID.</p>
|
||
|
</td></tr>
|
||
|
|
||
|
<tr><td align="left" valign="top"><em>[<a href="unix14.htm#EUNKNOWN">EUNKNOWN</a>]</em></td>
|
||
|
|
||
|
<td align="left" valign="top">
|
||
|
<p>An unknown error has occurred. Check the joblog for error messages.</p>
|
||
|
</td></tr>
|
||
|
</table>
|
||
|
<br>
|
||
|
<hr>
|
||
|
API introduced: V4R5
|
||
|
|
||
|
<hr>
|
||
|
<center>
|
||
|
<table cellpadding="2" cellspacing="2">
|
||
|
<tr align="center">
|
||
|
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a href=
|
||
|
"unix.htm">UNIX-Type APIs</a> | <a href="aplist.htm">APIs by category</a></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</center>
|
||
|
</body>
|
||
|
</html>
|
||
|
|