home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat2 / standard / setuid.z / setuid
Encoding:
Text File  |  2002-10-03  |  6.2 KB  |  133 lines

  1.  
  2.  
  3.  
  4. sssseeeettttuuuuiiiidddd((((2222))))                                                            sssseeeettttuuuuiiiidddd((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _ssss_eeee_tttt_uuuu_iiii_dddd, _ssss_eeee_tttt_gggg_iiii_dddd - set user and group IDs
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>>
  13.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_uuuu_nnnn_iiii_ssss_tttt_dddd_...._hhhh_>>>>
  14.  
  15.      _iiii_nnnn_tttt _ssss_eeee_tttt_uuuu_iiii_dddd_((((_uuuu_iiii_dddd______tttt _uuuu_iiii_dddd_))))_;;;;
  16.  
  17.      _iiii_nnnn_tttt _ssss_eeee_tttt_gggg_iiii_dddd_((((_gggg_iiii_dddd______tttt _gggg_iiii_dddd_))))_;;;;
  18.  
  19. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  20.      The _ssss_eeee_tttt_uuuu_iiii_dddd system call sets the real user ID, effective user ID, and
  21.      saved user ID of the calling process.  The _ssss_eeee_tttt_gggg_iiii_dddd system call sets the
  22.      real group ID, effective group ID, and saved group ID of the calling
  23.      process.
  24.  
  25.      At login time, the real user ID, effective user ID, and saved user ID of
  26.      the login process are set to the login ID of the user responsible for the
  27.      creation of the process.  The same is true for the real, effective, and
  28.      saved group IDs; they are set to the group ID of the user responsible for
  29.      the creation of the process.
  30.  
  31.      When a process calls _eeee_xxxx_eeee_cccc(2) to execute a file (program), the user and/or
  32.      group identifiers associated with the process can change:
  33.  
  34.           The real user and group IDs are always set to the real user and
  35.           group IDs of the process calling _eeee_xxxx_eeee_cccc.
  36.  
  37.           The saved user and group IDs of the new process are always set to
  38.           the effective user and group IDs of the process calling _eeee_xxxx_eeee_cccc.
  39.  
  40.           If the file executed is not a set-user-ID or set-group-ID file, the
  41.           effective user and group IDs of the new process are set to the
  42.           effective user and group IDs of the process calling _eeee_xxxx_eeee_cccc.
  43.  
  44.           If the file executed is a set-user-ID file, the effective user ID of
  45.           the new process is set to the owner ID of the executed file.
  46.  
  47.           If the file executed is a set-group-ID file, the effective group ID
  48.           of the new process is set to the group ID of the executed file.
  49.  
  50.      The following subsections describe the behavior of _ssss_eeee_tttt_uuuu_iiii_dddd and _ssss_eeee_tttt_gggg_iiii_dddd with
  51.      respect to the three types of user and group IDs.
  52.  
  53.    _ssss_eeee_tttt_uuuu_iiii_dddd
  54.      If the calling process has the _ssss_uuuu_pppp_eeee_rrrr_----_uuuu_ssss_eeee_rrrr privilege, the real, effective,
  55.      and saved user IDs are set to the _u_i_d parameter.
  56.  
  57.      If the calling process does not have the _ssss_uuuu_pppp_eeee_rrrr_----_uuuu_ssss_eeee_rrrr privilege, but _u_i_d is
  58.      either the real user ID or the saved user ID of the calling process, the
  59.      effective user ID is set to _u_i_d.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. sssseeeettttuuuuiiiidddd((((2222))))                                                            sssseeeettttuuuuiiiidddd((((2222))))
  71.  
  72.  
  73.  
  74.    _ssss_eeee_tttt_gggg_iiii_dddd
  75.      If the calling process has the _ssss_uuuu_pppp_eeee_rrrr_----_uuuu_ssss_eeee_rrrr privilege, the real, effective,
  76.      and saved group IDs are set to the _g_i_d parameter.
  77.  
  78.      If the calling process does not have the _ssss_uuuu_pppp_eeee_rrrr_----_uuuu_ssss_eeee_rrrr privilege, but _g_i_d is
  79.      either the real group ID or the saved group ID of the calling process,
  80.      the effective group ID is set to _g_i_d.
  81.  
  82.      _ssss_eeee_tttt_uuuu_iiii_dddd and _ssss_eeee_tttt_gggg_iiii_dddd fail if one or more of the following is true:
  83.  
  84.      _EEEE_PPPP_EEEE_RRRR_MMMM     For _ssss_eeee_tttt_uuuu_iiii_dddd, the calling process does not have the _ssss_uuuu_pppp_eeee_rrrr_----_uuuu_ssss_eeee_rrrr
  85.                privilege and the _u_i_d parameter does not match either the real
  86.                or saved user IDs.  For _ssss_eeee_tttt_gggg_iiii_dddd, the calling process does not
  87.                have the _ssss_uuuu_pppp_eeee_rrrr_----_uuuu_ssss_eeee_rrrr privilege and the _g_i_d parameter does not
  88.                match either the real or saved group IDs.
  89.  
  90.      _EEEE_IIII_NNNN_VVVV_AAAA_LLLL    The _u_i_d or _g_i_d is out of range.
  91.  
  92. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  93.      Upon successful completion, a value of 0 is returned.  Otherwise, a value
  94.      of -1 is returned and _eeee_rrrr_rrrr_nnnn_oooo is set to indicate the error.
  95.  
  96. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  97.      _iiii_nnnn_tttt_rrrr_oooo(2), _eeee_xxxx_eeee_cccc(2), _gggg_eeee_tttt_gggg_rrrr_oooo_uuuu_pppp_ssss(2), _gggg_eeee_tttt_uuuu_iiii_dddd(2), _ssss_tttt_aaaa_tttt(5).
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.