You are not logged in.

#1 2012-06-24 13:02:15

hoschi
Member
From: Ulm (Germany)
Registered: 2008-11-03
Posts: 458

Upgrade of /etc/group and /etc/gshadow

Hello!
Today pacman told me, that it created /etc/group.pacnew and /etc/gshadow.pacnew, because my version differs (of course, maintainer can't know my username and my own groups...) from the new ones. Upgrading config files is normally not a problem, but this two files are "dangerous". What the best way to handle it?

I wonder if their is anywhere a general guide for upgrading this two files?
Hoschi

Offline

#2 2012-06-24 13:38:02

mloskot
Member
From: London, United Kingdom
Registered: 2012-06-01
Posts: 86
Website

Re: Upgrade of /etc/group and /etc/gshadow

1. Make a copy of your files (backup).
2. Compare your version with *.pacnew versions (e.g. vimdiff)
3. Inspect difference line by line to see what has changed.
4. Apply changes manually.

You will notice some groups have been removed added, so it will be quick & easy this time.

EDIT: Fixed my answer.

Last edited by mloskot (2012-06-24 13:48:24)


Mateusz Loskot | github | archlinux-config
Arch (x86-64) | ThinkPad T400  | Intel P8600| Intel i915
Arch (x86-64) | ThinkPad W700 | Intel T9600 | NVIDIA Quadro FX 2700M

Offline

#3 2012-06-24 13:43:39

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Upgrade of /etc/group and /etc/gshadow

Removed? No, we only added the 'lock' group.

Offline

#4 2012-06-24 13:46:48

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,541
Website

Re: Upgrade of /etc/group and /etc/gshadow

lock was all that seemed new to me.

There may be some groups in your current files that are absent in the pacnews, these would be groups that either you have added yourself, or have been added by other packages.  I had a couple of these - ntp is one example.  You almost certainly want to keep these, unless they were added for some service that you have subsequently removed.

Last edited by Trilby (2012-06-24 13:47:37)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2012-06-24 13:47:13

mloskot
Member
From: London, United Kingdom
Registered: 2012-06-01
Posts: 86
Website

Re: Upgrade of /etc/group and /etc/gshadow

falconindy wrote:

Removed? No, we only added the 'lock' group.

Yes, you are right. I missed the fact that I have some additional groups added by packages I installed (e.g. mysql), so the updated group.pacnew does not include them.

Last edited by mloskot (2012-06-24 13:48:56)


Mateusz Loskot | github | archlinux-config
Arch (x86-64) | ThinkPad T400  | Intel P8600| Intel i915
Arch (x86-64) | ThinkPad W700 | Intel T9600 | NVIDIA Quadro FX 2700M

Offline

#6 2012-06-24 13:47:58

Psykorgasm
Member
Registered: 2011-11-24
Posts: 177

Re: Upgrade of /etc/group and /etc/gshadow

I had quite a few removed (~5), lock was certainly added though.

Edit: @mloskot  -- I forgot about that, probably a good job I didnt bother merge, I'd have most likely been stupid and left stuff.

Last edited by Psykorgasm (2012-06-24 13:49:41)

Offline

#7 2012-06-24 14:24:21

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: Upgrade of /etc/group and /etc/gshadow

1.
In the new group file, lock was written like this:
lock:x:54:
But in gshadow it looks like this:
lock:::
I wonder why there is the "x" in group but none in gshadow.
Both files should be consistent.

2.
Also some applications use "!" instead of "x", when they add entries to the files.
Today i learned both signs have the same effect.

Offline

#8 2012-06-24 16:24:44

SolarBoyMatt
Member
Registered: 2012-01-07
Posts: 263

Re: Upgrade of /etc/group and /etc/gshadow

Wait, after I updated and checked my groups folder I already had a line that said "lock" in the original group file, and same goes for gshadow... I'm a little confused, why would I have it already?

Offline

#9 2012-06-24 20:30:30

root
Member
From: 127.0.0.1
Registered: 2012-04-13
Posts: 297

Re: Upgrade of /etc/group and /etc/gshadow

@SolarBoyMatt

See #4 for the reason why you already may have these lines wink

On my behalf I too wonder about what teateawhy points out in his first statement after reading it.

Also, on the basis of Trilby's reply, the groups that are added by other packages are they removed or do they stay when these are removed too? To some extent, again on the basis of Trilby's message, I understand that they stay but I prefer to be sure.


\(o_X)/
                        'Cause I wanna be an Archy - An Archy in the UK // Sex Pistols

Offline

#10 2012-06-26 18:03:09

hoschi
Member
From: Ulm (Germany)
Registered: 2008-11-03
Posts: 458

Re: Upgrade of /etc/group and /etc/gshadow

Thanks for your help. I will manually merge the new group into the both files!

Offline

#11 2012-06-26 18:48:04

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Upgrade of /etc/group and /etc/gshadow

Well, I did merge what was missing, which was the lock entry, however it seems something else had already added it and at least in gshadow it differs, for a group that is supposed to be present in the files provided by filesystem it seems to be a bad to have some other package adding and later trying to remove this group.

> grpck -r
duplicate group entry
delete line 'lock:x:54:'? No
duplicate group entry
delete line 'lock:x:54:'? No
duplicate shadow group entry
delete line 'lock:::'? No
duplicate shadow group entry
delete line 'lock:!::'? No
grpck: no changes

Last edited by R00KIE (2012-06-26 18:48:19)


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#12 2012-06-26 19:09:33

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Upgrade of /etc/group and /etc/gshadow

You can also use merge_pacnew_group and merge_pacnew_gshadow in the pacnew_scripts package.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#13 2012-06-27 03:36:20

stryder
Member
Registered: 2009-02-28
Posts: 500

Re: Upgrade of /etc/group and /etc/gshadow

Thanks, Xyne. This looks useful. I will also be checking out maown which you highlighted in another thread.

Offline

#14 2012-06-29 01:38:34

count0
Member
Registered: 2011-09-28
Posts: 20

Re: Upgrade of /etc/group and /etc/gshadow

Can I just merge the group file and the use grpconv to generate a gshadow file?

Offline

#15 2012-06-29 06:44:58

loafer
Member
From: the pub
Registered: 2009-04-14
Posts: 1,772

Re: Upgrade of /etc/group and /etc/gshadow

count0 wrote:

Can I just merge the group file and the use grpconv to generate a gshadow file?

It is always safer to use grpck first.


All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.

Offline

#16 2012-06-29 12:52:40

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: Upgrade of /etc/group and /etc/gshadow

count0 wrote:

Can I just merge the group file and the use grpconv to generate a gshadow file?

You shouldn't touch group/gshadow. Just look at filesystem.install and you'll see that the lock group will be created for you. Simply erase g{roup,shadow}.pacnew.


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

Board footer

Powered by FluxBB