Discussion:
How to repair /etc/pam.conf
James Litchfield
2013-03-18 19:03:12 UTC
Permalink
Through some mysterious process, I have ended up with a
zero length /etc/pam.conf.

The intriguing thing is how do I rectify this situation?

I can find the file in the package, I can do a pkg fix on the
package that contains it and I still end up with what I had before.
One possibility is that it gets built on the fly?

This does bring up a question: how does one extract a
single file from a package in a supported manner?

Jim
----
pkg search /etc/pam.conf
INDEX ACTION VALUE PACKAGE
Unable to retrieve requested package data for publisher extra; no
repositories are currently configured for use with this publisher.
Verifying: pkg://solaris/system/core-os ERROR
dir: export
Group: 'staff (10)' should be 'sys (3)'
dir: var/share
Group: 'root (0)' should be 'sys (3)'
file: lib/svc/method/svc-nscd
Size: 2757 bytes should be 2754
Hash: 6d53b9780d2d5445655a9c16bd5cb72845acebdc should be
b9402ddf9dd004a96ba2437478915408ee6c23d1
file: etc/shadow
Group: 'root (0)' should be 'sys (3)'
file: etc/inittab
Group: 'root (0)' should be 'sys (3)'
file: etc/nsswitch.conf
Group: 'root (0)' should be 'sys (3)'
file: etc/pam.conf
Group: 'root (0)' should be 'sys (3)'
file: etc/profile
Group: 'root (0)' should be 'sys (3)'
file: etc/rpc
Group: 'root (0)' should be 'sys (3)'
file: var/spool/cron/crontabs/root
Group: 'root (0)' should be 'sys (3)'
file: etc/default/init
Group: 'root (0)' should be 'sys (3)'
file: etc/default/login
Group: 'root (0)' should be 'sys (3)'
file: usr/lib/python2.6/vendor-packages/nss/__init__.pyc
Group: 'root (0)' should be 'bin (2)'
Size: 2007 bytes should be 1949
Hash: 7db6616f5645d3bc2317726bc79476e82cf1cc08 should be
dbcc12beb2b81b89de5ef6cd714daeac1d900071
file: usr/lib/python2.6/vendor-packages/nss/dns.pyc
Group: 'root (0)' should be 'bin (2)'
Size: 8628 bytes should be 8361
Hash: 96b42e718612d18d65fe8a325be09f7dfa10147f should be
d582ea7999a618f7115971fdfd11e682b1c89fd4
file: usr/lib/python2.6/vendor-packages/nss/files.pyc
Group: 'root (0)' should be 'bin (2)'
Size: 2056 bytes should be 1853
Hash: 121a9e8f210903ba5d5dc5d42857c9c61239218b should be
e20062833fe0c3c449bc9db9f0089e3b17f8c143
file: usr/lib/python2.6/vendor-packages/nss/ldap.pyc
Group: 'root (0)' should be 'bin (2)'
Size: 13115 bytes should be 12822
Hash: 8af2998a02a1bb915119c1a50e24cfd44130aef9 should be
5ca3f803df8dcdb6012941f24952ace32e150e04
file: usr/lib/python2.6/vendor-packages/nss/messages.pyc
Group: 'root (0)' should be 'bin (2)'
Size: 4443 bytes should be 4153
Hash: 43480d5cf09d99f6772ef70df26afa0eaf6a450c should be
36da9d1ef081b67649a42582c862ef28a1becab7
file: usr/lib/python2.6/vendor-packages/nss/nis.pyc
Group: 'root (0)' should be 'bin (2)'
Size: 18325 bytes should be 17070
Hash: 1a7f23ed6518e858f82a36d8a2558602e807ff5a should be
81a63377561a30385fbce40e02a697342d6149af
file: usr/lib/python2.6/vendor-packages/nss/nscd.pyc
Group: 'root (0)' should be 'bin (2)'
Size: 12821 bytes should be 12444
Hash: 2840a717b39019f704639fe30f9cabe65bb08817 should be
5e92488e6d0047d8394fc530c2125d7b210866c3
file: usr/lib/python2.6/vendor-packages/nss/nssbase.pyc
Group: 'root (0)' should be 'bin (2)'
Size: 28625 bytes should be 26972
Hash: ea89fb459b8a0405550a2f2c0382a565b7b1a3de should be
c853e58b69ea45594310654cae93cfb48ce24a8c
file: usr/lib/python2.6/vendor-packages/nss/nsswitch.pyc
Group: 'root (0)' should be 'bin (2)'
Size: 6801 bytes should be 6486
Hash: beb820422b80377b0c508fe9451751fe7534ff18 should be
51027f7152f900e8991f6e09850a203bb1a1688c
Created ZFS snapshot: 2013-03-18-18:53:19
Repairing: pkg://solaris/system/core-os
Creating Plan (Evaluating mediators): /
DOWNLOAD PKGS FILES XFER
(MB) SPEED
Completed 1/1 19/19
0.0/0.0 5.4k/s
PHASE ITEMS
Updating modified actions 21/21
Updating image state Done
Creating fast lookup database Done
# ls -l /etc/pam.conf
-rw-r--r-- 1 root sys 0 Aug 25 2012 /etc/pam.conf
Alan Coopersmith
2013-03-18 18:29:15 UTC
Permalink
Post by James Litchfield
Through some mysterious process, I have ended up with a
zero length /etc/pam.conf.
The intriguing thing is how do I rectify this situation?
# pkg search /etc/pam.conf
INDEX ACTION VALUE PACKAGE
Since it's delivered with the "preserve=renamenew" attribute, look in
/etc/pam.conf.new for the packaged file, since pkg won't overwrite the
file you may have customized.

Though in this case, you may find it a bit anticlimatic, as the packaged
pam.conf file in that release is nothing but a comment telling you that
the contents have all moved to /etc/pam.d now.
--
-Alan Coopersmith- ***@oracle.com
Oracle Solaris Engineering - http://blogs.oracle.com/alanc
Bart Smaalders
2013-03-18 22:52:19 UTC
Permalink
Post by Alan Coopersmith
Post by James Litchfield
Through some mysterious process, I have ended up with a
zero length /etc/pam.conf.
The intriguing thing is how do I rectify this situation?
# pkg search /etc/pam.conf
INDEX ACTION VALUE PACKAGE
Since it's delivered with the "preserve=renamenew" attribute, look in
/etc/pam.conf.new for the packaged file, since pkg won't overwrite the
file you may have customized.
Though in this case, you may find it a bit anticlimatic, as the packaged
pam.conf file in that release is nothing but a comment telling you that
the contents have all moved to /etc/pam.d now.
Had this been a real emergency, you could have restored the original
/etc/pam.conf with:

pkg revert /etc/pam.conf

From the fine man page:

pkg revert [-nv] [--no-be-activate] [--no-backup-be | --
require-backup-be] [--backup-be-name name] [--deny-new-be |
--require-new-be] [--be-name name] (--tagged tag-name ... |
path-to-file ...)

Revert files delivered by pkg(5) packages to their as-
delivered condition. File ownership and protections are
also restored.

Caution -

Reverting some editable files to their default values
can make the system unbootable, or cause other mal-
functions.

--tagged tag-name

Revert all files tagged with tag-name, and remove
any unpackaged files or directories matching pattern
in directories with this tag. See "File Actions" in
the pkg(5) manual page.


path-to-file

Revert the specified files.

For all other options, see the install command above.


- Bart
--
Bart Smaalders Solaris Core OS
***@oracle.com http://blogs.oracle.com/barts
"You will contribute more with Mercurial than with Thunderbird."
"Civilization advances by extending the number of important
operations which we can perform without thinking about them."
Alta Elstad
2013-03-18 23:07:45 UTC
Permalink
The information is also available under:

Fixing Package Problems > Restoring a File

http://docs.oracle.com/cd/E26502_01/html/E28984/gkoks.html#gijmp

Please let me know if you have corrections or other comments.

Loading...