Subject: Re: pkg/36371: SU_CMD, sudo and cyclic dependancy
To: None <,,>
From: Aleksey Cheusov <>
List: pkgsrc-bugs
Date: 05/22/2007 13:20:03
The following reply was made to PR pkg/36371; it has been noted by GNATS.

From: Aleksey Cheusov <>
Subject: Re: pkg/36371: SU_CMD, sudo and cyclic dependancy
Date: Tue, 22 May 2007 16:18:32 +0300

  >> First, an example in section 8.13
  >>     .if exists(${LOCALBASE}/bin/sudo)
  >>     SU_CMD=        ${LOCALBASE}/bin/sudo /bin/sh -c
  >>     .endif
  >> doesn't work because because ${LOCALBASE} is expanded to an empty string.
 >  It is assumed in general that you have defined it already. As the
 >  LOCALBASE is a local setting, the guide can not hard-code values.
 >  /static/path/to/sudo is even more confusing IMO.
 "In general" ;). I believe most people doesn't set LOCALBASE in
 mk.conf and use /usr/pkg set by default.
 So, this example doesn't work for most people.
  >> Second, I see here a cyclic dependancy. Building pkgsrc requires
  >> sudo but sudo is installed from pkgsrc. Falling to su
  >> is also bad (in case .exist return false) because it doesn't allow
  >> (or make it a bit problematic) to build everything automatically
  >> without manually inputting password for su.
 >  There is no cyclic dependency.
 Formally yes, if...
 >  If sudo exists, it is used, otherwise
 >  not. As sudo is not changed very often, the issue is IMO not much
 >  relevant.
 "not much relevant" because most people make bulk build
 with root priviledges. Neither pkg_chk nor "bulk build" 
 were not ready for SU_CMD two months ago. I'm not sure about others.
  >> So, I personally think that plain
  >>     SU_CMD=/usr/bin/sudo /bin/sh -c
  >>   or
  >>     SU_CMD=/usr/local/bin/sudo /bin/sh -c
  >> is much better than the current variant.
  >> At least it makes sense to mention about "cyclic dependancy" in
  >> this section of documentation or even better to recomend users to
  >> use external version of sudo, at least for those who uses not
  >> NetBSD and DragonFlyBSD.
 >  Neither NetBSD nor DragonFly have a sudo by default. Pointing to an
 >  external version is therefore not really helping.
 I really dislike current example. If you think it is fine,
 you can add another one with static path.
 Two examples with some explanation about potential problem
 (cyclic dependancy or falling to su) is better than one.
 Best regards, Aleksey Cheusov.