Date: Sat, 20 Sep 1997 14:06:11 +0200 (MET DST) From: Wolfram Schneider <wosch@cs.tu-berlin.de> To: FreeBSD-gnats-submit@FreeBSD.ORG Subject: bin/4587: bad implemented dot support in chown(8) Message-ID: <199709201206.OAA01321@panke.panke.de> Resent-Message-ID: <199709201220.FAA02418@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 4587 >Category: bin >Synopsis: bad implemented dot support in chown(8) >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Sep 20 05:20:01 PDT 1997 >Last-Modified: >Originator: Wolfram Schneider >Organization: >Release: FreeBSD 2.2-RELEASE i386 >Environment: Chown(8) compiled with -DSUPPORT_DOT (backward compatibility) does first check for a `.' and then for `:' as a delimiter. Usernames with a dot will fail. # chown r.r:bin /tmp/bla chown: r:bin: illegal group name Fix: first check for a `:' and then for a `.' Index: chown.c =================================================================== RCS file: /usr/cvs/src/usr.sbin/chown/chown.c,v retrieving revision 1.4 diff -u -r1.4 chown.c --- chown.c 1996/08/14 18:13:58 1.4 +++ chown.c 1997/09/20 11:30:12 @@ -136,16 +136,16 @@ uid = gid = -1; if (ischown) { -#ifdef SUPPORT_DOT - if ((cp = strchr(*argv, '.')) != NULL) { + if ((cp = strchr(*argv, ':')) != NULL) { *cp++ = '\0'; a_gid(cp); - } else -#endif - if ((cp = strchr(*argv, ':')) != NULL) { + } +#ifdef SUPPORT_DOT + else if ((cp = strchr(*argv, '.')) != NULL) { *cp++ = '\0'; a_gid(cp); } +#endif a_uid(*argv); } else a_gid(*argv); >Description: >How-To-Repeat: >Fix: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709201206.OAA01321>