Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] user creation optional

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: Thomas Orgis <thomas-forum AT orgis.org>
  • To: seth AT swoolley.homeip.net
  • Cc: sm-discuss AT lists.ibiblio.org
  • Subject: Re: [SM-Discuss] user creation optional
  • Date: Sun, 23 Jul 2006 18:39:44 +0200

Am Sun, 23 Jul 2006 04:13:35 -0700
schrieb seth AT swoolley.homeip.net:

> > [...] $INSTALL_ROOT/etc/passwd and change all chowns to use the id
> > instead
> > of the name - so that the users don't have to be set up in the running
> > system. Maybe one could use installwatch to catch the chowns like it
> > does with file creation?
>
> I actually think we should be using the names instead of the ids in our
> functions and making it completely symbolic (except of course the
> predefined ids you mention above).

Hm, I phrased it badly... What I meant with using the numeric ids instead of
the names is the case of an $INSTALL_ROOT install from some host that has a
different user setup than the system that is being installed.
The spell should still say

chown billy:willy file

but that command could be intercepted for the case that user/group
billy/willy don't exist in host system or - more evil - have different id's
than in the chroot. Sorcery should determine what numeric id is meant by
using the account database of $INSTALL_ROOT and then issue

chown <billy_id>:<willy_id> file

where the host system's accounts don't matter.

> This prevents id conflicts. Any
> numeric chowns could be caught, but there would be no way of knowing if
> the code resolved the name to id at first without tracking previous
> glibc calls (ouch) (and the program can do this without library help
> too).

There we open the cans of worms again... What I'd like to know if is one can
hide the current running system's accounts and present only the $INSTALL_ROOT
/ sorcery accounts.
That includes any verbatim useradd calls in makefiles or the like...

Well, getting the full separation of host accounts and being-installed system
accounts may be hardly possible but I hope one can get it going to at least
get some initial chroot with basesystem with minimal impact on host system.
One may even try to do this initial cast as normal user and save the
(intercepted) file owner settings to apply as root later after chroot.


> We could catch numeric id chowns and see if they are valid, if
> they are not valid, we could consider it an error (no spells should be
> installing files without a symbolic owner). We'd find any issues pretty
> quick and be able to patch the spells.

While I think that sorcery could possibly use numeric ids without symbolic
name (in host system), for a spell that's a mistake.
But _any_ numeric id usage is potentially wrong. Difficult to determine if an
id is really valid even if symbolic name exists - could be the wrong one
(considering host system vs. chroot accounts).

> > But what broke
> > staged installs already and will continue to be difficult is setup
> > work in install step that uses the installed software and users to do
> > some complex stuff (I think of mysql, or was it postgres, even?).
>
> Yep, it really shouldn't be doing this, and it's probably good that we
> catch these -- they could probably be moved to POST_INSTALL (or
> FINAL/whatever we decided).

Hm, one could perhaps also mark thos spells whose FINAL/POST_INSTALL will
work with some $INSTALL_ROOT as opposed to the general case of spells that
possibly ever will at least need to be in chroot (programs with hardcoded
paths)... hm, what about sorcery entering the chroot for the final step, then?

> Sounds good. Once we get a plan together, we can bugify the components
> and divide up the labor, too.

I guess that we can postpone my chroot-from -some-host issue and focus on
your initial proposition of optional user creation and my issue of having the
numeric ids of new users dynamically chosen (from user defined ranges) or
explicitly predefined by user.
The latter one is easy to implement assuming that every user/group creation
is already happening via the grimoire functions - and chaning the spells that
don't obey; just those have to be changed.
Numeric id operations without former lookup of the symbolic name are a bug in
any case.
Making the creation of accounts optional will need some wrapping over
(interception of) the chowns that follow the assumed creation... most will be
install calls from makefiles some bare chown/mod lurking someplace... so it
sounds like a logical step forward for the staged install to store that as
meta info for later application.
Having only symbolic names in that info, sorcery would then invoke the new
create functions for "real" install.
I guess not only for that interaction the account code should wander from the
grimoire to sorcery as a general functionality.

Hm, I'm talking too much detail here.
I guess we should be able to make a plan;-)


Thomas.




Archive powered by MHonArc 2.6.24.

Top of Page