Bug 475895 - Disallow creation of an initial login shell
Summary: Disallow creation of an initial login shell
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Dogtag Certificate System
Classification: Retired
Component: Installer (pkicreate/pkiremove)
Version: 1.0
Hardware: All
OS: All
high
medium
Target Milestone: ---
Assignee: Matthew Harmsen
QA Contact: Chandrasekar Kannan
URL:
Whiteboard:
Depends On:
Blocks: 445047
TreeView+ depends on / blocked
 
Reported: 2008-12-10 23:01 UTC by Matthew Harmsen
Modified: 2015-01-06 01:16 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-04 19:59:52 UTC
Embargoed:


Attachments (Terms of Use)
Spec File Changes (16.42 KB, text/plain)
2008-12-11 18:54 UTC, Matthew Harmsen
no flags Details
Dogtag spec file changes (16.42 KB, text/plain)
2008-12-12 00:44 UTC, Matthew Harmsen
no flags Details
CS/IPA TIP changes for "base" (331.99 KB, patch)
2010-01-12 01:28 UTC, Matthew Harmsen
no flags Details | Diff
CS/IPA TIP changes for "dogtag" (12.00 KB, patch)
2010-01-12 01:29 UTC, Matthew Harmsen
no flags Details | Diff
RHCS 8.1.0 TIP changes for "base" (2.59 KB, patch)
2010-01-12 01:31 UTC, Matthew Harmsen
no flags Details | Diff
RHCS 8.1.0 TIP changes for "dogtag" (1023 bytes, patch)
2010-01-12 01:32 UTC, Matthew Harmsen
no flags Details | Diff
CS/IPA TIP changes for "dogtag" (13.35 KB, patch)
2010-01-12 22:16 UTC, Matthew Harmsen
no flags Details | Diff

Description Matthew Harmsen 2008-12-10 23:01:04 UTC
Paramaterize the initial login shell for the defined %{base_user} by creating a %{base_login_shell}.

Comment 1 Matthew Harmsen 2008-12-11 18:54:28 UTC
Created attachment 326647 [details]
Spec File Changes

Comment 3 Jack Magne 2008-12-11 19:28:31 UTC
Attachment (id=326647) +jmagne.

Comment 5 Matthew Harmsen 2008-12-12 00:44:23 UTC
Created attachment 326693 [details]
Dogtag spec file changes

Comment 7 Jack Magne 2008-12-12 00:53:40 UTC
Attachment (id=326693) +jmagne.

Comment 9 Matthew Harmsen 2008-12-12 01:04:57 UTC
svn status | grep -v ^$ | grep -v ^P | grep -v ^X | grep -v ^?
M      dogtag/ca/pki-ca.spec
M      dogtag/tks/pki-tks.spec
M      dogtag/ra/pki-ra.spec
M      dogtag/ocsp/pki-ocsp.spec
M      dogtag/tps/pki-tps.spec
M      dogtag/kra/pki-kra.spec

svn commit
Sending        dogtag/ca/pki-ca.spec
Sending        dogtag/kra/pki-kra.spec
Sending        dogtag/ocsp/pki-ocsp.spec
Sending        dogtag/ra/pki-ra.spec
Sending        dogtag/tks/pki-tks.spec
Sending        dogtag/tps/pki-tps.spec
Transmitting file data ......
Committed revision 167.

Comment 11 Matthew Harmsen 2008-12-17 03:14:45 UTC
While these checks were made to disallow the creation of an initial login shell, some logic must be added to "pkicreate" (and "pkicommon") to check for this same issue when users specify their own "pki_user" and/or "pki_group" via the "pkicreate" instance creation script.

Comment 13 Matthew Harmsen 2010-01-12 01:28:05 UTC
Created attachment 383136 [details]
CS/IPA TIP changes for "base"

These base 'diffs' apply to the following CS/IPA bugs:
* Bugzilla Bug #475895 - Disallow creation of an initial login shell
* Bugzilla Bug #512234 - Move pkiuser:pkiuser check from spec file into pkicreate . . .
* Bugzilla Bug #547471 - Apply PKI SELinux changes to PKI registry model
* Bugzilla Bug #553072 - Apply "registry" logic to pki-kra . . .
* Bugzilla Bug #553074 - Apply "registry" logic to pki-ocsp . . .
* Bugzilla Bug #553075 - Apply "registry" logic to pki-tks . . .

Comment 14 Matthew Harmsen 2010-01-12 01:29:32 UTC
Created attachment 383137 [details]
CS/IPA TIP changes for "dogtag"

These dogtag 'diffs' apply to the following CS/IPA bugs:
* Bugzilla Bug #475895 - Disallow creation of an initial login shell
* Bugzilla Bug #512234 - Move pkiuser:pkiuser check from spec file into pkicreate . . .
* Bugzilla Bug #547471 - Apply PKI SELinux changes to PKI registry model
* Bugzilla Bug #553072 - Apply "registry" logic to pki-kra . . .
* Bugzilla Bug #553074 - Apply "registry" logic to pki-ocsp . . .
* Bugzilla Bug #553075 - Apply "registry" logic to pki-tks . . .

Comment 15 Matthew Harmsen 2010-01-12 01:31:07 UTC
Created attachment 383138 [details]
RHCS 8.1.0 TIP changes for "base"

These base 'diffs' apply to the following RHCS 8.1.0 bugs:
* Bugzilla Bug #475895 - Disallow creation of an initial login shell
* Bugzilla Bug #512234 - Move pkiuser:pkiuser check from spec file into pkicreate . . .

Comment 16 Matthew Harmsen 2010-01-12 01:32:04 UTC
Created attachment 383139 [details]
RHCS 8.1.0 TIP changes for "dogtag"

These dogtag 'diffs' apply to the following RHCS 8.1.0 bugs:
* Bugzilla Bug #475895 - Disallow creation of an initial login shell
* Bugzilla Bug #512234 - Move pkiuser:pkiuser check from spec file into pkicreate . . .

Comment 18 Ade Lee 2010-01-12 21:17:07 UTC
https://bugzilla.redhat.com/attachment.cgi?id=383136 alee+

https://bugzilla.redhat.com/attachment.cgi?id=383138 alee+ 

https://bugzilla.redhat.com/attachment.cgi?id=383139 alee+
 
https://bugzilla.redhat.com/attachment.cgi?id=383137  

The device "||:" in the scriptlets is used incorrectly.  According to https://fedoraproject.org/wiki/Packaging:ScriptletSnippets:

Except in some really exceptional cases (if any), we want all scriptlets to exit with the zero exit status. Because rpm in its default configuration does not at the moment execute shell scriptlets with the -e argument to the shell, excluding explicit exit calls (frowned upon with a non-zero argument!), the exit status of the last command in a scriptlet determines its exit status. Most commands in the snippets in this document have a "|| :" appended to them, which is a generic trick to force the zero exit status for those commands whether they worked or not. Usually the most important bit is to apply this to the last command executed in a scriptlet, or to add a separate command such as plain ":" or "exit 0" as the last one in a scriptlet.

In the patch provided, the "||:" is appended to some some commands in the scriptlets where it is not the last command.  Also, some scriptlets do not include "||:" on the last command.

Comment 20 Matthew Harmsen 2010-01-12 22:16:26 UTC
Created attachment 383354 [details]
CS/IPA TIP changes for "dogtag"

These dogtag 'diffs' apply to the following CS/IPA bugs:
* Bugzilla Bug #475895 - Disallow creation of an initial login shell
* Bugzilla Bug #512234 - Move pkiuser:pkiuser check from spec file into
pkicreate . . .
* Bugzilla Bug #547471 - Apply PKI SELinux changes to PKI registry model
* Bugzilla Bug #553072 - Apply "registry" logic to pki-kra . . .
* Bugzilla Bug #553074 - Apply "registry" logic to pki-ocsp . . .
* Bugzilla Bug #553075 - Apply "registry" logic to pki-tks . . .
* Corrected "|| :" scriptlet logic

Comment 21 Ade Lee 2010-01-12 22:19:32 UTC
https://bugzilla.redhat.com/attachment.cgi?id=383354 alee +

Comment 22 Matthew Harmsen 2010-01-12 22:51:26 UTC
CS/IPA TIP:

# cd pki/base

# svn status | grep -v ^$ | grep -v ^P | grep -v ^X | grep -v ^?
M       selinux/src/pki.if
M       selinux/src/pki.fc
M       selinux/src/pki.te
M       setup/pkicreate
M       setup/pkicommon
D       tks/setup/postinstall
D       tks/shared/etc/init.d/httpd
A       tks/shared/etc/init.d/pki-tksd
M       tks/build.xml
D       ocsp/setup/postinstall
D       ocsp/shared/etc/init.d/httpd
A       ocsp/shared/etc/init.d/pki-ocspd
M       ocsp/build.xml
D       kra/setup/postinstall
A       kra/shared/etc/init.d/pki-krad
D       kra/shared/etc/init.d/httpd
M       kra/build.xml

# svn commit
Sending        base/kra/build.xml
Deleting       base/kra/setup/postinstall
Deleting       base/kra/shared/etc/init.d/httpd
Adding         base/kra/shared/etc/init.d/pki-krad
Sending        base/ocsp/build.xml
Deleting       base/ocsp/setup/postinstall
Deleting       base/ocsp/shared/etc/init.d/httpd
Adding         base/ocsp/shared/etc/init.d/pki-ocspd
Sending        base/selinux/src/pki.fc
Sending        base/selinux/src/pki.if
Sending        base/selinux/src/pki.te
Sending        base/setup/pkicommon
Sending        base/setup/pkicreate
Sending        base/tks/build.xml
Deleting       base/tks/setup/postinstall
Deleting       base/tks/shared/etc/init.d/httpd
Adding         base/tks/shared/etc/init.d/pki-tksd
Transmitting file data ...........
Committed revision 908.


# cd pki/dogtag

# svn status | grep -v ^$ | grep -v ^P | grep -v ^X | grep -v ^?
M       ca/pki-ca.spec
M       selinux/pki-selinux.spec
M       setup/pki-setup.spec
M       tks/pki-tks.spec
M       ocsp/pki-ocsp.spec
M       kra/pki-kra.spec

# svn commit
Sending        dogtag/ca/pki-ca.spec
Sending        dogtag/kra/pki-kra.spec
Sending        dogtag/ocsp/pki-ocsp.spec
Sending        dogtag/selinux/pki-selinux.spec
Sending        dogtag/setup/pki-setup.spec
Sending        dogtag/tks/pki-tks.spec
Transmitting file data ......
Committed revision 909.

Comment 23 Matthew Harmsen 2010-01-12 23:00:25 UTC
RHCS 8.1 TIP:

# cd pki/base

# svn status | grep -v ^$ | grep -v ^P | grep -v ^X | grep -v ^?
M       setup/pkicreate
M       setup/pkicommon

# svn commit
Sending        base/setup/pkicommon
Sending        base/setup/pkicreate
Transmitting file data ..
Committed revision 910.

# cd pki/dogtag

# svn status | grep -v ^$ | grep -v ^P | grep -v ^X | grep -v ^?
M       setup/pki-setup.spec

# svn commit
Sending        dogtag/setup/pki-setup.spec
Transmitting file data .
Committed revision 911.

Comment 25 Fedora Update System 2010-01-14 02:19:38 UTC
pki-setup-1.3.1-1.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/pki-setup-1.3.1-1.fc11

Comment 26 Fedora Update System 2010-01-14 02:29:04 UTC
pki-setup-1.3.1-1.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/pki-setup-1.3.1-1.fc12

Comment 27 Fedora Update System 2010-01-14 21:46:25 UTC
pki-ca-1.3.0-7.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/pki-ca-1.3.0-7.fc11

Comment 28 Fedora Update System 2010-01-14 22:29:25 UTC
pki-ca-1.3.0-7.el5 has been submitted as an update for Fedora EPEL 5.
http://admin.fedoraproject.org/updates/pki-ca-1.3.0-7.el5

Comment 29 Fedora Update System 2010-01-14 22:31:44 UTC
pki-ca-1.3.0-7.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/pki-ca-1.3.0-7.fc12

Comment 30 Fedora Update System 2010-01-14 23:58:42 UTC
pki-setup-1.3.1-1.el5 has been submitted as an update for Fedora EPEL 5.
http://admin.fedoraproject.org/updates/pki-setup-1.3.1-1.el5

Comment 31 Fedora Update System 2010-01-15 22:06:14 UTC
pki-setup-1.3.1-1.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 32 Fedora Update System 2010-01-15 22:17:53 UTC
pki-ca-1.3.0-7.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 33 Fedora Update System 2010-02-03 20:04:22 UTC
pki-ca-1.3.0-7.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 34 Fedora Update System 2010-02-22 22:37:46 UTC
pki-setup-1.3.1-1.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.