bin/172112: [patch] Fix for incorrect work: pw user show 0

看板FB_bugs作者時間13年前 (2012/09/27 18:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/3 (看更多)
>Number: 172112 >Category: bin >Synopsis: [patch] Fix for incorrect work: pw user show 0 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Sep 27 09:40:08 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Ilya A. Arkhipov >Release: CURRENT >Organization: Luxoft >Environment: FreeBSD gdpsolaris 10.0-CURRENT FreeBSD 10.0-CURRENT #0: Mon Sep 17 08:52:10 UTC 2012 root@gdpsolaris:/usr/obj/usr/src/sys/GENERIC amd64 >Description: pw incorrect works with 0 uid: # pw user show 0 pw: no such user `0' Yes I know regarding -u, but: # pw user show 80 www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin we just need fix pw_user.c#318 ">" to ">=" >How-To-Repeat: pw user show 0 >Fix: --- pw_user.c_old 2012-09-27 12:22:27.043408321 +0000 +++ pw_user.c 2012-09-27 11:54:19.386410444 +0000 @@ -315,7 +315,7 @@ */ if (mode != M_ADD && pwd == NULL && strspn(a_name->val, "0123456789") == strlen(a_name->val) - && atoi(a_name->val) > 0) { /* Assume uid */ + && atoi(a_name->val) >= 0) { /* Assume uid */ (a_uid = a_name)->ch = 'u'; a_name = NULL; } Patch attached with submission follows: --- pw_user.c_old 2012-09-27 12:22:27.043408321 +0000 +++ pw_user.c 2012-09-27 11:54:19.386410444 +0000 @@ -315,7 +315,7 @@ */ if (mode != M_ADD && pwd == NULL && strspn(a_name->val, "0123456789") == strlen(a_name->val) - && atoi(a_name->val) > 0) { /* Assume uid */ + && atoi(a_name->val) >= 0) { /* Assume uid */ (a_uid = a_name)->ch = 'u'; a_name = NULL; } >Release-Note: >Audit-Trail: >Unformatted: _______________________________________________ freebsd-bugs@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "freebsd-bugs-unsubscribe@freebsd.org"
文章代碼(AID): #1GP2FUH5 (FB_bugs)
文章代碼(AID): #1GP2FUH5 (FB_bugs)