Alexander Gattin
2005-May-01 23:30 UTC
Bug#298883: there should be a way to override PASS_MAX_DAYS in useradd
Hi! I just forgot about a "secret" -O option in useradd. :) You can use it to override whatever values from login.defs For example, regarding bug #298883, use of:> `useradd -O PASS_MAX_DAYS=99999 usr298883`will solve your problem (other solution, that you have currently implemented, involves `chage`). Thus closing the bug. The problem with -O option is a Tomasz''s desire to rename it to -K for sake of unfication with Solaris: On Thu, Mar 24, 2005 at 11:31:45PM +0100, Tomasz Kłoczko wrote:> I see some good things in shadow like tools in Solaris and some things I > want to integrate on shadow....> All above variables can be used by "useradd -K <key>=<value>"....> Current shadow useradd have undocumented -O option. Fragment from > useradd source code: > > case ''O'': > /* > * override login.defs defaults (-O name=value) > * example: -O UID_MIN=100 -O UID_MAX=499 > * note: -O UID_MIN=10,UID_MAX=499 doesn''t work yet > */ > cp = strchr (optarg, ''=''); > if (!cp) { > fprintf (stderr, > _("%s: -O requires NAME=VALUE\n"), > Prog); > exit (E_BAD_ARG); > } > /* terminate name, point to value */ > *cp++ = ''\0''; > if (putdef_str (optarg, cp) < 0) > exit (E_BAD_ARG); > break; > > IMO it will be good kill -O an move this to -K.P.S. now you know the alternatives, at least. ;) -- WBR, xrgtn
Marc Haber
2005-May-02 05:20 UTC
[Adduser-devel] Bug#298883: there should be a way to override PASS_MAX_DAYS in useradd
reopen #304934 thanks On Mon, May 02, 2005 at 02:30:08AM +0300, Alexander Gattin wrote:> I just forgot about a "secret" -O option in > useradd. :) > You can use it to override whatever values from > login.defs > > For example, regarding bug #298883, use of: > > `useradd -O PASS_MAX_DAYS=99999 usr298883` > will solve your problem (other solution, that you have > currently implemented, involves `chage`). > > Thus closing the bug.Reopening. Please document this option. I cannot use a secret, undocumented option.> The problem with -O option is a Tomasz''s desire to > rename it to -K for sake of unfication with Solaris:So we can/need to wait until it is renamed, then document it, and then close the bug. Greetings Marc -- ----------------------------------------------------------------------------- Marc Haber | "I don''t trust Computers. They | Mailadresse im Header Mannheim, Germany | lose things." Winona Ryder | Fon: *49 621 72739834 Nordisch by Nature | How to make an American Quilt | Fax: *49 621 72739835
Alexander Gattin
2005-May-07 18:58 UTC
[Adduser-devel] Bug#298883: [Pkg-shadow-devel] Bug#304934: there should be a way to override PASS_MAX_DAYS in useradd
Hi, Marc! On Mon, May 02, 2005 at 07:20:29AM +0200, Marc Haber wrote:> On Mon, May 02, 2005 at 02:30:08AM +0300, Alexander Gattin wrote: > > I just forgot about a "secret" -O option in > > useradd. :) > > You can use it to override whatever values from > > login.defs > > > > For example, regarding bug #298883, use of: > > > `useradd -O PASS_MAX_DAYS=99999 usr298883` > > will solve your problem (other solution, that you have > > currently implemented, involves `chage`). > > > > Thus closing the bug. > > Reopening. Please document this option. I cannot use a secret, > undocumented option.Actually it is documented, although in TFS. ;) It''s not a passage about TFS being self-obvious :), there''s really a comment by Tomasz. Anyway, I don''t object reopening the bug, especcially because we have a problem with -O/-K (more on this below). And also because I agree that it''s better to have a documentation in "binary distribution" form, i.e. in man/info/html/README/whatever pages (just pick any you like ;)).> > The problem with -O option is a Tomasz''s desire to > > rename it to -K for sake of unfication with Solaris: > > So we can/need to wait until it is renamed, then document it,This depends on you. Currently I see the next in adduser:> Depends: ... passwd (>=961025)Dependency on such an antique version of passwd looks strange for me (do you really test adduser against it?), but if you want to choose as old a passwd as possible for the dependency, then probably you should use chage instead of -O/-K, because chage is in passwd since ages (a working version since 970616-1, AFAIU?). I may check when the -O was introduced. I think it''s too a very old option, and if you choose to start relying on "-O" when we document it, you can still declare dependency on an old passwd (I think about 2000xxxx). Of course, upcoming switch to "-K" can force us to support _both_ options for some time, but it''s not a big problem. If you choose to wait for "-K" being introduced and documented, then be prepared for long wait. First we need to sync with upstream (4.0.8 currently), and after that it''s still not clear when Tomasz will switch to "-K". Moreover you will need to make dependency on the very new pesswd, smth. like:> Depends: ... passwd (>=1:4.0.10-1)-- WBR, xrgtn
Marc Haber
2005-May-08 15:48 UTC
[Adduser-devel] Bug#298883: [Pkg-shadow-devel] Bug#304934: there should be a way to override PASS_MAX_DAYS in useradd
Hi, On Sat, May 07, 2005 at 09:58:19PM +0300, Alexander Gattin wrote:> On Mon, May 02, 2005 at 07:20:29AM +0200, Marc Haber wrote: > > Reopening. Please document this option. I cannot use a secret, > > undocumented option. > > Actually it is documented, although in TFS.TFS is not in the binary package, hence the binary package is missing the docs. That''s a policy violation *ducks*> > > The problem with -O option is a Tomasz''s desire to > > > rename it to -K for sake of unfication with Solaris: > > > > So we can/need to wait until it is renamed, then document it, > > This depends on you.Well, I decided on using chage in adduser, so the connection between this bug and the adduser issue isn''t there any more. However, I find it quite ugly to leave useful options undocumented. But that''s of couse your decision.> Currently I see the next in adduser: > > Depends: ... passwd (>=961025) > > Dependency on such an antique version of passwd looks > strange for meThere surely was a reason for doing so, but since this dependency is satisfied since bo (which had exactly this version of passwd), I think that it can probably be removed.> (do you really test adduser against it?),No.> but if you want to choose as old a passwd as > possible for the dependency, then probably you should > use chage instead of -O/-K, because chage is in passwd > since ages (a working version since 970616-1, AFAIU?).chage is now being used. Greetings Marc -- ----------------------------------------------------------------------------- Marc Haber | "I don''t trust Computers. They | Mailadresse im Header Mannheim, Germany | lose things." Winona Ryder | Fon: *49 621 72739834 Nordisch by Nature | How to make an American Quilt | Fax: *49 621 72739835