pam_umask.8.xml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <?xml version="1.0" encoding='UTF-8'?>
  2. <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
  4. <refentry id="pam_umask">
  5. <refmeta>
  6. <refentrytitle>pam_umask</refentrytitle>
  7. <manvolnum>8</manvolnum>
  8. <refmiscinfo class="sectdesc">Linux-PAM Manual</refmiscinfo>
  9. </refmeta>
  10. <refnamediv id="pam_umask-name">
  11. <refname>pam_umask</refname>
  12. <refpurpose>PAM module to set the file mode creation mask</refpurpose>
  13. </refnamediv>
  14. <refsynopsisdiv>
  15. <cmdsynopsis id="pam_umask-cmdsynopsis">
  16. <command>pam_umask.so</command>
  17. <arg choice="opt">
  18. debug
  19. </arg>
  20. <arg choice="opt">
  21. silent
  22. </arg>
  23. <arg choice="opt">
  24. usergroups
  25. </arg>
  26. <arg choice="opt">
  27. nousergroups
  28. </arg>
  29. <arg choice="opt">
  30. umask=<replaceable>mask</replaceable>
  31. </arg>
  32. </cmdsynopsis>
  33. </refsynopsisdiv>
  34. <refsect1 id="pam_umask-description">
  35. <title>DESCRIPTION</title>
  36. <para>
  37. pam_umask is a PAM module to set the file mode creation mask
  38. of the current environment. The umask affects the default
  39. permissions assigned to newly created files.
  40. </para>
  41. <para>
  42. The PAM module tries to get the umask value from the
  43. following places in the following order:
  44. <itemizedlist>
  45. <listitem>
  46. <para>
  47. umask= entry in the user's GECOS field
  48. </para>
  49. </listitem>
  50. <listitem>
  51. <para>
  52. umask= argument
  53. </para>
  54. </listitem>
  55. <listitem>
  56. <para>
  57. UMASK entry from /etc/login.defs
  58. </para>
  59. </listitem>
  60. <listitem>
  61. <para>
  62. UMASK= entry from /etc/default/login
  63. </para>
  64. </listitem>
  65. </itemizedlist>
  66. </para>
  67. <para>
  68. The GECOS field is split on comma ',' characters. The module
  69. also in addition to the umask= entry recognizes pri= entry,
  70. which sets the nice priority value for the session, and
  71. ulimit= entry, which sets the maximum size of files the processes
  72. in the session can create.
  73. </para>
  74. </refsect1>
  75. <refsect1 id="pam_umask-options">
  76. <title>OPTIONS</title>
  77. <para>
  78. <variablelist>
  79. <varlistentry>
  80. <term>
  81. <option>debug</option>
  82. </term>
  83. <listitem>
  84. <para>
  85. Print debug information.
  86. </para>
  87. </listitem>
  88. </varlistentry>
  89. <varlistentry>
  90. <term>
  91. <option>silent</option>
  92. </term>
  93. <listitem>
  94. <para>
  95. Don't print informative messages.
  96. </para>
  97. </listitem>
  98. </varlistentry>
  99. <varlistentry>
  100. <term>
  101. <option>usergroups</option>
  102. </term>
  103. <listitem>
  104. <para>
  105. If the user is not root and the username is the same as
  106. primary group name, the umask group bits are set to be the
  107. same as owner bits (examples: 022 -> 002, 077 -> 007).
  108. </para>
  109. </listitem>
  110. </varlistentry>
  111. <varlistentry>
  112. <term>
  113. <option>nousergroups</option>
  114. </term>
  115. <listitem>
  116. <para>
  117. This is the direct opposite of the usergroups option described above,
  118. which can be useful in case pam_umask has been compiled with
  119. usergroups enabled by default and you want to disable it at runtime.
  120. </para>
  121. </listitem>
  122. </varlistentry>
  123. <varlistentry>
  124. <term>
  125. <option>umask=<replaceable>mask</replaceable></option>
  126. </term>
  127. <listitem>
  128. <para>
  129. Sets the calling process's file mode creation mask (umask)
  130. to <option>mask</option> &amp; 0777. The value is interpreted
  131. as Octal.
  132. </para>
  133. </listitem>
  134. </varlistentry>
  135. </variablelist>
  136. </para>
  137. </refsect1>
  138. <refsect1 id="pam_umask-types">
  139. <title>MODULE TYPES PROVIDED</title>
  140. <para>
  141. Only the <option>session</option> type is provided.
  142. </para>
  143. </refsect1>
  144. <refsect1 id='pam_umask-return_values'>
  145. <title>RETURN VALUES</title>
  146. <para>
  147. <variablelist>
  148. <varlistentry>
  149. <term>PAM_SUCCESS</term>
  150. <listitem>
  151. <para>
  152. The new umask was set successfully.
  153. </para>
  154. </listitem>
  155. </varlistentry>
  156. <varlistentry>
  157. <term>PAM_BUF_ERR</term>
  158. <listitem>
  159. <para>
  160. Memory buffer error.
  161. </para>
  162. </listitem>
  163. </varlistentry>
  164. <varlistentry>
  165. <term>PAM_CONV_ERR</term>
  166. <listitem>
  167. <para>
  168. The conversation method supplied by the application
  169. failed to obtain the username.
  170. </para>
  171. </listitem>
  172. </varlistentry>
  173. <varlistentry>
  174. <term>PAM_INCOMPLETE</term>
  175. <listitem>
  176. <para>
  177. The conversation method supplied by the application
  178. returned PAM_CONV_AGAIN.
  179. </para>
  180. </listitem>
  181. </varlistentry>
  182. <varlistentry>
  183. <term>PAM_SERVICE_ERR</term>
  184. <listitem>
  185. <para>
  186. No username was given.
  187. </para>
  188. </listitem>
  189. </varlistentry>
  190. <varlistentry>
  191. <term>PAM_USER_UNKNOWN</term>
  192. <listitem>
  193. <para>
  194. User not known.
  195. </para>
  196. </listitem>
  197. </varlistentry>
  198. </variablelist>
  199. </para>
  200. </refsect1>
  201. <refsect1 id='pam_umask-examples'>
  202. <title>EXAMPLES</title>
  203. <para>
  204. Add the following line to <filename>/etc/pam.d/login</filename> to
  205. set the user specific umask at login:
  206. <programlisting>
  207. session optional pam_umask.so umask=0022
  208. </programlisting>
  209. </para>
  210. </refsect1>
  211. <refsect1 id='pam_umask-see_also'>
  212. <title>SEE ALSO</title>
  213. <para>
  214. <citerefentry>
  215. <refentrytitle>pam.conf</refentrytitle><manvolnum>5</manvolnum>
  216. </citerefentry>,
  217. <citerefentry>
  218. <refentrytitle>pam.d</refentrytitle><manvolnum>5</manvolnum>
  219. </citerefentry>,
  220. <citerefentry>
  221. <refentrytitle>pam</refentrytitle><manvolnum>8</manvolnum>
  222. </citerefentry>
  223. </para>
  224. </refsect1>
  225. <refsect1 id='pam_umask-author'>
  226. <title>AUTHOR</title>
  227. <para>
  228. pam_umask was written by Thorsten Kukuk &lt;kukuk@thkukuk.de&gt;.
  229. </para>
  230. </refsect1>
  231. </refentry>