You are not logged in.
Sudo was updated today and a since I don't have a vanilla sudoers file a .pacnew file was installed. I ran pacdiff and found no significant changes and so I left it unedited. However, had I needed to change it, I assume I would not have used pacdiff to do so, correct? The appropriate program to use is visudo, right?
[edit] This assumption comes from https://wiki.archlinux.org/index.php/Sudo#Configuration
Last edited by nstgc (2014-11-26 02:46:45)
Offline
In this case I believe you are right. visudo should always be used for the sudoers file. Otherwise, yes, pacdiff is acceptable.
Personally, I just use diff.
Last edited by IMBJR (2014-09-27 14:50:26)
Offline
I use visudo.
Offline
I use vimdiff (through yaourt -C) in order to see the changes and edit the file with visudo in another tab.
As I am still noobish with vi and even if there is no error message after writing the file with the changes I made, I repeat the vimdiff procedure in order to check that everything is fine before deleting the .pacnew file/proceeding to 'ok' the new sudoers file.
\(o_X)/
'Cause I wanna be an Archy - An Archy in the UK // Sex Pistols
Offline
How I handle it (with vim set as my default editor):
$ sudo visudo
:diffthis
:vnew
Ctrl+w, r (optional, puts the new buffer on the right)
:e/etc/sudoers.pacnew
:diffthis
Ctrl+w, Ctrl+w
Then merge the differences. Chances are there's nothing worth losing sleep over. I think there was a couple of comment differences when I did mine earlier.
Last edited by WorMzy (2014-09-27 21:00:06)
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
How I handle it (with vim set as my default editor):
$ sudo visudo :diffthis :vnew Ctrl+w, r (optional, puts the new buffer on the right) :e/etc/sudoers.pacnew :diffthis Ctrl+w, Ctrl+w
Then merge the differences. Chances are there's nothing worth losing sleep over. I think there was a couple of comment differences when I did mine earlier.
Great answer! That's what I was looking for. I don't remember how I handled it at the time, but now I'm updating a computer that I had not merged any pacnew files for all year. This has given me a long list of special files to deal with and I'm looking for the "proper" way because I remember having some issues before. Those files are:
passwd
shadow
group
gshadow
sudoers
After investigating them, this one is the only one I should've done anything with last time. Since I tried to merge all of them, I got myself into trouble. Seems like a mistake to ever put through pacnew files on group/passwd the related shadow files. I will investigate if they show up again, but probably end up deleting them.
For some reason, even though `echo $EDITOR` shows it's "vim", visudo isn't using vim unless I define the variable again. Even exporting VISUAL to "vim" or "/usr/bin/vim -p -X" in .bashrc or .zshrc doesn't work for me anymore. I have to change your first line to:
$ sudo VISUAL="/usr/bin/vim -p -X" visudo
Last edited by colinkeenan (2014-11-26 00:49:21)
Offline
Forgot to mark this as [solved]. I'm just using pacdiff because I'm lazy, though I do think WorMzy's answer is the best.
Offline