On 5/22/12 10:04 AM, Alexander Hansen wrote:
> On 5/22/12 1:53 AM, Dustin Cartwright wrote:
>> On Tue, May 22, 2012 at 6:46 AM, Alexander Hansen
>> <alexanderk.hansen@gmai...> wrote:
>>> Sorry, was in a bad mood.
>> I was just trying to convince you to do less work, but I can see that
>> I failed. :)
>>> Here's the thought process I was working under:
>>> "fink configure" is a natural place to do anything that has prompts for
>>> the user. However, it isn't supposed to have side effects, i.e. all
>>> that it currently does is set up the fink.conf file. So I figured we'd
>>> prompt for user input and do the sanity checking in "fink configure",
>>> saving the results (FinkBldUid for immediate use, and AutoUid,
>>> AutoUidMin, AutoUidMax for the next 'fink configure'), and then actually
>>> write the fink-bld information (if required) elsewhere.
>> To leave open the possibility of automatic UIDs replacing the current
>> passwd in the future, would it be better to replace FinkBldUid with
>> something more extensible? I don't know if the fink.conf parser can
>> handle something like:
>> FixedUids: <<
>> fink-bld: 266
>> postfres: 252
> I don't think fink.conf can handle that.
>> Or maybe better would be just to take the UID and GID from
>> %p/etc/passwd-fink and %p/etc/passwd-group if AutoUid is false? After
>> all, this is where people were supposed to customized the added users
>> in the past.
> Actually, what it does right now is:
> 1) Check whether fink-bld exists on the system, and grab its UID and
> GID--via 'id -P fink-bld'. That avoids worrying about whether the user
> happens to have changed fink-bld's configuration by means other than
> editing %p/etc/passwd-*, since we're using what is actually in place on
> the system.
> 2) If fink-bld exists and is properly configured (defined as having both
> a UID and GID) then the user is given the default option just to use the
> extant fink-bld, regardless of whether AutoUid is set. That way they'll
> be using whatever they had set up in the past, unless they specifically
> make the change.
> For users without fink-bld, the default is to get an ID automatically
> from the 600-699 range.
Configure.pm is where things get configured to set. I check the
validity of prospective UID/GID values here as well as in Services.pm.
If there's a pre-existing fink-bld user, it gets used by default, and
its UID/GID (assumed to be the same) get stored in fink.conf.
Services.pm has similar changes to what Dustin added in his branch, with
a few tweaks. In this case, the FinkBldUid: field from fink.conf takes
precedence over the current UID/GID of the fink-bld user, so if they
differ the assumption is that the user wanted to change to the fink.conf
Engine.pm actually runs &ensure_fink_bld() thereby setting the fink-bld
user up. It checks for every fink verb other than "configure". We may
want only to do that for build operations, perhaps--though it was
convenient just to use "fink index" to test changes to the fink-bld