Compare commits
5 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
91d35b9d66 | ||
|
|
8d10c81285 | ||
|
|
b73c7f35fb | ||
|
|
046c713cdf | ||
|
|
4f7002163e |
26 changed files with 1889 additions and 1591 deletions
|
|
@ -1 +0,0 @@
|
|||
1
|
||||
54
.gitignore
vendored
54
.gitignore
vendored
|
|
@ -1,56 +1,2 @@
|
|||
shadow-4.1.4.2.tar.bz2
|
||||
/shadow-4.1.4.3.tar.bz2
|
||||
/shadow-4.1.5.tar.bz2
|
||||
/shadow-4.1.5.1.tar.bz2
|
||||
/shadow-4.1.5.1.tar.bz2.sig
|
||||
/shadow-4.2.1.tar.xz
|
||||
/shadow-4.2.1.tar.xz.sig
|
||||
/shadow-4.3.1.tar.gz
|
||||
/shadow-4.5.tar.xz
|
||||
/shadow-4.5.tar.xz.asc
|
||||
/shadow-4.6.tar.xz
|
||||
/shadow-4.6.tar.xz.asc
|
||||
/shadow-4.8.tar.xz
|
||||
/shadow-4.8.tar.xz.asc
|
||||
/shadow-4.8.1.tar.xz
|
||||
/shadow-4.8.1.tar.xz.asc
|
||||
/shadow-4.9.tar.xz
|
||||
/shadow-4.9.tar.xz.asc
|
||||
/shadow-4.11.1.tar.xz
|
||||
/shadow-4.11.1.tar.xz.asc
|
||||
/shadow-4.12.3.tar.xz
|
||||
/shadow-4.12.3.tar.xz.asc
|
||||
/shadow-4.13.tar.xz
|
||||
/shadow-4.13.tar.xz.asc
|
||||
/shadow-4.14.0.tar.xz
|
||||
/shadow-4.14.0.tar.xz.asc
|
||||
/shadow-4.15.0rc2.tar.xz
|
||||
/shadow-4.15.0rc2.tar.xz.asc
|
||||
/shadow-4.15.0rc3.tar.xz
|
||||
/shadow-4.15.0rc3.tar.xz.asc
|
||||
/shadow-4.15.0.tar.xz
|
||||
/shadow-4.15.0.tar.xz.asc
|
||||
/shadow-4.15.1.tar.xz
|
||||
/shadow-4.15.1.tar.xz.asc
|
||||
/shadow-4.16.0.tar.xz
|
||||
/shadow-4.16.0.tar.xz.asc
|
||||
/shadow-4.17.0-rc1.tar.xz
|
||||
/shadow-4.17.0-rc1.tar.xz.asc
|
||||
/shadow-4.17.0.tar.xz
|
||||
/shadow-4.17.0.tar.xz.asc
|
||||
/shadow-4.17.4.tar.xz
|
||||
/shadow-4.17.4.tar.xz.asc
|
||||
/shadow-4.18.0.tar.xz
|
||||
/shadow-4.18.0.tar.xz.asc
|
||||
/shadow-4.19.0.tar.xz
|
||||
/shadow-4.19.0.tar.xz.asc
|
||||
/shadow-4.19.2.tar.xz
|
||||
/shadow-4.19.2.tar.xz.asc
|
||||
/shadow-4.19.3.tar.xz
|
||||
/shadow-4.19.3.tar.xz.asc
|
||||
/shadow-4.20.0-rc2.tar.xz
|
||||
/shadow-4.20.0-rc2.tar.xz.asc
|
||||
/shadow-4.20.0-rc3.tar.xz
|
||||
/shadow-4.20.0-rc3.tar.xz.asc
|
||||
/shadow-4.20.0.tar.xz
|
||||
/shadow-4.20.0.tar.xz.asc
|
||||
|
|
|
|||
339
gpl-2.0.txt
339
gpl-2.0.txt
|
|
@ -1,339 +0,0 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
#%PAM-1.0
|
||||
# This tool only uses the password stack.
|
||||
password substack system-auth
|
||||
-password optional pam_gnome_keyring.so use_authtok
|
||||
password substack postlogin
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
summary: Tier 0 functional tests for shadow-utils
|
||||
description: |
|
||||
Run comprehensive system tests for shadow-utils. These tests validate user and group
|
||||
account management functionality by testing actual system operations including user
|
||||
creation, password management, group operations, and verification of system files
|
||||
(i.e. /etc/passwd, /etc/shadow).
|
||||
|
||||
provision:
|
||||
how: virtual
|
||||
image: fedora
|
||||
|
||||
prepare:
|
||||
- name: Install general dependencies
|
||||
how: install
|
||||
package:
|
||||
- expect
|
||||
- gcc
|
||||
- git
|
||||
- libssh-devel
|
||||
- python3-devel
|
||||
- python3-pip
|
||||
|
||||
- name: Setup SSH keys for localhost testing
|
||||
how: shell
|
||||
script:
|
||||
- ssh-keygen -t rsa -f /root/.ssh/id_rsa -N "" -q
|
||||
- cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
|
||||
- chmod 600 /root/.ssh/authorized_keys
|
||||
- ssh-keyscan -H localhost >> /root/.ssh/known_hosts
|
||||
|
||||
- name: Clone shadow repository
|
||||
how: shell
|
||||
script:
|
||||
- git clone https://github.com/shadow-maint/shadow.git /tmp/shadow-test
|
||||
|
||||
- name: Copy test topology for Fedora CI
|
||||
how: shell
|
||||
script:
|
||||
- cp tests/mhc-fedora-ci.yaml /tmp/shadow-test/tests/system
|
||||
|
||||
- name: Install test dependencies
|
||||
how: shell
|
||||
script:
|
||||
- pip3 install -r /tmp/shadow-test/tests/system/requirements.txt
|
||||
|
||||
execute:
|
||||
how: tmt
|
||||
duration: 30m
|
||||
script: |
|
||||
cd /tmp/shadow-test/tests/system
|
||||
pytest --mh-config=mhc-fedora-ci.yaml --mh-lazy-ssh -v
|
||||
151
shadow-4.1.4.2-acl.patch
Normal file
151
shadow-4.1.4.2-acl.patch
Normal file
|
|
@ -0,0 +1,151 @@
|
|||
diff -up shadow-4.1.4.2/libmisc/copydir.c.acl shadow-4.1.4.2/libmisc/copydir.c
|
||||
--- shadow-4.1.4.2/libmisc/copydir.c.acl 2011-02-09 17:35:23.455413575 +0100
|
||||
+++ shadow-4.1.4.2/libmisc/copydir.c 2011-02-09 17:49:17.606330202 +0100
|
||||
@@ -45,6 +45,9 @@
|
||||
#ifdef WITH_SELINUX
|
||||
#include <selinux/selinux.h>
|
||||
#endif
|
||||
+#include <attr/error_context.h>
|
||||
+#include <acl/libacl.h>
|
||||
+
|
||||
static /*@null@*/const char *src_orig;
|
||||
static /*@null@*/const char *dst_orig;
|
||||
|
||||
@@ -70,7 +73,7 @@ static int copy_symlink (const char *src
|
||||
#endif
|
||||
static int copy_hardlink (const char *src, const char *dst,
|
||||
struct link_name *lp);
|
||||
-static int copy_special (const char *dst,
|
||||
+static int copy_special (const char *src, const char *dst,
|
||||
const struct stat *statp, const struct timeval mt[],
|
||||
long int uid, long int gid);
|
||||
static int copy_file (const char *src, const char *dst,
|
||||
@@ -78,6 +81,28 @@ static int copy_file (const char *src, c
|
||||
long int uid, long int gid);
|
||||
|
||||
#ifdef WITH_SELINUX
|
||||
+
|
||||
+void error (struct error_context *ctx, const char *fmt, ...)
|
||||
+{
|
||||
+ va_list ap;
|
||||
+
|
||||
+ /* ignore the case when destination does not support ACLs */
|
||||
+ if(errno==EOPNOTSUPP)
|
||||
+ return;
|
||||
+
|
||||
+ va_start (ap, fmt);
|
||||
+ (void) fprintf (stderr, _("%s: "), Prog);
|
||||
+ if (vfprintf (stderr, fmt, ap) != 0) {
|
||||
+ (void) fputs (_(": "), stderr);
|
||||
+ }
|
||||
+ (void) fprintf (stderr, "%s\n", strerror (errno));
|
||||
+ va_end (ap);
|
||||
+}
|
||||
+
|
||||
+struct error_context ctx = {
|
||||
+ error
|
||||
+};
|
||||
+
|
||||
/*
|
||||
* selinux_file_context - Set the security context before any file or
|
||||
* directory creation.
|
||||
@@ -369,7 +394,7 @@ static int copy_entry (const char *src,
|
||||
*/
|
||||
|
||||
else if (!S_ISREG (sb.st_mode)) {
|
||||
- err = copy_special (dst, &sb, mt, uid, gid);
|
||||
+ err = copy_special (src, dst, &sb, mt, uid, gid);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -413,8 +438,20 @@ static int copy_dir (const char *src, co
|
||||
|| (chown (dst,
|
||||
(uid == - 1) ? statp->st_uid : (uid_t) uid,
|
||||
(gid == - 1) ? statp->st_gid : (gid_t) gid) != 0)
|
||||
- || (chmod (dst, statp->st_mode) != 0)
|
||||
- || (copy_tree (src, dst, uid, gid) != 0)
|
||||
+ || (chmod (dst, statp->st_mode) != 0)) {
|
||||
+ err = -1;
|
||||
+ return err;
|
||||
+ }
|
||||
+
|
||||
+ /* ignore the case when destination does not support ACLs */
|
||||
+ if (perm_copy_file (src, dst, &ctx) != 0) {
|
||||
+ if (errno!=EOPNOTSUPP) {
|
||||
+ err = -1;
|
||||
+ return err;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if ((copy_tree (src, dst, uid, gid) != 0)
|
||||
|| (utimes (dst, mt) != 0)) {
|
||||
err = -1;
|
||||
}
|
||||
@@ -514,6 +551,13 @@ static int copy_symlink (const char *src
|
||||
|| (lchown (dst,
|
||||
(uid == -1) ? statp->st_uid : (uid_t) uid,
|
||||
(gid == -1) ? statp->st_gid : (gid_t) gid) != 0)) {
|
||||
+ /* FIXME: there are no modes on symlinks, right?
|
||||
+ * ACL could be copied, but this would be much more
|
||||
+ * complex than calling perm_copy_file.
|
||||
+ * Ditto for Extended Attributes.
|
||||
+ * We currently only document that ACL and Extended
|
||||
+ * Attributes are not copied.
|
||||
+ */
|
||||
free (oldlink);
|
||||
return -1;
|
||||
}
|
||||
@@ -542,7 +586,7 @@ static int copy_symlink (const char *src
|
||||
static int copy_hardlink (const char *src, const char *dst,
|
||||
struct link_name *lp)
|
||||
{
|
||||
- /* TODO: selinux needed? */
|
||||
+ /* TODO: selinux, ACL, Extended Attributes needed? */
|
||||
|
||||
if (link (lp->ln_name, dst) != 0) {
|
||||
return -1;
|
||||
@@ -574,7 +618,7 @@ static int copy_hardlink (const char *sr
|
||||
*
|
||||
* Return 0 on success, -1 on error.
|
||||
*/
|
||||
-static int copy_special (const char *dst,
|
||||
+static int copy_special (const char *src, const char *dst,
|
||||
const struct stat *statp, const struct timeval mt[],
|
||||
long int uid, long int gid)
|
||||
{
|
||||
@@ -628,11 +672,18 @@ static int copy_file (const char *src, c
|
||||
|| (fchown (ofd,
|
||||
(uid == -1) ? statp->st_uid : (uid_t) uid,
|
||||
(gid == -1) ? statp->st_gid : (gid_t) gid) != 0)
|
||||
- || (fchmod (ofd, statp->st_mode & 07777) != 0)) {
|
||||
+ || (fchmod (ofd, statp->st_mode & 07777) != 0)) {
|
||||
(void) close (ifd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ if (perm_copy_fd (src, ifd, dst, ofd, &ctx) != 0) {
|
||||
+ if (errno!=EOPNOTSUPP) {
|
||||
+ (void) close (ifd);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
while ((cnt = read (ifd, buf, sizeof buf)) > 0) {
|
||||
if (write (ofd, buf, (size_t)cnt) != cnt) {
|
||||
return -1;
|
||||
diff -up shadow-4.1.4.2/src/Makefile.in.acl shadow-4.1.4.2/src/Makefile.in
|
||||
--- shadow-4.1.4.2/src/Makefile.in.acl 2009-07-24 03:16:00.000000000 +0200
|
||||
+++ shadow-4.1.4.2/src/Makefile.in 2011-02-09 17:35:23.470411800 +0100
|
||||
@@ -430,9 +430,9 @@ su_SOURCES = \
|
||||
|
||||
su_LDADD = $(LDADD) $(LIBPAM) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD)
|
||||
sulogin_LDADD = $(LDADD) $(LIBCRYPT)
|
||||
-useradd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
|
||||
-userdel_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
|
||||
-usermod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
|
||||
+useradd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) -lacl
|
||||
+userdel_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) -lacl
|
||||
+usermod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) -lacl
|
||||
vipw_LDADD = $(LDADD) $(LIBSELINUX)
|
||||
all: all-am
|
||||
|
||||
53
shadow-4.1.4.2-fixes.patch
Normal file
53
shadow-4.1.4.2-fixes.patch
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
diff -up shadow-4.1.4.2/libmisc/cleanup.c.fixes shadow-4.1.4.2/libmisc/cleanup.c
|
||||
--- shadow-4.1.4.2/libmisc/cleanup.c.fixes 2009-09-07 15:52:22.449035388 +0200
|
||||
+++ shadow-4.1.4.2/libmisc/cleanup.c 2009-09-07 15:55:06.632033653 +0200
|
||||
@@ -107,7 +107,7 @@ void del_cleanup (cleanup_function pcf)
|
||||
assert (i<CLEANUP_FUNCTIONS);
|
||||
|
||||
/* Move the rest of the cleanup functions */
|
||||
- for (; i<CLEANUP_FUNCTIONS; i++) {
|
||||
+ for (; i<(CLEANUP_FUNCTIONS - 1); i++) {
|
||||
/* Make sure the cleanup function was specified only once */
|
||||
assert (cleanup_functions[i+1] != pcf);
|
||||
|
||||
diff -up shadow-4.1.4.2/libmisc/limits.c.fixes shadow-4.1.4.2/libmisc/limits.c
|
||||
--- shadow-4.1.4.2/libmisc/limits.c.fixes 2009-09-07 15:55:38.734034494 +0200
|
||||
+++ shadow-4.1.4.2/libmisc/limits.c 2009-09-07 15:56:10.545044166 +0200
|
||||
@@ -167,7 +167,7 @@ static int check_logins (const char *nam
|
||||
* includes the user who is currently trying to log in.
|
||||
*/
|
||||
if (count > limit) {
|
||||
- SYSLOG ((LOG_WARN, "Too many logins (max %d) for %s\n",
|
||||
+ SYSLOG ((LOG_WARN, "Too many logins (max %lu) for %s\n",
|
||||
limit, name));
|
||||
return LOGIN_ERROR_LOGIN;
|
||||
}
|
||||
diff -up shadow-4.1.4.2/libmisc/utmp.c.fixes shadow-4.1.4.2/libmisc/utmp.c
|
||||
--- shadow-4.1.4.2/libmisc/utmp.c.fixes 2009-09-07 15:56:30.534033865 +0200
|
||||
+++ shadow-4.1.4.2/libmisc/utmp.c 2009-09-07 16:11:23.049069289 +0200
|
||||
@@ -56,7 +56,7 @@ static bool is_my_tty (const char *tty)
|
||||
/* full_tty shall be at least sizeof utmp.ut_line + 5 */
|
||||
char full_tty[200];
|
||||
/* tmptty shall be bigger than full_tty */
|
||||
- static char tmptty[sizeof (full_tty)+1];
|
||||
+ static char tmptty[sizeof (full_tty)+1] = "";
|
||||
|
||||
if ('/' != *tty) {
|
||||
(void) snprintf (full_tty, sizeof full_tty, "/dev/%s", tty);
|
||||
@@ -71,7 +71,7 @@ static bool is_my_tty (const char *tty)
|
||||
}
|
||||
}
|
||||
|
||||
- if (NULL == tmptty) {
|
||||
+ if ('\0' == tmptty[0]) {
|
||||
(void) puts (_("Unable to determine your tty name."));
|
||||
exit (EXIT_FAILURE);
|
||||
} else if (strncmp (tty, tmptty, sizeof (tmptty)) != 0) {
|
||||
@@ -200,7 +200,6 @@ static void updwtmpx (const char *filena
|
||||
strcpy (hostname, host);
|
||||
#ifdef HAVE_STRUCT_UTMP_UT_HOST
|
||||
} else if ( (NULL != ut)
|
||||
- && (NULL != ut->ut_host)
|
||||
&& ('\0' != ut->ut_host[0])) {
|
||||
hostname = (char *) xmalloc (sizeof (ut->ut_host) + 1);
|
||||
strncpy (hostname, ut->ut_host, sizeof (ut->ut_host));
|
||||
23
shadow-4.1.4.2-gshadow.patch
Normal file
23
shadow-4.1.4.2-gshadow.patch
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
diff -up shadow-4.1.4.2/lib/gshadow.c.gshadow shadow-4.1.4.2/lib/gshadow.c
|
||||
--- shadow-4.1.4.2/lib/gshadow.c.gshadow 2009-06-12 19:50:23.000000000 +0200
|
||||
+++ shadow-4.1.4.2/lib/gshadow.c 2011-01-05 16:28:55.207685148 +0100
|
||||
@@ -223,6 +223,7 @@ void endsgent (void)
|
||||
if (NULL == buf) {
|
||||
return NULL;
|
||||
}
|
||||
+ buflen = BUFSIZ;
|
||||
}
|
||||
|
||||
if (NULL == fp) {
|
||||
@@ -230,9 +231,9 @@ void endsgent (void)
|
||||
}
|
||||
|
||||
#ifdef USE_NIS
|
||||
- while (fgetsx (buf, (int) sizeof buf, fp) == buf)
|
||||
+ while (fgetsx (buf, (int) buflen, fp) == buf)
|
||||
#else
|
||||
- if (fgetsx (buf, (int) sizeof buf, fp) == buf)
|
||||
+ if (fgetsx (buf, (int) buflen, fp) == buf)
|
||||
#endif
|
||||
{
|
||||
while ( ((cp = strrchr (buf, '\n')) == NULL)
|
||||
32
shadow-4.1.4.2-infoParentDir.patch
Normal file
32
shadow-4.1.4.2-infoParentDir.patch
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
diff -up shadow-4.1.4.2/man/newusers.8.infoParentDir shadow-4.1.4.2/man/newusers.8
|
||||
--- shadow-4.1.4.2/man/newusers.8.infoParentDir 2010-04-28 13:44:04.634870854 +0200
|
||||
+++ shadow-4.1.4.2/man/newusers.8 2010-04-28 13:46:07.190866220 +0200
|
||||
@@ -88,7 +88,7 @@ This field is copied in the GECOS field
|
||||
.RS 4
|
||||
This field is used to define the home directory of the user\&.
|
||||
.sp
|
||||
-If this field does not specify an existing directory, the specified directory is created, with ownership set to the user being created or updated and its primary group\&.
|
||||
+If this field does not specify an existing directory, the specified directory is created, with ownership set to the user being created or updated and its primary group\&. Note that newusers does not create parent directories of the new user's home directory. The newusers command will fail to create the home directory if the parent directories do not exist, and will send a message to stderr informing the user of the failure. The newusers command will not halt or return a failure to the calling shell if it fails to create the home directory, it will continue to process the batch of new users specified\&.
|
||||
.sp
|
||||
If the home directory of an existing user is changed,
|
||||
\fBnewusers\fR
|
||||
diff -up shadow-4.1.4.2/man/newusers.8.xml.infoParentDir shadow-4.1.4.2/man/newusers.8.xml
|
||||
--- shadow-4.1.4.2/man/newusers.8.xml.infoParentDir 2010-04-28 13:48:01.419238133 +0200
|
||||
+++ shadow-4.1.4.2/man/newusers.8.xml 2010-04-28 13:55:40.499663030 +0200
|
||||
@@ -192,7 +192,15 @@
|
||||
<para>
|
||||
If this field does not specify an existing directory, the
|
||||
specified directory is created, with ownership set to the
|
||||
- user being created or updated and its primary group.
|
||||
+ user being created or updated and its primary group. Note
|
||||
+ that newusers does not create parent directories of the new
|
||||
+ user's home directory. The newusers command will fail to
|
||||
+ create the home directory if the parent directories do not
|
||||
+ exist, and will send a message to stderr informing the user
|
||||
+ of the failure. The newusers command will not halt or return
|
||||
+ a failure to the calling shell if it fails to create the home
|
||||
+ directory, it will continue to process the batch of new users
|
||||
+ specified.
|
||||
</para>
|
||||
<para>
|
||||
If the home directory of an existing user is changed,
|
||||
108
shadow-4.1.4.2-leak.patch
Normal file
108
shadow-4.1.4.2-leak.patch
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
diff -up shadow-4.1.4.2/lib/groupmem.c.leak shadow-4.1.4.2/lib/groupmem.c
|
||||
--- shadow-4.1.4.2/lib/groupmem.c.leak 2009-04-23 19:43:27.000000000 +0200
|
||||
+++ shadow-4.1.4.2/lib/groupmem.c 2009-09-07 15:43:23.314129427 +0200
|
||||
@@ -51,10 +51,13 @@
|
||||
*gr = *grent;
|
||||
gr->gr_name = strdup (grent->gr_name);
|
||||
if (NULL == gr->gr_name) {
|
||||
+ free(gr);
|
||||
return NULL;
|
||||
}
|
||||
gr->gr_passwd = strdup (grent->gr_passwd);
|
||||
if (NULL == gr->gr_passwd) {
|
||||
+ free(gr->gr_name);
|
||||
+ free(gr);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -62,11 +65,21 @@
|
||||
|
||||
gr->gr_mem = (char **) malloc ((i + 1) * sizeof (char *));
|
||||
if (NULL == gr->gr_mem) {
|
||||
+ free(gr->gr_passwd);
|
||||
+ free(gr->gr_name);
|
||||
+ free(gr);
|
||||
return NULL;
|
||||
}
|
||||
for (i = 0; grent->gr_mem[i]; i++) {
|
||||
gr->gr_mem[i] = strdup (grent->gr_mem[i]);
|
||||
if (NULL == gr->gr_mem[i]) {
|
||||
+ int j;
|
||||
+ for (j=0; j<i; j++)
|
||||
+ free(gr->gr_mem[j]);
|
||||
+ free(gr->gr_mem);
|
||||
+ free(gr->gr_passwd);
|
||||
+ free(gr->gr_name);
|
||||
+ free(gr);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
diff -up shadow-4.1.4.2/libmisc/copydir.c.leak shadow-4.1.4.2/libmisc/copydir.c
|
||||
--- shadow-4.1.4.2/libmisc/copydir.c.leak 2009-05-22 12:16:14.000000000 +0200
|
||||
+++ shadow-4.1.4.2/libmisc/copydir.c 2009-09-07 15:41:49.217192095 +0200
|
||||
@@ -443,6 +443,7 @@ static char *readlink_malloc (const char
|
||||
nchars = readlink (filename, buffer, size);
|
||||
|
||||
if (nchars < 0) {
|
||||
+ free(buffer);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
diff -up shadow-4.1.4.2/lib/pwmem.c.leak shadow-4.1.4.2/lib/pwmem.c
|
||||
--- shadow-4.1.4.2/lib/pwmem.c.leak 2009-04-23 19:43:27.000000000 +0200
|
||||
+++ shadow-4.1.4.2/lib/pwmem.c 2009-09-07 15:41:49.218203063 +0200
|
||||
@@ -51,22 +51,37 @@
|
||||
*pw = *pwent;
|
||||
pw->pw_name = strdup (pwent->pw_name);
|
||||
if (NULL == pw->pw_name) {
|
||||
+ free(pw);
|
||||
return NULL;
|
||||
}
|
||||
pw->pw_passwd = strdup (pwent->pw_passwd);
|
||||
if (NULL == pw->pw_passwd) {
|
||||
+ free(pw->pw_name);
|
||||
+ free(pw);
|
||||
return NULL;
|
||||
}
|
||||
pw->pw_gecos = strdup (pwent->pw_gecos);
|
||||
if (NULL == pw->pw_gecos) {
|
||||
+ free(pw->pw_passwd);
|
||||
+ free(pw->pw_name);
|
||||
+ free(pw);
|
||||
return NULL;
|
||||
}
|
||||
pw->pw_dir = strdup (pwent->pw_dir);
|
||||
if (NULL == pw->pw_dir) {
|
||||
+ free(pw->pw_gecos);
|
||||
+ free(pw->pw_passwd);
|
||||
+ free(pw->pw_name);
|
||||
+ free(pw);
|
||||
return NULL;
|
||||
}
|
||||
pw->pw_shell = strdup (pwent->pw_shell);
|
||||
if (NULL == pw->pw_shell) {
|
||||
+ free(pw->pw_dir);
|
||||
+ free(pw->pw_gecos);
|
||||
+ free(pw->pw_passwd);
|
||||
+ free(pw->pw_name);
|
||||
+ free(pw);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
diff -up shadow-4.1.4.2/lib/shadowmem.c.leak shadow-4.1.4.2/lib/shadowmem.c
|
||||
--- shadow-4.1.4.2/lib/shadowmem.c.leak 2009-04-23 19:43:27.000000000 +0200
|
||||
+++ shadow-4.1.4.2/lib/shadowmem.c 2009-09-07 15:41:49.218203063 +0200
|
||||
@@ -52,10 +52,13 @@
|
||||
*sp = *spent;
|
||||
sp->sp_namp = strdup (spent->sp_namp);
|
||||
if (NULL == sp->sp_namp) {
|
||||
+ free(sp);
|
||||
return NULL;
|
||||
}
|
||||
sp->sp_pwdp = strdup (spent->sp_pwdp);
|
||||
if (NULL == sp->sp_pwdp) {
|
||||
+ free(sp->sp_namp);
|
||||
+ free(sp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
53
shadow-4.1.4.2-redhat.patch
Normal file
53
shadow-4.1.4.2-redhat.patch
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
diff -up shadow-4.1.4.2/man/useradd.8.redhat shadow-4.1.4.2/man/useradd.8
|
||||
--- shadow-4.1.4.2/man/useradd.8.redhat 2009-07-24 03:16:44.000000000 +0200
|
||||
+++ shadow-4.1.4.2/man/useradd.8 2011-02-09 11:04:24.851151246 +0100
|
||||
@@ -211,7 +211,7 @@ Create the user\'s home directory if it
|
||||
\fB\-k\fR
|
||||
option) will be copied to the home directory\&.
|
||||
.sp
|
||||
-By default, no home directories are created\&.
|
||||
+The home directories are created by default on RHEL/Fedora systems because of /etc/login.defs (\fBCREATE_HOME\fR) setting\&.
|
||||
.RE
|
||||
.PP
|
||||
\fB\-M\fR
|
||||
diff -up shadow-4.1.4.2/src/useradd.c.redhat shadow-4.1.4.2/src/useradd.c
|
||||
--- shadow-4.1.4.2/src/useradd.c.redhat 2009-06-06 00:16:58.000000000 +0200
|
||||
+++ shadow-4.1.4.2/src/useradd.c 2011-02-09 11:04:06.031036886 +0100
|
||||
@@ -90,7 +90,7 @@ char *Prog;
|
||||
static gid_t def_group = 100;
|
||||
static const char *def_gname = "other";
|
||||
static const char *def_home = "/home";
|
||||
-static const char *def_shell = "";
|
||||
+static const char *def_shell = "/sbin/nologin";
|
||||
static const char *def_template = SKEL_DIR;
|
||||
static const char *def_create_mail_spool = "no";
|
||||
|
||||
@@ -102,7 +102,7 @@ static char def_file[] = USER_DEFAULTS_F
|
||||
#define VALID(s) (strcspn (s, ":\n") == strlen (s))
|
||||
|
||||
static const char *user_name = "";
|
||||
-static const char *user_pass = "!";
|
||||
+static const char *user_pass = "!!";
|
||||
static uid_t user_id;
|
||||
static gid_t user_gid;
|
||||
static const char *user_comment = "";
|
||||
@@ -989,9 +989,9 @@ static void process_flags (int argc, cha
|
||||
};
|
||||
while ((c = getopt_long (argc, argv,
|
||||
#ifdef WITH_SELINUX
|
||||
- "b:c:d:De:f:g:G:k:K:lmMNop:rs:u:UZ:",
|
||||
+ "b:c:d:De:f:g:G:k:K:lmMnNop:rs:u:UZ:",
|
||||
#else
|
||||
- "b:c:d:De:f:g:G:k:K:lmMNop:rs:u:U",
|
||||
+ "b:c:d:De:f:g:G:k:K:lmMnNop:rs:u:U",
|
||||
#endif
|
||||
long_options, NULL)) != -1) {
|
||||
switch (c) {
|
||||
@@ -1141,6 +1141,7 @@ static void process_flags (int argc, cha
|
||||
case 'M':
|
||||
Mflg = true;
|
||||
break;
|
||||
+ case 'n':
|
||||
case 'N':
|
||||
Nflg = true;
|
||||
break;
|
||||
58
shadow-4.1.4.2-underflow.patch
Normal file
58
shadow-4.1.4.2-underflow.patch
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
diff -up shadow-4.1.4.3/src/faillog.c.underflow shadow-4.1.4.3/src/faillog.c
|
||||
--- shadow-4.1.4.3/src/faillog.c.underflow 2011-02-13 12:58:16.000000000 -0500
|
||||
+++ shadow-4.1.4.3/src/faillog.c 2011-05-30 17:48:55.000000000 -0400
|
||||
@@ -106,8 +106,8 @@ static void print_one (/*@null@*/const s
|
||||
return;
|
||||
}
|
||||
|
||||
- offset = pw->pw_uid * sizeof (fl);
|
||||
- if (offset <= (statbuf.st_size - sizeof (fl))) {
|
||||
+ offset = (off_t) pw->pw_uid * sizeof (fl);
|
||||
+ if (offset + sizeof (fl) <= statbuf.st_size) {
|
||||
/* fseeko errors are not really relevant for us. */
|
||||
int err = fseeko (fail, offset, SEEK_SET);
|
||||
assert (0 == err);
|
||||
@@ -206,8 +206,8 @@ static bool reset_one (uid_t uid)
|
||||
off_t offset;
|
||||
struct faillog fl;
|
||||
|
||||
- offset = uid * sizeof (fl);
|
||||
- if (offset <= (statbuf.st_size - sizeof (fl))) {
|
||||
+ offset = (off_t) uid * sizeof (fl);
|
||||
+ if (offset + sizeof (fl) <= statbuf.st_size) {
|
||||
/* fseeko errors are not really relevant for us. */
|
||||
int err = fseeko (fail, offset, SEEK_SET);
|
||||
assert (0 == err);
|
||||
@@ -294,7 +294,7 @@ static bool setmax_one (uid_t uid, int m
|
||||
struct faillog fl;
|
||||
|
||||
offset = (off_t) uid * sizeof (fl);
|
||||
- if (offset <= (statbuf.st_size - sizeof (fl))) {
|
||||
+ if (offset + sizeof (fl) <= statbuf.st_size) {
|
||||
/* fseeko errors are not really relevant for us. */
|
||||
int err = fseeko (fail, offset, SEEK_SET);
|
||||
assert (0 == err);
|
||||
@@ -385,7 +385,7 @@ static bool set_locktime_one (uid_t uid,
|
||||
struct faillog fl;
|
||||
|
||||
offset = (off_t) uid * sizeof (fl);
|
||||
- if (offset <= (statbuf.st_size - sizeof (fl))) {
|
||||
+ if (offset + sizeof (fl) <= statbuf.st_size) {
|
||||
/* fseeko errors are not really relevant for us. */
|
||||
int err = fseeko (fail, offset, SEEK_SET);
|
||||
assert (0 == err);
|
||||
diff -up shadow-4.1.4.3/src/lastlog.c.underflow shadow-4.1.4.3/src/lastlog.c
|
||||
--- shadow-4.1.4.3/src/lastlog.c.underflow 2011-05-31 03:52:25.000000000 -0400
|
||||
+++ shadow-4.1.4.3/src/lastlog.c 2011-05-31 03:53:32.000000000 -0400
|
||||
@@ -102,9 +102,8 @@ static void print_one (/*@null@*/const s
|
||||
}
|
||||
|
||||
|
||||
- offset = pw->pw_uid * sizeof (ll);
|
||||
-
|
||||
- if (offset <= (statbuf.st_size - sizeof (ll))) {
|
||||
+ offset = (off_t) pw->pw_uid * sizeof (ll);
|
||||
+ if (offset + sizeof (ll) <= statbuf.st_size) {
|
||||
/* fseeko errors are not really relevant for us. */
|
||||
int err = fseeko (lastlogfile, offset, SEEK_SET);
|
||||
assert (0 == err);
|
||||
115
shadow-4.1.4.3-IDs.patch
Normal file
115
shadow-4.1.4.3-IDs.patch
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
diff -up shadow-4.1.4.3/libmisc/find_new_gid.c.IDs shadow-4.1.4.3/libmisc/find_new_gid.c
|
||||
--- shadow-4.1.4.3/libmisc/find_new_gid.c.IDs 2011-12-20 13:28:13.042668305 +0100
|
||||
+++ shadow-4.1.4.3/libmisc/find_new_gid.c 2011-12-20 13:35:40.011817589 +0100
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
+#include <errno.h>
|
||||
|
||||
#include "prototypes.h"
|
||||
#include "groupio.h"
|
||||
@@ -65,8 +66,6 @@ int find_new_gid (bool sys_group,
|
||||
gid_max = (gid_t) getdef_ulong ("GID_MIN", 1000UL) - 1;
|
||||
gid_max = (gid_t) getdef_ulong ("SYS_GID_MAX", (unsigned long) gid_max);
|
||||
}
|
||||
- used_gids = alloca (sizeof (bool) * (gid_max +1));
|
||||
- memset (used_gids, false, sizeof (bool) * (gid_max + 1));
|
||||
|
||||
if ( (NULL != preferred_gid)
|
||||
&& (*preferred_gid >= gid_min)
|
||||
@@ -80,6 +79,14 @@ int find_new_gid (bool sys_group,
|
||||
return 0;
|
||||
}
|
||||
|
||||
+ used_gids = malloc (sizeof (bool) * (gid_max +1));
|
||||
+ if(used_gids==NULL) {
|
||||
+ fprintf (stderr,
|
||||
+ _("%s: failed to allocate memory. %s\n"), Prog, strerror (errno));
|
||||
+ return -1;
|
||||
+ }
|
||||
+ memset (used_gids, false, sizeof (bool) * (gid_max + 1));
|
||||
+
|
||||
/* if we did not find free preffered system gid, we start to look for
|
||||
* one in the range assigned to dynamic system IDs */
|
||||
if (sys_group)
|
||||
@@ -162,6 +169,7 @@ int find_new_gid (bool sys_group,
|
||||
Prog);
|
||||
SYSLOG ((LOG_WARN,
|
||||
"no more available GID on the system"));
|
||||
+ free(used_gids);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -177,12 +185,14 @@ int find_new_gid (bool sys_group,
|
||||
_("%s: Can't get unique GID (no more available GIDs)\n"),
|
||||
Prog);
|
||||
SYSLOG ((LOG_WARN, "no more available GID on the system"));
|
||||
+ free(used_gids);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*gid = group_id;
|
||||
+ free(used_gids);
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff -up shadow-4.1.4.3/libmisc/find_new_uid.c.IDs shadow-4.1.4.3/libmisc/find_new_uid.c
|
||||
--- shadow-4.1.4.3/libmisc/find_new_uid.c.IDs 2011-02-13 18:58:11.000000000 +0100
|
||||
+++ shadow-4.1.4.3/libmisc/find_new_uid.c 2011-12-20 13:37:27.415023688 +0100
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
+#include <errno.h>
|
||||
|
||||
#include "prototypes.h"
|
||||
#include "pwio.h"
|
||||
@@ -65,8 +66,6 @@ int find_new_uid (bool sys_user,
|
||||
uid_max = (uid_t) getdef_ulong ("UID_MIN", 1000UL) - 1;
|
||||
uid_max = (uid_t) getdef_ulong ("SYS_UID_MAX", (unsigned long) uid_max);
|
||||
}
|
||||
- used_uids = alloca (sizeof (bool) * (uid_max +1));
|
||||
- memset (used_uids, false, sizeof (bool) * (uid_max + 1));
|
||||
|
||||
if ( (NULL != preferred_uid)
|
||||
&& (*preferred_uid >= uid_min)
|
||||
@@ -80,6 +79,13 @@ int find_new_uid (bool sys_user,
|
||||
return 0;
|
||||
}
|
||||
|
||||
+ used_uids = malloc (sizeof (bool) * (uid_max +1));
|
||||
+ if(used_uids==NULL) {
|
||||
+ fprintf (stderr,
|
||||
+ _("%s: failed to allocate memory. %s\n"), Prog, strerror (errno));
|
||||
+ return -1;
|
||||
+ }
|
||||
+ memset (used_uids, false, sizeof (bool) * (uid_max + 1));
|
||||
|
||||
/*
|
||||
* Search the entire password file,
|
||||
@@ -158,6 +164,7 @@ int find_new_uid (bool sys_user,
|
||||
Prog);
|
||||
SYSLOG ((LOG_WARN,
|
||||
"no more available UID on the system"));
|
||||
+ free(used_uids);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -173,12 +180,14 @@ int find_new_uid (bool sys_user,
|
||||
_("%s: Can't get unique UID (no more available UIDs)\n"),
|
||||
Prog);
|
||||
SYSLOG ((LOG_WARN, "no more available UID on the system"));
|
||||
+ free(used_uids);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*uid = user_id;
|
||||
+ free(used_uids);
|
||||
return 0;
|
||||
}
|
||||
|
||||
68
shadow-4.1.4.3-goodname.patch
Normal file
68
shadow-4.1.4.3-goodname.patch
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
diff -up shadow-4.1.4.3/libmisc/chkname.c.goodname shadow-4.1.4.3/libmisc/chkname.c
|
||||
--- shadow-4.1.4.3/libmisc/chkname.c.goodname 2011-02-13 18:58:11.000000000 +0100
|
||||
+++ shadow-4.1.4.3/libmisc/chkname.c 2011-05-18 20:38:50.639341048 +0200
|
||||
@@ -49,20 +49,28 @@
|
||||
static bool is_valid_name (const char *name)
|
||||
{
|
||||
/*
|
||||
- * User/group names must match [a-z_][a-z0-9_-]*[$]
|
||||
- */
|
||||
- if (('\0' == *name) ||
|
||||
- !((('a' <= *name) && ('z' >= *name)) || ('_' == *name))) {
|
||||
+ * User/group names must match gnu e-regex:
|
||||
+ * [a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,30}[a-zA-Z0-9_.$-]?
|
||||
+ *
|
||||
+ * as a non-POSIX, extension, allow "$" as the last char for
|
||||
+ * sake of Samba 3.x "add machine script"
|
||||
+ */
|
||||
+ if ( ('\0' == *name) ||
|
||||
+ !((*name >= 'a' && *name <= 'z') ||
|
||||
+ (*name >= 'A' && *name <= 'Z') ||
|
||||
+ (*name >= '0' && *name <= '9') ||
|
||||
+ (*name == '_') || (*name == '.')
|
||||
+ )) {
|
||||
return false;
|
||||
}
|
||||
|
||||
while ('\0' != *++name) {
|
||||
- if (!(( ('a' <= *name) && ('z' >= *name) ) ||
|
||||
- ( ('0' <= *name) && ('9' >= *name) ) ||
|
||||
- ('_' == *name) ||
|
||||
- ('-' == *name) ||
|
||||
- ( ('$' == *name) && ('\0' == *(name + 1)) )
|
||||
- )) {
|
||||
+ if (!( (*name >= 'a' && *name <= 'z') ||
|
||||
+ (*name >= 'A' && *name <= 'Z') ||
|
||||
+ (*name >= '0' && *name <= '9') ||
|
||||
+ (*name == '_') || (*name == '.') || (*name == '-') ||
|
||||
+ (*name == '$' && *(name + 1) == '\0')
|
||||
+ )) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
diff -up shadow-4.1.4.3/man/groupadd.8.goodname shadow-4.1.4.3/man/groupadd.8
|
||||
--- shadow-4.1.4.3/man/groupadd.8.goodname 2011-02-16 00:12:34.000000000 +0100
|
||||
+++ shadow-4.1.4.3/man/groupadd.8 2011-05-18 20:42:53.204324534 +0200
|
||||
@@ -162,9 +162,7 @@ Shadow password suite configuration\&.
|
||||
.RE
|
||||
.SH "CAVEATS"
|
||||
.PP
|
||||
-Groupnames must start with a lower case letter or an underscore, followed by lower case letters, digits, underscores, or dashes\&. They can end with a dollar sign\&. In regular expression terms: [a\-z_][a\-z0\-9_\-]*[$]?
|
||||
-.PP
|
||||
-Groupnames may only be up to characters long\&.
|
||||
+Groupnames may only be up to 32 characters long\&.
|
||||
.PP
|
||||
You may not add a NIS or LDAP group\&. This must be performed on the corresponding server\&.
|
||||
.PP
|
||||
diff -up shadow-4.1.4.3/man/useradd.8.goodname shadow-4.1.4.3/man/useradd.8
|
||||
--- shadow-4.1.4.3/man/useradd.8.goodname 2011-05-18 20:38:50.635376546 +0200
|
||||
+++ shadow-4.1.4.3/man/useradd.8 2011-05-18 20:38:50.641332694 +0200
|
||||
@@ -414,8 +414,6 @@ Similarly, if the username already exist
|
||||
\fBuseradd\fR
|
||||
will deny the user account creation request\&.
|
||||
.PP
|
||||
-Usernames must start with a lower case letter or an underscore, followed by lower case letters, digits, underscores, or dashes\&. They can end with a dollar sign\&. In regular expression terms: [a\-z_][a\-z0\-9_\-]*[$]?
|
||||
-.PP
|
||||
Usernames may only be up to 32 characters long\&.
|
||||
.SH "CONFIGURATION"
|
||||
.PP
|
||||
640
shadow-4.1.4.3-libsemanage.patch
Normal file
640
shadow-4.1.4.3-libsemanage.patch
Normal file
|
|
@ -0,0 +1,640 @@
|
|||
diff -up shadow-4.1.4.3/lib/Makefile.in.libsemanage shadow-4.1.4.3/lib/Makefile.in
|
||||
--- shadow-4.1.4.3/lib/Makefile.in.libsemanage 2011-02-15 23:18:15.000000000 +0100
|
||||
+++ shadow-4.1.4.3/lib/Makefile.in 2011-11-09 14:11:26.455362101 +0100
|
||||
@@ -52,7 +52,7 @@ am_libshadow_la_OBJECTS = commonio.lo en
|
||||
groupio.lo groupmem.lo gshadow.lo lockpw.lo nscd.lo port.lo \
|
||||
pwauth.lo pwio.lo pwmem.lo sgetgrent.lo sgetpwent.lo \
|
||||
sgetspent.lo sgroupio.lo shadow.lo shadowio.lo shadowmem.lo \
|
||||
- utent.lo
|
||||
+ utent.lo selinux.lo
|
||||
libshadow_la_OBJECTS = $(am_libshadow_la_OBJECTS)
|
||||
libshadow_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
@@ -202,7 +202,6 @@ libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
-lt_ECHO = @lt_ECHO@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
@@ -261,7 +260,8 @@ libshadow_la_SOURCES = \
|
||||
shadowio.c \
|
||||
shadowio.h \
|
||||
shadowmem.c \
|
||||
- utent.c
|
||||
+ utent.c \
|
||||
+ selinux.c
|
||||
|
||||
|
||||
# These files are unneeded for some reason, listed in
|
||||
@@ -349,6 +349,7 @@ distclean-compile:
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shadow.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shadowio.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shadowmem.Plo@am__quote@
|
||||
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/selinux.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utent.Plo@am__quote@
|
||||
|
||||
.c.o:
|
||||
diff -up shadow-4.1.4.3/libmisc/Makefile.in.libsemanage shadow-4.1.4.3/libmisc/Makefile.in
|
||||
--- shadow-4.1.4.3/libmisc/Makefile.in.libsemanage 2011-02-15 23:18:16.000000000 +0100
|
||||
+++ shadow-4.1.4.3/libmisc/Makefile.in 2011-11-09 14:11:26.456362098 +0100
|
||||
@@ -64,7 +64,7 @@ am_libmisc_a_OBJECTS = addgrps.$(OBJEXT)
|
||||
pam_pass_non_interractive.$(OBJEXT) pwd2spwd.$(OBJEXT) \
|
||||
pwdcheck.$(OBJEXT) pwd_init.$(OBJEXT) rlogin.$(OBJEXT) \
|
||||
salt.$(OBJEXT) setugid.$(OBJEXT) setupenv.$(OBJEXT) \
|
||||
- shell.$(OBJEXT) system.$(OBJEXT) strtoday.$(OBJEXT) \
|
||||
+ shell.$(OBJEXT) strtoday.$(OBJEXT) \
|
||||
sub.$(OBJEXT) sulog.$(OBJEXT) ttytype.$(OBJEXT) tz.$(OBJEXT) \
|
||||
ulimit.$(OBJEXT) user_busy.$(OBJEXT) utmp.$(OBJEXT) \
|
||||
valid.$(OBJEXT) xgetpwnam.$(OBJEXT) xgetpwuid.$(OBJEXT) \
|
||||
@@ -284,7 +284,6 @@ libmisc_a_SOURCES = \
|
||||
setugid.c \
|
||||
setupenv.c \
|
||||
shell.c \
|
||||
- system.c \
|
||||
strtoday.c \
|
||||
sub.c \
|
||||
sulog.c \
|
||||
@@ -394,7 +393,6 @@ distclean-compile:
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoday.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sub.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sulog.Po@am__quote@
|
||||
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/system.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ttytype.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tz.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ulimit.Po@am__quote@
|
||||
diff -up shadow-4.1.4.3/libmisc/system.c.libsemanage shadow-4.1.4.3/libmisc/system.c
|
||||
--- shadow-4.1.4.3/libmisc/system.c.libsemanage 2011-02-13 18:58:11.000000000 +0100
|
||||
+++ shadow-4.1.4.3/libmisc/system.c 2011-11-09 14:11:26.457362095 +0100
|
||||
@@ -1,72 +0,0 @@
|
||||
-/*
|
||||
- * Copyright (c) 2009 , Dan Walsh <dwalsh@redhat.com>
|
||||
- * All rights reserved.
|
||||
- *
|
||||
- * Redistribution and use in source and binary forms, with or without
|
||||
- * modification, are permitted provided that the following conditions
|
||||
- * are met:
|
||||
- * 1. Redistributions of source code must retain the above copyright
|
||||
- * notice, this list of conditions and the following disclaimer.
|
||||
- * 2. Redistributions in binary form must reproduce the above copyright
|
||||
- * notice, this list of conditions and the following disclaimer in the
|
||||
- * documentation and/or other materials provided with the distribution.
|
||||
- * 3. The name of the copyright holders or contributors may not be used to
|
||||
- * endorse or promote products derived from this software without
|
||||
- * specific prior written permission.
|
||||
- *
|
||||
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
- * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
- * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
- */
|
||||
-#include <config.h>
|
||||
-
|
||||
-#ident "$Id: system.c 2849 2009-04-30 21:08:49Z nekral-guest $"
|
||||
-
|
||||
-#include <stdio.h>
|
||||
-#include <sys/wait.h>
|
||||
-#include <fcntl.h>
|
||||
-#include "prototypes.h"
|
||||
-#include "defines.h"
|
||||
-
|
||||
-int safe_system (const char *command,
|
||||
- const char *argv[],
|
||||
- const char *env[],
|
||||
- int ignore_stderr)
|
||||
-{
|
||||
- int status = -1;
|
||||
- int fd;
|
||||
- pid_t pid;
|
||||
-
|
||||
- pid = fork();
|
||||
- if (pid < 0) {
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
- if (pid) { /* Parent */
|
||||
- if (waitpid (pid, &status, 0) > 0) {
|
||||
- return status;
|
||||
- } else {
|
||||
- return -1;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- fd = open ("/dev/null", O_RDWR);
|
||||
- /* Child */
|
||||
- dup2 (fd, 0); // Close Stdin
|
||||
- if (ignore_stderr) {
|
||||
- dup2 (fd, 2); // Close Stderr
|
||||
- }
|
||||
-
|
||||
- execve (command, (char *const *) argv, (char *const *) env);
|
||||
- fprintf (stderr, _("Failed to exec '%s'\n"), argv[0]);
|
||||
- exit (EXIT_FAILURE);
|
||||
-}
|
||||
-
|
||||
diff -up shadow-4.1.4.3/lib/prototypes.h.libsemanage shadow-4.1.4.3/lib/prototypes.h
|
||||
--- shadow-4.1.4.3/lib/prototypes.h.libsemanage 2011-02-13 18:58:23.000000000 +0100
|
||||
+++ shadow-4.1.4.3/lib/prototypes.h 2011-11-09 14:11:26.457362095 +0100
|
||||
@@ -331,12 +331,6 @@ extern void spw_free (/*@out@*/ /*@only@
|
||||
/* shell.c */
|
||||
extern int shell (const char *file, /*@null@*/const char *arg, char *const envp[]);
|
||||
|
||||
-/* system.c */
|
||||
-extern int safe_system (const char *command,
|
||||
- const char *argv[],
|
||||
- const char *env[],
|
||||
- int ignore_stderr);
|
||||
-
|
||||
/* strtoday.c */
|
||||
extern long strtoday (const char *);
|
||||
|
||||
@@ -403,4 +397,8 @@ extern /*@null@*/ /*@only@*/struct spwd
|
||||
/* yesno.c */
|
||||
extern bool yes_or_no (bool read_only);
|
||||
|
||||
+/* selinux.c */
|
||||
+int set_seuser(const char *login_name, const char *seuser_name);
|
||||
+int del_seuser(const char *login_name);
|
||||
+
|
||||
#endif /* _PROTOTYPES_H */
|
||||
diff -up shadow-4.1.4.3/lib/selinux.c.libsemanage shadow-4.1.4.3/lib/selinux.c
|
||||
--- shadow-4.1.4.3/lib/selinux.c.libsemanage 2011-11-09 14:11:26.458362092 +0100
|
||||
+++ shadow-4.1.4.3/lib/selinux.c 2011-11-09 14:11:26.458362092 +0100
|
||||
@@ -0,0 +1,341 @@
|
||||
+/*
|
||||
+ shadow-utils
|
||||
+
|
||||
+ su-selinux.c
|
||||
+
|
||||
+ Copyright (C) Jakub Hrozek <jhrozek@redhat.com> 2010
|
||||
+ Copyright (C) Peter Vrabec <pvrabec@redhat.com> 2011
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+*/
|
||||
+
|
||||
+#include <config.h>
|
||||
+
|
||||
+#include "defines.h"
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <selinux/selinux.h>
|
||||
+#include <semanage/semanage.h>
|
||||
+
|
||||
+
|
||||
+#ifndef DEFAULT_SERANGE
|
||||
+#define DEFAULT_SERANGE "s0"
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
+static void semanage_error_callback(void *varg,
|
||||
+ semanage_handle_t *handle,
|
||||
+ const char *fmt, ...)
|
||||
+{
|
||||
+ int ret;
|
||||
+ char * message = NULL;
|
||||
+ va_list ap;
|
||||
+
|
||||
+
|
||||
+ va_start(ap, fmt);
|
||||
+ ret = vasprintf(&message, fmt, ap);
|
||||
+ va_end(ap);
|
||||
+ if (ret < 0) {
|
||||
+ /* ENOMEM */
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ switch (semanage_msg_get_level(handle)) {
|
||||
+ case SEMANAGE_MSG_ERR:
|
||||
+ case SEMANAGE_MSG_WARN:
|
||||
+ fprintf(stderr, "[libsemanage]: %s\n", message);
|
||||
+ break;
|
||||
+ case SEMANAGE_MSG_INFO:
|
||||
+ /* nop */
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ free(message);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static semanage_handle_t *semanage_init(void)
|
||||
+{
|
||||
+ int ret;
|
||||
+ semanage_handle_t *handle = NULL;
|
||||
+
|
||||
+ handle = semanage_handle_create();
|
||||
+ if (!handle) {
|
||||
+ fprintf(stderr, _("Cannot create SELinux management handle\n"));
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ semanage_msg_set_callback(handle, semanage_error_callback, NULL);
|
||||
+
|
||||
+ ret = semanage_is_managed(handle);
|
||||
+ if (ret != 1) {
|
||||
+ fprintf(stderr, _("SELinux policy not managed\n"));
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ ret = semanage_access_check(handle);
|
||||
+ if (ret < SEMANAGE_CAN_READ) {
|
||||
+ fprintf(stderr, _("Cannot read SELinux policy store\n"));
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ ret = semanage_connect(handle);
|
||||
+ if (ret != 0) {
|
||||
+ fprintf(stderr, _("Cannot estabilish SELinux management connection\n"));
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ ret = semanage_begin_transaction(handle);
|
||||
+ if (ret != 0) {
|
||||
+ fprintf(stderr, _("Cannot begin SELinux transaction\n"));
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ return handle;
|
||||
+fail:
|
||||
+ semanage_handle_destroy(handle);
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int semanage_user_mod(semanage_handle_t *handle,
|
||||
+ semanage_seuser_key_t *key,
|
||||
+ const char *login_name,
|
||||
+ const char *seuser_name)
|
||||
+{
|
||||
+ int ret;
|
||||
+ semanage_seuser_t *seuser = NULL;
|
||||
+
|
||||
+ semanage_seuser_query(handle, key, &seuser);
|
||||
+ if (seuser == NULL) {
|
||||
+ fprintf(stderr, _("Could not query seuser for %s\n"), login_name);
|
||||
+ ret = 1;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ ret = semanage_seuser_set_mlsrange(handle, seuser, DEFAULT_SERANGE);
|
||||
+ if (ret != 0) {
|
||||
+ fprintf(stderr, _("Could not set serange for %s\n"), login_name);
|
||||
+ ret = 1;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ ret = semanage_seuser_set_sename(handle, seuser, seuser_name);
|
||||
+ if (ret != 0) {
|
||||
+ fprintf(stderr, _("Could not set sename for %s\n"), login_name);
|
||||
+ ret = 1;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ ret = semanage_seuser_modify_local(handle, key, seuser);
|
||||
+ if (ret != 0) {
|
||||
+ fprintf(stderr, _("Could not modify login mapping for %s\n"), login_name);
|
||||
+ ret = 1;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ ret = 0;
|
||||
+done:
|
||||
+ semanage_seuser_free(seuser);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int semanage_user_add(semanage_handle_t *handle,
|
||||
+ semanage_seuser_key_t *key,
|
||||
+ const char *login_name,
|
||||
+ const char *seuser_name)
|
||||
+{
|
||||
+ int ret;
|
||||
+ semanage_seuser_t *seuser = NULL;
|
||||
+
|
||||
+ ret = semanage_seuser_create(handle, &seuser);
|
||||
+ if (ret != 0) {
|
||||
+ fprintf(stderr, _("Cannot create SELinux login mapping for %s\n"), login_name);
|
||||
+ ret = 1;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ ret = semanage_seuser_set_name(handle, seuser, login_name);
|
||||
+ if (ret != 0) {
|
||||
+ fprintf(stderr, _("Could not set name for %s\n"), login_name);
|
||||
+ ret = 1;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ ret = semanage_seuser_set_mlsrange(handle, seuser, DEFAULT_SERANGE);
|
||||
+ if (ret != 0) {
|
||||
+ fprintf(stderr, _("Could not set serange for %s\n"), login_name);
|
||||
+ ret = 1;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ ret = semanage_seuser_set_sename(handle, seuser, seuser_name);
|
||||
+ if (ret != 0) {
|
||||
+ fprintf(stderr, _("Could not set SELinux user for %s\n"), login_name);
|
||||
+ ret = 1;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ ret = semanage_seuser_modify_local(handle, key, seuser);
|
||||
+ if (ret != 0) {
|
||||
+ fprintf(stderr, _("Could not add login mapping for %s\n"), login_name);
|
||||
+ ret = 1;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ ret = 0;
|
||||
+done:
|
||||
+ semanage_seuser_free(seuser);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+int set_seuser(const char *login_name, const char *seuser_name)
|
||||
+{
|
||||
+ semanage_handle_t *handle = NULL;
|
||||
+ semanage_seuser_key_t *key = NULL;
|
||||
+ int ret;
|
||||
+ int seuser_exists = 0;
|
||||
+
|
||||
+ if (seuser_name == NULL) {
|
||||
+ /* don't care, just let system pick the defaults */
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ handle = semanage_init();
|
||||
+ if (!handle) {
|
||||
+ fprintf(stderr, _("Cannot init SELinux management\n"));
|
||||
+ ret = 1;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ ret = semanage_seuser_key_create(handle, login_name, &key);
|
||||
+ if (ret != 0) {
|
||||
+ fprintf(stderr, _("Cannot create SELinux user key\n"));
|
||||
+ ret = 1;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ ret = semanage_seuser_exists(handle, key, &seuser_exists);
|
||||
+ if (ret < 0) {
|
||||
+ fprintf(stderr, _("Cannot verify the SELinux user\n"));
|
||||
+ ret = 1;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ if (seuser_exists) {
|
||||
+ ret = semanage_user_mod(handle, key, login_name, seuser_name);
|
||||
+ if (ret != 0) {
|
||||
+ fprintf(stderr, _("Cannot modify SELinux user mapping\n"));
|
||||
+ ret = 1;
|
||||
+ goto done;
|
||||
+ }
|
||||
+ } else {
|
||||
+ ret = semanage_user_add(handle, key, login_name, seuser_name);
|
||||
+ if (ret != 0) {
|
||||
+ fprintf(stderr, _("Cannot add SELinux user mapping\n"));
|
||||
+ ret = 1;
|
||||
+ goto done;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ ret = semanage_commit(handle);
|
||||
+ if (ret < 0) {
|
||||
+ fprintf(stderr,_("Cannot commit SELinux transaction\n"));
|
||||
+ ret = 1;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ ret = 0;
|
||||
+
|
||||
+done:
|
||||
+ semanage_seuser_key_free(key);
|
||||
+ semanage_handle_destroy(handle);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+int del_seuser(const char *login_name)
|
||||
+{
|
||||
+ semanage_handle_t *handle = NULL;
|
||||
+ semanage_seuser_key_t *key = NULL;
|
||||
+ int ret;
|
||||
+ int exists = 0;
|
||||
+
|
||||
+ handle = semanage_init();
|
||||
+ if (!handle) {
|
||||
+ fprintf(stderr, _("Cannot init SELinux management\n"));
|
||||
+ ret = 1;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ ret = semanage_seuser_key_create(handle, login_name, &key);
|
||||
+ if (ret != 0) {
|
||||
+ fprintf(stderr, _("Cannot create SELinux user key\n"));
|
||||
+ ret = 1;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ ret = semanage_seuser_exists(handle, key, &exists);
|
||||
+ if (ret < 0) {
|
||||
+ fprintf(stderr, _("Cannot verify the SELinux user\n"));
|
||||
+ ret = 1;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ if (!exists) {
|
||||
+ fprintf(stderr, _("Login mapping for %s is not defined, OK if default mapping was used\n"),
|
||||
+ login_name);
|
||||
+ ret = 0; /* probably default mapping */
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ ret = semanage_seuser_exists_local(handle, key, &exists);
|
||||
+ if (ret < 0) {
|
||||
+ fprintf(stderr, _("Cannot verify the SELinux user\n"));
|
||||
+ ret = 1;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ if (!exists) {
|
||||
+ fprintf(stderr, _("Login mapping for %s is defined in policy, cannot be deleted\n"),
|
||||
+ login_name);
|
||||
+ ret = 0; /* Login mapping defined in policy can't be deleted */
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ ret = semanage_seuser_del_local(handle, key);
|
||||
+ if (ret != 0) {
|
||||
+ fprintf(stderr, _("Could not delete login mapping for %s"), login_name);
|
||||
+ ret = 1;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ ret = semanage_commit(handle);
|
||||
+ if (ret < 0) {
|
||||
+ fprintf(stderr, _("Cannot commit SELinux transaction\n"));
|
||||
+ ret = 1;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ ret = 0;
|
||||
+done:
|
||||
+ semanage_handle_destroy(handle);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
diff -up shadow-4.1.4.3/man/userdel.8.libsemanage shadow-4.1.4.3/man/userdel.8
|
||||
--- shadow-4.1.4.3/man/userdel.8.libsemanage 2011-11-09 14:19:27.772753117 +0100
|
||||
+++ shadow-4.1.4.3/man/userdel.8 2011-11-09 14:21:13.947365740 +0100
|
||||
@@ -243,6 +243,11 @@ can\*(Aqt update group file
|
||||
.RS 4
|
||||
can\*(Aqt remove home directory
|
||||
.RE
|
||||
+.PP
|
||||
+\fI14\fR
|
||||
+.RS 4
|
||||
+can\*(Aqt update SELinux user mapping
|
||||
+.PP
|
||||
.SH "CAVEATS"
|
||||
.PP
|
||||
|
||||
diff -up shadow-4.1.4.3/src/Makefile.in.libsemanage shadow-4.1.4.3/src/Makefile.in
|
||||
--- shadow-4.1.4.3/src/Makefile.in.libsemanage 2011-11-09 14:11:26.431362175 +0100
|
||||
+++ shadow-4.1.4.3/src/Makefile.in 2011-11-09 14:11:26.459362089 +0100
|
||||
@@ -431,9 +431,9 @@ su_SOURCES = \
|
||||
|
||||
su_LDADD = $(LDADD) $(LIBPAM) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD)
|
||||
sulogin_LDADD = $(LDADD) $(LIBCRYPT)
|
||||
-useradd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) -lacl
|
||||
-userdel_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) -lacl
|
||||
-usermod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) -lacl
|
||||
+useradd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) -lacl -lsemanage
|
||||
+userdel_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) -lacl -lsemanage
|
||||
+usermod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) -lacl -lsemanage
|
||||
vipw_LDADD = $(LDADD) $(LIBSELINUX)
|
||||
all: all-am
|
||||
|
||||
diff -up shadow-4.1.4.3/src/useradd.c.libsemanage shadow-4.1.4.3/src/useradd.c
|
||||
--- shadow-4.1.4.3/src/useradd.c.libsemanage 2011-11-09 14:11:26.424362196 +0100
|
||||
+++ shadow-4.1.4.3/src/useradd.c 2011-11-09 14:11:26.460362086 +0100
|
||||
@@ -1999,16 +1999,7 @@ int main (int argc, char **argv)
|
||||
#ifdef WITH_SELINUX
|
||||
if (Zflg && *user_selinux) {
|
||||
if (is_selinux_enabled () > 0) {
|
||||
- const char *argv[7];
|
||||
-
|
||||
- argv[0] = "/usr/sbin/semanage";
|
||||
- argv[1] = "login";
|
||||
- argv[2] = "-a";
|
||||
- argv[3] = "-s";
|
||||
- argv[4] = user_selinux;
|
||||
- argv[5] = user_name;
|
||||
- argv[6] = NULL;
|
||||
- if (safe_system (argv[0], argv, NULL, 0)) {
|
||||
+ if (set_seuser(user_name, user_selinux)) {
|
||||
fprintf (stderr,
|
||||
_("%s: warning: the user name %s to %s SELinux user mapping failed.\n"),
|
||||
Prog, user_name, user_selinux);
|
||||
diff -up shadow-4.1.4.3/src/userdel.c.libsemanage shadow-4.1.4.3/src/userdel.c
|
||||
--- shadow-4.1.4.3/src/userdel.c.libsemanage 2011-11-09 14:11:26.425362193 +0100
|
||||
+++ shadow-4.1.4.3/src/userdel.c 2011-11-09 14:18:59.274855167 +0100
|
||||
@@ -70,6 +70,7 @@
|
||||
#define E_USER_BUSY 8 /* user currently logged in */
|
||||
#define E_GRP_UPDATE 10 /* can't update group file */
|
||||
#define E_HOMEDIR 12 /* can't remove home directory */
|
||||
+#define E_SE_UPDATE 14 /* can't update SELinux user mapping */
|
||||
|
||||
/*
|
||||
* Global variables
|
||||
@@ -1002,13 +1003,17 @@ int main (int argc, char **argv)
|
||||
#ifdef WITH_SELINUX
|
||||
if (Zflg) {
|
||||
if (is_selinux_enabled () > 0) {
|
||||
- const char *args[5];
|
||||
- args[0] = "/usr/sbin/semanage";
|
||||
- args[1] = "login";
|
||||
- args[2] = "-d";
|
||||
- args[3] = user_name;
|
||||
- args[4] = NULL;
|
||||
- safe_system (args[0], args, NULL, 1);
|
||||
+ if (del_seuser(user_name)) {
|
||||
+ fprintf (stderr,
|
||||
+ _("%s: warning: the user name %s to SELinux user mapping removal failed.\n"),
|
||||
+ Prog, user_name);
|
||||
+ #ifdef WITH_AUDIT
|
||||
+ audit_logger (AUDIT_ADD_USER, Prog,
|
||||
+ "removing SELinux user mapping",
|
||||
+ user_name, (unsigned int) user_id, 0);
|
||||
+ #endif
|
||||
+ fail_exit (E_SE_UPDATE);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
#endif
|
||||
diff -up shadow-4.1.4.3/src/usermod.c.libsemanage shadow-4.1.4.3/src/usermod.c
|
||||
--- shadow-4.1.4.3/src/usermod.c.libsemanage 2011-11-09 14:11:26.426362190 +0100
|
||||
+++ shadow-4.1.4.3/src/usermod.c 2011-11-09 14:11:26.463362076 +0100
|
||||
@@ -1787,28 +1787,16 @@ int main (int argc, char **argv)
|
||||
#ifdef WITH_SELINUX
|
||||
if (Zflg && *user_selinux) {
|
||||
if (is_selinux_enabled () > 0) {
|
||||
- const char *argv[7];
|
||||
-
|
||||
- argv[0] = "/usr/sbin/semanage";
|
||||
- argv[1] = "login";
|
||||
- argv[2] = "-m";
|
||||
- argv[3] = "-s";
|
||||
- argv[4] = user_selinux;
|
||||
- argv[5] = user_name;
|
||||
- argv[6] = NULL;
|
||||
- if (safe_system (argv[0], argv, NULL, 1)) {
|
||||
- argv[2] = "-a";
|
||||
- if (safe_system (argv[0], argv, NULL, 0)) {
|
||||
- fprintf (stderr,
|
||||
- _("%s: warning: the user name %s to %s SELinux user mapping failed.\n"),
|
||||
- Prog, user_name, user_selinux);
|
||||
+ if (set_seuser(user_name, user_selinux)) {
|
||||
+ fprintf (stderr,
|
||||
+ _("%s: warning: the user name %s to %s SELinux user mapping failed.\n"),
|
||||
+ Prog, user_name, user_selinux);
|
||||
#ifdef WITH_AUDIT
|
||||
- audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
|
||||
- "modifying User mapping ",
|
||||
- user_name, (unsigned int) user_id, 0);
|
||||
+ audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
|
||||
+ "modifying User mapping ",
|
||||
+ user_name, (unsigned int) user_id, 0);
|
||||
#endif
|
||||
- fail_exit (E_SE_UPDATE);
|
||||
- }
|
||||
+ fail_exit (E_SE_UPDATE);
|
||||
}
|
||||
}
|
||||
}
|
||||
27
shadow-4.1.4.3-man.patch
Normal file
27
shadow-4.1.4.3-man.patch
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
diff -up shadow-4.1.4.3/man/useradd.8.man shadow-4.1.4.3/man/useradd.8
|
||||
--- shadow-4.1.4.3/man/useradd.8.man 2011-11-09 14:30:51.402072168 +0100
|
||||
+++ shadow-4.1.4.3/man/useradd.8 2011-11-10 11:09:14.266810444 +0100
|
||||
@@ -220,12 +220,12 @@ Create the user\*(Aqs home directory if
|
||||
\fB\-k\fR
|
||||
option) will be copied to the home directory\&.
|
||||
.sp
|
||||
-The home directories are created by default on RHEL/Fedora systems because of /etc/login.defs (\fBCREATE_HOME\fR) setting\&.
|
||||
+useradd will create the home directory unless \fBCREATE_HOME\fR in /etc/login.defs is set to no\&.
|
||||
.RE
|
||||
.PP
|
||||
\fB\-M\fR
|
||||
.RS 4
|
||||
-Do no create the user\*(Aqs home directory, even if the system wide setting from
|
||||
+Do not create the user\*(Aqs home directory, even if the system wide setting from
|
||||
/etc/login\&.defs
|
||||
(\fBCREATE_HOME\fR) is set to
|
||||
\fIyes\fR\&.
|
||||
@@ -255,7 +255,7 @@ variable in
|
||||
Allow the creation of a user account with a duplicate (non\-unique) UID\&.
|
||||
.sp
|
||||
This option is only valid in combination with the
|
||||
-\fB\-o\fR
|
||||
+\fB\-u\fR
|
||||
option\&.
|
||||
.RE
|
||||
.PP
|
||||
32
shadow-4.1.4.3-nopam.patch
Normal file
32
shadow-4.1.4.3-nopam.patch
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
diff -up shadow-4.1.4.3/man/ru/Makefile.in.nopam shadow-4.1.4.3/man/ru/Makefile.in
|
||||
--- shadow-4.1.4.3/man/ru/Makefile.in.nopam 2011-05-20 22:42:23.145018292 +0200
|
||||
+++ shadow-4.1.4.3/man/ru/Makefile.in 2011-05-20 22:43:56.654017229 +0200
|
||||
@@ -150,7 +150,6 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
-PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
POSUB = @POSUB@
|
||||
@@ -222,13 +221,13 @@ target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
-man_MANS = $(man_nopam) chage.1 chfn.1 chgpasswd.8 chpasswd.8 chsh.1 \
|
||||
- expiry.1 faillog.5 faillog.8 getspnam.3 gpasswd.1 groupadd.8 \
|
||||
- groupdel.8 groupmems.8 groupmod.8 groups.1 grpck.8 grpconv.8 \
|
||||
- grpunconv.8 gshadow.5 lastlog.8 login.1 login.defs.5 logoutd.8 \
|
||||
- newgrp.1 newusers.8 nologin.8 passwd.1 passwd.5 pwck.8 \
|
||||
- pwconv.8 pwunconv.8 sg.1 shadow.3 shadow.5 su.1 suauth.5 \
|
||||
- useradd.8 userdel.8 usermod.8 vigr.8 vipw.8 $(am__append_1)
|
||||
+man_MANS = chage.1 chfn.1 chgpasswd.8 chpasswd.8 chsh.1 expiry.1 \
|
||||
+ faillog.5 faillog.8 getspnam.3 gpasswd.1 groupadd.8 groupdel.8 \
|
||||
+ groupmems.8 groupmod.8 groups.1 grpck.8 grpconv.8 grpunconv.8 \
|
||||
+ gshadow.5 lastlog.8 login.1 login.defs.5 logoutd.8 newgrp.1 \
|
||||
+ newusers.8 nologin.8 passwd.1 passwd.5 pwck.8 pwconv.8 \
|
||||
+ pwunconv.8 sg.1 shadow.3 shadow.5 su.1 suauth.5 useradd.8 \
|
||||
+ userdel.8 usermod.8 vigr.8 vipw.8 $(am__append_1)
|
||||
man_nopam = \
|
||||
limits.5 \
|
||||
login.access.5 \
|
||||
15
shadow-4.1.4.3-selinux.patch
Normal file
15
shadow-4.1.4.3-selinux.patch
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
diff -up shadow-4.1.4.3/lib/commonio.c.selinux shadow-4.1.4.3/lib/commonio.c
|
||||
--- shadow-4.1.4.3/lib/commonio.c.selinux 2011-02-13 18:58:23.000000000 +0100
|
||||
+++ shadow-4.1.4.3/lib/commonio.c 2011-11-16 17:09:46.615837659 +0100
|
||||
@@ -921,10 +921,10 @@ int commonio_close (struct commonio_db *
|
||||
|
||||
#ifdef WITH_SELINUX
|
||||
if (db->scontext != NULL) {
|
||||
- if (NULL != old_context) {
|
||||
if (setfscreatecon (old_context) < 0) {
|
||||
errors++;
|
||||
}
|
||||
+ if (NULL != old_context) {
|
||||
freecon (old_context);
|
||||
old_context = NULL;
|
||||
}
|
||||
294
shadow-4.1.4.3-semange.patch
Normal file
294
shadow-4.1.4.3-semange.patch
Normal file
|
|
@ -0,0 +1,294 @@
|
|||
diff -up shadow-4.1.4.3/man/useradd.8.semange shadow-4.1.4.3/man/useradd.8
|
||||
--- shadow-4.1.4.3/man/useradd.8.semange 2011-08-02 12:57:47.971838218 +0200
|
||||
+++ shadow-4.1.4.3/man/useradd.8 2011-08-02 12:57:47.985838145 +0200
|
||||
@@ -640,6 +640,11 @@ can\*(Aqt create home directory
|
||||
.RS 4
|
||||
can\*(Aqt create mail spool
|
||||
.RE
|
||||
+.PP
|
||||
+\fI14\fR
|
||||
+.RS 4
|
||||
+can\'t update SELinux user mapping
|
||||
+.RE
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
|
||||
diff -up shadow-4.1.4.3/man/userdel.8.semange shadow-4.1.4.3/man/userdel.8
|
||||
--- shadow-4.1.4.3/man/userdel.8.semange 2011-02-16 00:14:13.000000000 +0100
|
||||
+++ shadow-4.1.4.3/man/userdel.8 2011-08-02 12:57:47.985838145 +0200
|
||||
@@ -76,6 +76,11 @@ variable in the
|
||||
login\&.defs
|
||||
file\&.
|
||||
.RE
|
||||
+.PP
|
||||
+\fB\-Z\fR, \fB\-\-selinux-user\fR
|
||||
+.RS 4
|
||||
+Remove SELinux user assigned to the user´s login from SELinux login mapping.
|
||||
+.RE
|
||||
.SH "CONFIGURATION"
|
||||
.PP
|
||||
The following configuration variables in
|
||||
diff -up shadow-4.1.4.3/src/useradd.c.semange shadow-4.1.4.3/src/useradd.c
|
||||
--- shadow-4.1.4.3/src/useradd.c.semange 2011-08-02 12:57:47.968838234 +0200
|
||||
+++ shadow-4.1.4.3/src/useradd.c 2011-08-02 12:58:17.626684439 +0200
|
||||
@@ -164,6 +164,7 @@ static bool home_added = false;
|
||||
#define E_GRP_UPDATE 10 /* can't update group file */
|
||||
#define E_HOMEDIR 12 /* can't create home directory */
|
||||
#define E_MAIL_SPOOL 13 /* can't create mail spool */
|
||||
+#define E_SE_UPDATE 14 /* can't update SELinux user mapping */
|
||||
|
||||
#define DGROUP "GROUP="
|
||||
#define HOME "HOME="
|
||||
@@ -181,9 +182,6 @@ static int set_defaults (void);
|
||||
static int get_groups (char *);
|
||||
static void usage (void);
|
||||
static void new_pwent (struct passwd *);
|
||||
-#ifdef WITH_SELINUX
|
||||
-static void selinux_update_mapping (void);
|
||||
-#endif
|
||||
|
||||
static long scale_age (long);
|
||||
static void new_spent (struct spwd *);
|
||||
@@ -1710,32 +1708,6 @@ static void usr_update (void)
|
||||
}
|
||||
}
|
||||
|
||||
-#ifdef WITH_SELINUX
|
||||
-static void selinux_update_mapping (void) {
|
||||
- if (is_selinux_enabled () <= 0) return;
|
||||
-
|
||||
- if (*user_selinux) { /* must be done after passwd write() */
|
||||
- const char *argv[7];
|
||||
- argv[0] = "/usr/sbin/semanage";
|
||||
- argv[1] = "login";
|
||||
- argv[2] = "-a";
|
||||
- argv[3] = "-s";
|
||||
- argv[4] = user_selinux;
|
||||
- argv[5] = user_name;
|
||||
- argv[6] = NULL;
|
||||
- if (safe_system (argv[0], argv, NULL, 0)) {
|
||||
- fprintf (stderr,
|
||||
- _("%s: warning: the user name %s to %s SELinux user mapping failed.\n"),
|
||||
- Prog, user_name, user_selinux);
|
||||
-#ifdef WITH_AUDIT
|
||||
- audit_logger (AUDIT_ADD_USER, Prog,
|
||||
- "adding SELinux user mapping",
|
||||
- user_name, (unsigned int) user_id, 0);
|
||||
-#endif
|
||||
- }
|
||||
- }
|
||||
-}
|
||||
-#endif
|
||||
/*
|
||||
* create_home - create the user's home directory
|
||||
*
|
||||
@@ -2025,7 +1997,30 @@ int main (int argc, char **argv)
|
||||
close_files ();
|
||||
|
||||
#ifdef WITH_SELINUX
|
||||
- selinux_update_mapping ();
|
||||
+ if (Zflg && *user_selinux) {
|
||||
+ if (is_selinux_enabled () > 0) {
|
||||
+ const char *argv[7];
|
||||
+
|
||||
+ argv[0] = "/usr/sbin/semanage";
|
||||
+ argv[1] = "login";
|
||||
+ argv[2] = "-a";
|
||||
+ argv[3] = "-s";
|
||||
+ argv[4] = user_selinux;
|
||||
+ argv[5] = user_name;
|
||||
+ argv[6] = NULL;
|
||||
+ if (safe_system (argv[0], argv, NULL, 0)) {
|
||||
+ fprintf (stderr,
|
||||
+ _("%s: warning: the user name %s to %s SELinux user mapping failed.\n"),
|
||||
+ Prog, user_name, user_selinux);
|
||||
+ #ifdef WITH_AUDIT
|
||||
+ audit_logger (AUDIT_ADD_USER, Prog,
|
||||
+ "adding SELinux user mapping",
|
||||
+ user_name, (unsigned int) user_id, 0);
|
||||
+ #endif
|
||||
+ fail_exit (E_SE_UPDATE);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
#endif
|
||||
|
||||
nscd_flush_cache ("passwd");
|
||||
diff -up shadow-4.1.4.3/src/userdel.c.semange shadow-4.1.4.3/src/userdel.c
|
||||
--- shadow-4.1.4.3/src/userdel.c.semange 2011-02-13 18:58:16.000000000 +0100
|
||||
+++ shadow-4.1.4.3/src/userdel.c 2011-08-02 12:57:47.988838130 +0200
|
||||
@@ -82,6 +82,7 @@ static char *user_home;
|
||||
|
||||
static bool fflg = false;
|
||||
static bool rflg = false;
|
||||
+static bool Zflg = false;
|
||||
|
||||
static bool is_shadow_pwd;
|
||||
|
||||
@@ -120,6 +121,9 @@ static void usage (void)
|
||||
" even if not owned by user\n"
|
||||
" -h, --help display this help message and exit\n"
|
||||
" -r, --remove remove home directory and mail spool\n"
|
||||
+#ifdef WITH_SELINUX
|
||||
+ " -Z, --selinux-user remove SELinux user from SELinux user mapping\n"
|
||||
+#endif
|
||||
"\n"), stderr);
|
||||
exit (E_USAGE);
|
||||
}
|
||||
@@ -766,9 +770,17 @@ int main (int argc, char **argv)
|
||||
{"force", no_argument, NULL, 'f'},
|
||||
{"help", no_argument, NULL, 'h'},
|
||||
{"remove", no_argument, NULL, 'r'},
|
||||
+#ifdef WITH_SELINUX
|
||||
+ {"selinux-user", required_argument, NULL, 'Z'},
|
||||
+#endif
|
||||
{NULL, 0, NULL, '\0'}
|
||||
};
|
||||
- while ((c = getopt_long (argc, argv, "fhr",
|
||||
+ while ((c = getopt_long (argc, argv,
|
||||
+#ifdef WITH_SELINUX
|
||||
+ "fhrZ",
|
||||
+#else
|
||||
+ "fhr",
|
||||
+#endif
|
||||
long_options, NULL)) != -1) {
|
||||
switch (c) {
|
||||
case 'f': /* force remove even if not owned by user */
|
||||
@@ -777,6 +789,19 @@ int main (int argc, char **argv)
|
||||
case 'r': /* remove home dir and mailbox */
|
||||
rflg = true;
|
||||
break;
|
||||
+#ifdef WITH_SELINUX
|
||||
+ case 'Z':
|
||||
+ if (is_selinux_enabled () > 0) {
|
||||
+ Zflg = true;
|
||||
+ } else {
|
||||
+ fprintf (stderr,
|
||||
+ _("%s: -Z requires SELinux enabled kernel\n"),
|
||||
+ Prog);
|
||||
+
|
||||
+ exit (E_BAD_ARG);
|
||||
+ }
|
||||
+ break;
|
||||
+#endif
|
||||
default:
|
||||
usage ();
|
||||
}
|
||||
@@ -975,14 +1000,16 @@ int main (int argc, char **argv)
|
||||
#endif
|
||||
|
||||
#ifdef WITH_SELINUX
|
||||
- if (is_selinux_enabled () > 0) {
|
||||
- const char *args[5];
|
||||
- args[0] = "/usr/sbin/semanage";
|
||||
- args[1] = "login";
|
||||
- args[2] = "-d";
|
||||
- args[3] = user_name;
|
||||
- args[4] = NULL;
|
||||
- safe_system (args[0], args, NULL, 1);
|
||||
+ if (Zflg) {
|
||||
+ if (is_selinux_enabled () > 0) {
|
||||
+ const char *args[5];
|
||||
+ args[0] = "/usr/sbin/semanage";
|
||||
+ args[1] = "login";
|
||||
+ args[2] = "-d";
|
||||
+ args[3] = user_name;
|
||||
+ args[4] = NULL;
|
||||
+ safe_system (args[0], args, NULL, 1);
|
||||
+ }
|
||||
}
|
||||
#endif
|
||||
|
||||
diff -up shadow-4.1.4.3/src/usermod.c.semange shadow-4.1.4.3/src/usermod.c
|
||||
--- shadow-4.1.4.3/src/usermod.c.semange 2011-02-13 18:58:16.000000000 +0100
|
||||
+++ shadow-4.1.4.3/src/usermod.c 2011-08-02 12:57:47.989838125 +0200
|
||||
@@ -82,6 +82,9 @@
|
||||
#define E_GRP_UPDATE 10 /* can't update group file */
|
||||
/* #define E_NOSPACE 11 insufficient space to move home dir */
|
||||
#define E_HOMEDIR 12 /* unable to complete home dir move */
|
||||
+#define E_SE_UPDATE 13 /* can't update SELinux user mapping */
|
||||
+
|
||||
+
|
||||
#define VALID(s) (strcspn (s, ":\n") == strlen (s))
|
||||
/*
|
||||
* Global variables
|
||||
@@ -151,9 +154,6 @@ static void date_to_str (char *buf, size
|
||||
static int get_groups (char *);
|
||||
static void usage (void);
|
||||
static void new_pwent (struct passwd *);
|
||||
-#ifdef WITH_SELINUX
|
||||
-static void selinux_update_mapping (void);
|
||||
-#endif
|
||||
|
||||
static void new_spent (struct spwd *);
|
||||
static void fail_exit (int);
|
||||
@@ -1785,8 +1785,32 @@ int main (int argc, char **argv)
|
||||
nscd_flush_cache ("group");
|
||||
|
||||
#ifdef WITH_SELINUX
|
||||
- if (Zflg) {
|
||||
- selinux_update_mapping ();
|
||||
+ if (Zflg && *user_selinux) {
|
||||
+ if (is_selinux_enabled () > 0) {
|
||||
+ const char *argv[7];
|
||||
+
|
||||
+ argv[0] = "/usr/sbin/semanage";
|
||||
+ argv[1] = "login";
|
||||
+ argv[2] = "-m";
|
||||
+ argv[3] = "-s";
|
||||
+ argv[4] = user_selinux;
|
||||
+ argv[5] = user_name;
|
||||
+ argv[6] = NULL;
|
||||
+ if (safe_system (argv[0], argv, NULL, 1)) {
|
||||
+ argv[2] = "-a";
|
||||
+ if (safe_system (argv[0], argv, NULL, 0)) {
|
||||
+ fprintf (stderr,
|
||||
+ _("%s: warning: the user name %s to %s SELinux user mapping failed.\n"),
|
||||
+ Prog, user_name, user_selinux);
|
||||
+ #ifdef WITH_AUDIT
|
||||
+ audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
|
||||
+ "modifying User mapping ",
|
||||
+ user_name, (unsigned int) user_id, 0);
|
||||
+ #endif
|
||||
+ fail_exit (E_SE_UPDATE);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1816,34 +1840,3 @@ int main (int argc, char **argv)
|
||||
return E_SUCCESS;
|
||||
}
|
||||
|
||||
-#ifdef WITH_SELINUX
|
||||
-static void selinux_update_mapping (void) {
|
||||
- const char *argv[7];
|
||||
-
|
||||
- if (is_selinux_enabled () <= 0) return;
|
||||
-
|
||||
- if (*user_selinux) {
|
||||
- argv[0] = "/usr/sbin/semanage";
|
||||
- argv[1] = "login";
|
||||
- argv[2] = "-m";
|
||||
- argv[3] = "-s";
|
||||
- argv[4] = user_selinux;
|
||||
- argv[5] = user_name;
|
||||
- argv[6] = NULL;
|
||||
- if (safe_system (argv[0], argv, NULL, 1)) {
|
||||
- argv[2] = "-a";
|
||||
- if (safe_system (argv[0], argv, NULL, 0)) {
|
||||
- fprintf (stderr,
|
||||
- _("%s: warning: the user name %s to %s SELinux user mapping failed.\n"),
|
||||
- Prog, user_name, user_selinux);
|
||||
-#ifdef WITH_AUDIT
|
||||
- audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
|
||||
- "modifying User mapping ",
|
||||
- user_name, (unsigned int) user_id, 0);
|
||||
-#endif
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
-}
|
||||
-#endif
|
||||
-
|
||||
23
shadow-4.1.4.3-uflg.patch
Normal file
23
shadow-4.1.4.3-uflg.patch
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
diff -up shadow-4.1.4.3/libmisc/find_new_gid.c.uflg shadow-4.1.4.3/libmisc/find_new_gid.c
|
||||
--- shadow-4.1.4.3/libmisc/find_new_gid.c.uflg 2011-05-20 21:18:24.474018778 +0200
|
||||
+++ shadow-4.1.4.3/libmisc/find_new_gid.c 2011-05-20 21:18:43.178018729 +0200
|
||||
@@ -61,7 +61,7 @@ int find_new_gid (bool sys_group,
|
||||
gid_min = (gid_t) getdef_ulong ("GID_MIN", 1000UL);
|
||||
gid_max = (gid_t) getdef_ulong ("GID_MAX", 60000UL);
|
||||
} else {
|
||||
- gid_min = (gid_t) getdef_ulong ("SYS_GID_MIN", 101UL);
|
||||
+ gid_min = (gid_t) 1;
|
||||
gid_max = (gid_t) getdef_ulong ("GID_MIN", 1000UL) - 1;
|
||||
gid_max = (gid_t) getdef_ulong ("SYS_GID_MAX", (unsigned long) gid_max);
|
||||
}
|
||||
@@ -80,6 +80,10 @@ int find_new_gid (bool sys_group,
|
||||
return 0;
|
||||
}
|
||||
|
||||
+ /* if we did not find free preffered system gid, we start to look for
|
||||
+ * one in the range assigned to dynamic system IDs */
|
||||
+ if (sys_group)
|
||||
+ gid_min = (gid_t) getdef_ulong ("SYS_GID_MIN", 101UL);
|
||||
|
||||
/*
|
||||
* Search the entire group file,
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 1990 - 1994, Julianne Frances Haugh
|
||||
* Copyright (c) 1996 - 2000, Marek Michałkiewicz
|
||||
* Copyright (c) 2000 - 2006, Tomasz Kłoczko
|
||||
* Copyright (c) 2007 - 2011, Nicolas François
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the copyright holders or contributors may not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
<!--
|
||||
Copyright (c) 1991 - 1993, Julianne Frances Haugh
|
||||
Copyright (c) 1991 - 1993, Chip Rosenthal
|
||||
Copyright (c) 2007 - 2009, Nicolas François
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. The name of the copyright holders or contributors may not be used to
|
||||
endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
<varlistentry>
|
||||
<term><option>HOME_MODE</option> (number)</term>
|
||||
<listitem>
|
||||
<para>
|
||||
The mode for new home directories. If not specified,
|
||||
the <option>UMASK</option> is used to create the mode.
|
||||
</para>
|
||||
<para>
|
||||
<command>useradd</command> and <command>newusers</command> use this
|
||||
to set the mode of the home directory they create.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
@ -6,121 +6,15 @@
|
|||
# /etc/pam.d/system-auth for more information.
|
||||
#
|
||||
|
||||
#
|
||||
# Delay in seconds before being allowed another attempt after a login failure
|
||||
# Note: When PAM is used, some modules may enforce a minimum delay (e.g.
|
||||
# pam_unix(8) enforces a 2s delay)
|
||||
#
|
||||
#FAIL_DELAY 3
|
||||
|
||||
# Currently FAILLOG_ENAB is not supported
|
||||
|
||||
#
|
||||
# Enable display of unknown usernames when login(1) failures are recorded.
|
||||
#
|
||||
#LOG_UNKFAIL_ENAB no
|
||||
|
||||
# Currently LOG_OK_LOGINS is not supported
|
||||
|
||||
# Currently LASTLOG_ENAB is not supported
|
||||
|
||||
#
|
||||
# Limit the highest user ID number for which the lastlog entries should
|
||||
# be updated.
|
||||
#
|
||||
# No LASTLOG_UID_MAX means that there is no user ID limit for writing
|
||||
# lastlog entries.
|
||||
#
|
||||
#LASTLOG_UID_MAX
|
||||
|
||||
# Currently MAIL_CHECK_ENAB is not supported
|
||||
|
||||
# Currently OBSCURE_CHECKS_ENAB is not supported
|
||||
|
||||
# Currently PORTTIME_CHECKS_ENAB is not supported
|
||||
|
||||
# Currently QUOTAS_ENAB is not supported
|
||||
|
||||
# Currently SYSLOG_SU_ENAB is not supported
|
||||
|
||||
#
|
||||
# Enable "syslog" logging of newgrp(1) and sg(1) activity.
|
||||
#
|
||||
#SYSLOG_SG_ENAB yes
|
||||
|
||||
# Currently CONSOLE is not supported
|
||||
|
||||
# Currently SULOG_FILE is not supported
|
||||
|
||||
# Currently MOTD_FILE is not supported
|
||||
|
||||
# Currently ISSUE_FILE is not supported
|
||||
|
||||
# Currently TTYTYPE_FILE is not supported
|
||||
|
||||
# Currently FTMP_FILE is not supported
|
||||
|
||||
# Currently NOLOGINS_FILE is not supported
|
||||
|
||||
# Currently SU_NAME is not supported
|
||||
|
||||
# *REQUIRED*
|
||||
# Directory where mailboxes reside, _or_ name of file, relative to the
|
||||
# home directory. If you _do_ define both, MAIL_DIR takes precedence.
|
||||
# QMAIL_DIR is for Qmail
|
||||
#
|
||||
#QMAIL_DIR Maildir
|
||||
MAIL_DIR /var/spool/mail
|
||||
#MAIL_FILE .mail
|
||||
|
||||
#
|
||||
# If defined, file which inhibits all the usual chatter during the login
|
||||
# sequence. If a full pathname, then hushed mode will be enabled if the
|
||||
# user's name or shell are found in the file. If not a full pathname, then
|
||||
# hushed mode will be enabled if the file exists in the user's home directory.
|
||||
#
|
||||
#HUSHLOGIN_FILE .hushlogin
|
||||
#HUSHLOGIN_FILE /etc/hushlogins
|
||||
|
||||
# Currently ENV_TZ is not supported
|
||||
|
||||
# Currently ENV_HZ is not supported
|
||||
|
||||
#
|
||||
# The default PATH settings, for superuser and normal users.
|
||||
#
|
||||
# (they are minimal, add the rest in the shell startup files)
|
||||
#ENV_SUPATH PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
#ENV_PATH PATH=/bin:/usr/bin
|
||||
|
||||
#
|
||||
# Terminal permissions
|
||||
#
|
||||
# TTYGROUP Login tty will be assigned this group ownership.
|
||||
# TTYPERM Login tty will be set to this permission.
|
||||
#
|
||||
# If you have a write(1) program which is "setgid" to a special group
|
||||
# which owns the terminals, define TTYGROUP as the number of such group
|
||||
# and TTYPERM as 0620. Otherwise leave TTYGROUP commented out and
|
||||
# set TTYPERM to either 622 or 600.
|
||||
#
|
||||
#TTYGROUP tty
|
||||
#TTYPERM 0600
|
||||
|
||||
# Currently ERASECHAR, KILLCHAR and ULIMIT are not supported
|
||||
|
||||
# Default initial "umask" value used by login(1) on non-PAM enabled systems.
|
||||
# Default "umask" value for pam_umask(8) on PAM enabled systems.
|
||||
# UMASK is also used by useradd(8) and newusers(8) to set the mode for new
|
||||
# home directories if HOME_MODE is not set.
|
||||
# 022 is the default value, but 027, or even 077, could be considered
|
||||
# for increased privacy. There is no One True Answer here: each sysadmin
|
||||
# must make up their mind.
|
||||
UMASK 022
|
||||
|
||||
# HOME_MODE is used by useradd(8) and newusers(8) to set the mode for new
|
||||
# home directories.
|
||||
# If HOME_MODE is not set, the value of UMASK is used to create the mode.
|
||||
HOME_MODE 0700
|
||||
|
||||
# Password aging controls:
|
||||
#
|
||||
# PASS_MAX_DAYS Maximum number of days a password may be used.
|
||||
|
|
@ -130,142 +24,26 @@ HOME_MODE 0700
|
|||
#
|
||||
PASS_MAX_DAYS 99999
|
||||
PASS_MIN_DAYS 0
|
||||
PASS_MIN_LEN 8
|
||||
PASS_MIN_LEN 5
|
||||
PASS_WARN_AGE 7
|
||||
|
||||
# Currently SU_WHEEL_ONLY is not supported
|
||||
|
||||
# Currently CRACKLIB_DICTPATH is not supported
|
||||
|
||||
#
|
||||
# Min/max values for automatic uid selection in useradd(8)
|
||||
# Min/max values for automatic uid selection in useradd
|
||||
#
|
||||
UID_MIN 1000
|
||||
UID_MAX 60000
|
||||
# System accounts
|
||||
SYS_UID_MIN 201
|
||||
SYS_UID_MAX 999
|
||||
# Extra per user uids
|
||||
SUB_UID_MIN 524288
|
||||
SUB_UID_MAX 600100000
|
||||
SUB_UID_COUNT 65536
|
||||
|
||||
#
|
||||
# Min/max values for automatic gid selection in groupadd(8)
|
||||
# Min/max values for automatic gid selection in groupadd
|
||||
#
|
||||
GID_MIN 1000
|
||||
GID_MAX 60000
|
||||
# System accounts
|
||||
SYS_GID_MIN 201
|
||||
SYS_GID_MAX 999
|
||||
# Extra per user group ids
|
||||
SUB_GID_MIN 524288
|
||||
SUB_GID_MAX 600100000
|
||||
SUB_GID_COUNT 65536
|
||||
|
||||
#
|
||||
# Max number of login(1) retries if password is bad
|
||||
#
|
||||
#LOGIN_RETRIES 3
|
||||
|
||||
#
|
||||
# Max time in seconds for login(1)
|
||||
#
|
||||
#LOGIN_TIMEOUT 60
|
||||
|
||||
#
|
||||
# Maximum number of attempts to change password if rejected (too easy)
|
||||
#
|
||||
PASS_CHANGE_TRIES 5
|
||||
|
||||
#
|
||||
# Warn about weak passwords (but still allow them) if you are root.
|
||||
#
|
||||
PASS_ALWAYS_WARN yes
|
||||
|
||||
#
|
||||
# Number of significant characters in the password for crypt().
|
||||
# Default is 8, don't change unless your crypt() is better.
|
||||
# Ignored if MD5_CRYPT_ENAB set to "yes".
|
||||
#
|
||||
#PASS_MAX_LEN 8
|
||||
|
||||
# Currently CHFN_AUTH is not supported
|
||||
|
||||
#
|
||||
# Which fields may be changed by regular users using chfn(1) - use
|
||||
# any combination of letters "frwh" (full name, room number, work
|
||||
# phone, home phone). If not defined, no changes are allowed.
|
||||
# For backward compatibility, "yes" = "rwh" and "no" = "frwh".
|
||||
#
|
||||
#CHFN_RESTRICT rwh
|
||||
|
||||
# Currently LOGIN_STRING is not supported
|
||||
|
||||
# Currently MD5_CRYPT_ENAB is not supported
|
||||
|
||||
#
|
||||
# If set to MD5, MD5-based algorithm will be used for encrypting password
|
||||
# If set to SHA256, SHA256-based algorithm will be used for encrypting password
|
||||
# If set to SHA512, SHA512-based algorithm will be used for encrypting password
|
||||
# If set to BCRYPT, BCRYPT-based algorithm will be used for encrypting password
|
||||
# If set to YESCRYPT, YESCRYPT-based algorithm will be used for encrypting password
|
||||
# If set to DES, DES-based algorithm will be used for encrypting password (default)
|
||||
#
|
||||
ENCRYPT_METHOD YESCRYPT
|
||||
|
||||
#
|
||||
# Only works if ENCRYPT_METHOD is set to SHA256 or SHA512.
|
||||
#
|
||||
# Define the number of SHA rounds.
|
||||
# With a lot of rounds, it is more difficult to brute-force the password.
|
||||
# However, more CPU resources will be needed to authenticate users if
|
||||
# this value is increased.
|
||||
#
|
||||
# If not specified, the libc will choose the default number of rounds (5000).
|
||||
# The values must be within the 1000-999999999 range.
|
||||
#
|
||||
#SHA_CRYPT_MAX_ROUNDS 5000
|
||||
|
||||
# Currently SHA_CRYPT_MIN_ROUNDS is not supported
|
||||
|
||||
#
|
||||
# Only works if ENCRYPT_METHOD is set to BCRYPT.
|
||||
#
|
||||
# Define the number of BCRYPT rounds.
|
||||
# With a lot of rounds, it is more difficult to brute-force the password.
|
||||
# However, more CPU resources will be needed to authenticate users if
|
||||
# this value is increased.
|
||||
#
|
||||
# If not specified, 13 rounds will be attempted.
|
||||
# If only one of the MIN or MAX values is set, then this value will be used.
|
||||
# If MIN > MAX, the highest value will be used.
|
||||
#
|
||||
#BCRYPT_MIN_ROUNDS 13
|
||||
#BCRYPT_MAX_ROUNDS 31
|
||||
|
||||
#
|
||||
# Only works if ENCRYPT_METHOD is set to YESCRYPT.
|
||||
#
|
||||
# Define the YESCRYPT cost factor.
|
||||
# With a higher cost factor, it is more difficult to brute-force the password.
|
||||
# However, more CPU time and more memory will be needed to authenticate users
|
||||
# if this value is increased.
|
||||
#
|
||||
# If not specified, a cost factor of 5 will be used.
|
||||
# The value must be within the 1-11 range.
|
||||
#
|
||||
#YESCRYPT_COST_FACTOR 5
|
||||
|
||||
# Currently CONSOLE_GROUPS is not supported
|
||||
|
||||
#
|
||||
# Should login be allowed if we can't cd to the home directory?
|
||||
# Default is yes.
|
||||
#
|
||||
#DEFAULT_HOME yes
|
||||
|
||||
# Currently ENVIRON_FILE is not supported
|
||||
|
||||
#
|
||||
# If defined, this command is run when removing a user.
|
||||
|
|
@ -275,41 +53,20 @@ ENCRYPT_METHOD YESCRYPT
|
|||
#USERDEL_CMD /usr/sbin/userdel_local
|
||||
|
||||
#
|
||||
# Enables userdel(8) to remove user groups if no members exist.
|
||||
#
|
||||
USERGROUPS_ENAB yes
|
||||
|
||||
#
|
||||
# If set to a non-zero number, the shadow utilities will make sure that
|
||||
# groups never have more than this number of users on one line.
|
||||
# This permits to support split groups (groups split into multiple lines,
|
||||
# with the same group ID, to avoid limitation of the line length in the
|
||||
# group file).
|
||||
#
|
||||
# 0 is the default value and disables this feature.
|
||||
#
|
||||
#MAX_MEMBERS_PER_GROUP 0
|
||||
|
||||
#
|
||||
# If useradd(8) should create home directories for users by default (non
|
||||
# system users only).
|
||||
# This option is overridden with the -M or -m flags on the useradd(8)
|
||||
# command-line.
|
||||
# If useradd should create home directories for users by default
|
||||
# On RH systems, we do. This option is overridden with the -m flag on
|
||||
# useradd command line.
|
||||
#
|
||||
CREATE_HOME yes
|
||||
|
||||
#
|
||||
# Force use shadow, even if shadow passwd & shadow group files are
|
||||
# missing.
|
||||
#
|
||||
#FORCE_SHADOW yes
|
||||
# The permission mask is initialized to this value. If not specified,
|
||||
# the permission mask will be initialized to 022.
|
||||
UMASK 077
|
||||
|
||||
# This enables userdel to remove user groups if no members exist.
|
||||
#
|
||||
# Select the HMAC cryptography algorithm.
|
||||
# Used in pam_timestamp module to calculate the keyed-hash message
|
||||
# authentication code.
|
||||
#
|
||||
# Note: It is recommended to check hmac(3) to see the possible algorithms
|
||||
# that are available in your system.
|
||||
#
|
||||
HMAC_CRYPTO_ALGO SHA512
|
||||
USERGROUPS_ENAB yes
|
||||
|
||||
# Use SHA512 to encrypt password.
|
||||
ENCRYPT_METHOD SHA512
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
3
sources
3
sources
|
|
@ -1,2 +1 @@
|
|||
SHA512 (shadow-4.20.0.tar.xz) = 0b8afded372e4d37a78f38cb972c0ab877870ef6356cdd1c45be3c708af3d1496c6f87de6bf6a5b1d217d4d52d7e2d15c28b26530949cc6de0231a4028930406
|
||||
SHA512 (shadow-4.20.0.tar.xz.asc) = e4b134543768f323df30a1e450c22086d013020928d62bd3207db7f633beea3587b67802da5b575d5a794e8c2bebd7a0abeba6ed69d44bf08adc37df3bf352ac
|
||||
b8608d8294ac88974f27b20f991c0e79 shadow-4.1.4.3.tar.bz2
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
provisioned_topologies:
|
||||
- shadow
|
||||
domains:
|
||||
- id: shadow
|
||||
hosts:
|
||||
- hostname: localhost
|
||||
role: shadow
|
||||
conn:
|
||||
type: ssh
|
||||
host: localhost
|
||||
user: root
|
||||
artifacts:
|
||||
- /var/log/*
|
||||
Loading…
Add table
Add a link
Reference in a new issue