From owner-freebsd-hackers@freebsd.org Sun Nov 5 12:55:10 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02A26E6B2DB for ; Sun, 5 Nov 2017 12:55:10 +0000 (UTC) (envelope-from sudakov+freebsd@sibptus.tomsk.ru) Received: from relay2.tomsk.ru (mail.sibptus.tomsk.ru [212.73.124.5]) by mx1.freebsd.org (Postfix) with ESMTP id 5F0B47EAD4 for ; Sun, 5 Nov 2017 12:55:08 +0000 (UTC) (envelope-from sudakov+freebsd@sibptus.tomsk.ru) X-Virus-Scanned: by clamd daemon 0.98.5_1 for FreeBSD at relay2.tomsk.ru Received: from [212.73.125.240] (HELO admin.sibptus.transneft.ru) by relay2.tomsk.ru (CommuniGate Pro SMTP 5.1.16) with ESMTPS id 39855069; Sun, 05 Nov 2017 18:50:22 +0600 Received: from admin.sibptus.transneft.ru (sudakov@localhost [127.0.0.1]) by admin.sibptus.transneft.ru (8.15.2/8.15.2) with ESMTP id vA5Ct4Q5038511; Sun, 5 Nov 2017 19:55:06 +0700 (+07) (envelope-from sudakov+freebsd@sibptus.tomsk.ru) Received: (from sudakov@localhost) by admin.sibptus.transneft.ru (8.15.2/8.15.2/Submit) id vA5Ct1R8038510; Sun, 5 Nov 2017 19:55:01 +0700 (+07) (envelope-from sudakov+freebsd@sibptus.tomsk.ru) X-Authentication-Warning: admin.sibptus.transneft.ru: sudakov set sender to sudakov+freebsd@sibptus.tomsk.ru using -f Date: Sun, 5 Nov 2017 19:55:01 +0700 From: Victor Sudakov To: Yuri Pankov Cc: Victor Sudakov , freebsd-hackers@freebsd.org Subject: Re: "pw useradd -D -e" writes bogus expire_days value into pw.conf Message-ID: <20171105125501.GA38197@admin.sibptus.transneft.ru> References: <20171105033222.GA34641@admin.sibptus.transneft.ru> <497adca8-9e9a-fa99-34cb-6073cd433d01@gmx.com> <20171105120914.GA38007@admin.sibptus.transneft.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: AO "Svyaztransneft", SibPTUS X-PGP-Key: http://www.dreamwidth.org/pubkey?user=victor_sudakov X-PGP-Fingerprint: 10E3 1171 1273 E007 C2E9 3532 0DA4 F259 9B5E C634 User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 12:55:10 -0000 Yuri Pankov wrote: > On Sun, 5 Nov 2017 19:09:14 +0700, Victor Sudakov wrote: > > Yuri Pankov wrote: > >> On Sun, 5 Nov 2017 10:32:22 +0700, Victor Sudakov wrote: > >>> Dear Colleagues, > >>> > >>> Could anyone please reproduce this bug, especially on an 11.x and 12.x > >>> branches? Or is it just me? > >>> > >>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223431 > >> > >> Yes, it's the same on -CURRENT, but as the man page says, argument to -e > >> must be numeric in presence of -D, so most likely it just needs an > >> additional check. > > > > Hmm, even with a numeric argument it sets the expiry date incorrectly in > > newly created accounts, see the "Expire" line below: > > Indeed, guess there are a lot more bugs to fixed here :-) > > - `pw useradd -D -e 0` doesn't reset the value in pw.conf > - man page doesn't say that `pw useradd -D -p days` should be treated > the same as -D -e Even if I treat expire_days as seconds, new accounts are still created with the expiration date in the past (seconds since epoch, not since the moment of account creation). -- Victor Sudakov, VAS4-RIPE, VAS47-RIPN AS43859