Bug 156305 - security/sudo: upgrade fails
Summary: security/sudo: upgrade fails
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Wesley Shields
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-10 15:00 UTC by Helmut Schneider
Modified: 2011-04-13 15:01 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Helmut Schneider 2011-04-10 15:00:19 UTC
upgrade of sudo fails:

[...]
--->  Installing the new version via the port with make flags: -DWITH_LDAP
===>  Installing for sudo-1.8.1
===>   sudo-1.8.1 depends on shared library: ldap-2.4.8 - found
===>   Generating temporary packing list
===>  Checking if security/sudo already installed
if test -d ./.hg && cd .; then  if hg log --style=changelog -b 1.8 > ChangeLog.tmp && hg log --style=changelog -b default --date '<2011-02-25 21:30:00' >> ChangeLog.tmp; then  mv -f ChangeLog.tmp ChangeLog;  else  rm -f ChangeLog.tmp;  fi;  fi
for d in compat common  plugins/sudoers src include doc;  do (cd $d && exec make pre-install) && continue;  exit $?;  done
Checking existing sudoers file for syntax errors.
visudo: >>> /usr/local/etc/sudoers: /usr/local/etc/sudoers.d near line 98 <<<
parse error in /usr/local/etc/sudoers near line 98
*** Error code 1

Stop in /usr/ports/security/sudo/work/sudo-1.8.1/plugins/sudoers.
*** Error code 1

Stop in /usr/ports/security/sudo/work/sudo-1.8.1.
*** Error code 1

Stop in /usr/ports/security/sudo.
*** Error code 1

Stop in /usr/ports/security/sudo.

[helmut@BSDHelmut ~]$ cat /usr/local/etc/sudoers | egrep -v '^(#|$)'
root ALL=(ALL) ALL
helmut ALL=(ALL) NOPASSWD: ALL
[helmut@BSDHelmut ~]$
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2011-04-10 15:00:34 UTC
Responsible Changed
From-To: freebsd-ports-bugs->wxs

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Anatoly Borodin 2011-04-10 23:30:17 UTC
Hi All!

The problem is with ${PREFIX}/etc/sudoers.d - it is not beeing created after
the update, and is required by the sudoers file.

You can try to create a dir etc/sudoers.d with 0750 as a workaround, or
comment (with a second #) the last line of sudoers.

-- 
Mit freundlichen GrüÃen,
Anatoly Borodin
business: anatoly.borodin@gmail.com
privat: fractalizator@gmail.com
Comment 3 Wesley Shields freebsd_committer freebsd_triage 2011-04-11 00:47:58 UTC
On Mon, Apr 11, 2011 at 12:30:17AM +0200, Anatoly Borodin wrote:
> Hi All!
> 
> The problem is with ${PREFIX}/etc/sudoers.d - it is not beeing created after
> the update, and is required by the sudoers file.
> 
> You can try to create a dir etc/sudoers.d with 0750 as a workaround, or
> comment (with a second #) the last line of sudoers.

I can't seem to reproduce this problem in any scenario. Which version of
sudo are you upgrading from?

-- WXS
Comment 4 Anatoly Borodin 2011-04-11 03:43:54 UTC
Hi!


On Mon, Apr 11, 2011 at 01:47, Wesley Shields <wxs@freebsd.org> wrote:
> I can't seem to reproduce this problem in any scenario. Which version of
> sudo are you upgrading from?

1.7.4.6 -> 1.8.1

There are changes related to sudoers.d in the files

Makefile
files/patch-Makefile.in (deleted)
files/patch-plugins__sudoers__Makefile.in (created)
pkg-plist

Scenarios:

1) Deinstall sudo, remove /usr/loca/etc/sudoers*. Install sudo -
successfully. Run 'sudo ls' and get

sudo: >>> /usr/local/etc/sudoers: /usr/local/etc/sudoers.d near line 97 <<<
sudo: parse error in /usr/local/etc/sudoers near line 97
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

2) Edit /usr/local/etc/sudoers, deinstall sudo - sudoers should
persist. Install sudo and get the messages mentioned by Helmut
Schneider.

3) Create sudoers.d, install sudo - successfully.

--
Mit freundlichen Gr=C3=BC=C3=9Fen,
Anatoly Borodin
business: anatoly.borodin@gmail.com
privat: fractalizator@gmail.com
Comment 5 dfilter service freebsd_committer freebsd_triage 2011-04-11 13:47:15 UTC
wxs         2011-04-11 12:47:00 UTC

  FreeBSD ports repository

  Modified files:
    security/sudo        Makefile 
    security/sudo/files  patch-plugins__sudoers__sudoers.in 
  Log:
  We don't install a sudoers.d, remove that from the default sudoers file.
  
  PR:             ports/156305
  Submitted by:   Helmut Schneider <jumper99@gmx.de>
                  Anatoly Borodin <anatoly.borodin@gmail.com>
  
  Revision  Changes    Path
  1.124     +1 -0      ports/security/sudo/Makefile
  1.2       +10 -2     ports/security/sudo/files/patch-plugins__sudoers__sudoers.in
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 6 Wesley Shields freebsd_committer freebsd_triage 2011-04-11 13:53:06 UTC
On Mon, Apr 11, 2011 at 04:43:54AM +0200, Anatoly Borodin wrote:
> Hi!
> 
> 
> On Mon, Apr 11, 2011 at 01:47, Wesley Shields <wxs@freebsd.org> wrote:
> > I can't seem to reproduce this problem in any scenario. Which version of
> > sudo are you upgrading from?
> 
> 1.7.4.6 -> 1.8.1
> 
> There are changes related to sudoers.d in the files
> 
> Makefile
> files/patch-Makefile.in (deleted)
> files/patch-plugins__sudoers__Makefile.in (created)
> pkg-plist
> 
> Scenarios:
> 
> 1) Deinstall sudo, remove /usr/loca/etc/sudoers*. Install sudo -
> successfully. Run 'sudo ls' and get
> 
> sudo: >>> /usr/local/etc/sudoers: /usr/local/etc/sudoers.d near line 97 <<<
> sudo: parse error in /usr/local/etc/sudoers near line 97
> sudo: no valid sudoers sources found, quitting
> sudo: unable to initialize policy plugin
> 
> 2) Edit /usr/local/etc/sudoers, deinstall sudo - sudoers should
> persist. Install sudo and get the messages mentioned by Helmut
> Schneider.
> 
> 3) Create sudoers.d, install sudo - successfully.

Wow, that was a really bone-headed mistake made by me. It should be
fixed now. I patched the default sudoers to get rid of that line. I also
added a note to UPDATING for this.

Please let me know if the latest commit fixes your problem or not.

-- WXS
Comment 7 Helmut Schneider 2011-04-11 17:23:15 UTC
Hi all,

after removing the last line (three lines) in sudoers sudo (1.8.1_1) 
upgrades fine. I guess creating the directory will also fix it but I didn't 
try that workaround.

Thanks, Helmut
Comment 8 Wesley Shields freebsd_committer freebsd_triage 2011-04-13 15:01:42 UTC
State Changed
From-To: open->closed

I fixed this.