Date: Thu, 3 Nov 2005 15:16:52 +0100 (CET) From: Oliver Fromme <olli@lurza.secnetix.de> To: freebsd-bugs@FreeBSD.ORG, thib@mi.is Subject: Re: Reopening a closed PR... bin/63160 Message-ID: <200511031416.jA3EGqgp006367@lurza.secnetix.de> In-Reply-To: <20051103003132.64eca4f7.thib@mi.is>
next in thread | previous in thread | raw e-mail | index | archive | help
Thordur I. Bjornsson <thib@mi.is> wrote: > I'm not sure how you reopen a PR or if you are supposed to send a new PR You can open a new PR, or ask someone (preferably the person who closed it) to re-open it -- _if_ you have a convincing reason to do so. > Here goes, > I'm not able to chown a dir/file what-have-you with the user nobody > e.g > [thib@caulfield ~]$ chown nobody foo > chown: nobody: Invalid argument That happens when the user doesn't exist. chown(8) first tries to resolve the user via getpwnam(3). That _should_ succeed for user "nobody". But if it fails, chown tries to convert it as a numerical UID via strtoul(3), which fails with EINVAL if no conversion could be done (i.e. if it's not a valid number). This is clearly documented in the strtoul(8) manpage. Arguably, the chown(8) manpage should contain a note that the "invalid argument" error message indicates that the user (or group) does not exist. Or, preferably, chown should be fixed to print a more helpful error message in that case. You might consider opening a new PR on this. > [thib@caulfield ~]$ fgrep nobody /etc/passwd > nobody:*:65534:65534:Unprivileged user:/nonexistent:/usr/sbin/nologin Note that /etc/passwd is irrelevant. Do you have a valid "nobody" user in master.passwd, _and_ are your pwd.db and spwd.db files up to date? To be sure, use this command: # pwd_mkdb -p /etc/master.passwd With the option "-C" pwd_mkdb will check the syntax of the master.passwd file. See the manual page for details. Also note that other authentication mechanisms can come into play here, e.g. when you're using NIS etc. I also wonder what other programs do when you try to use nobody. For example, what's the output from the command "ps -U nobody" (upper-case -U) on your machine? Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "To this day, many C programmers believe that 'strong typing' just means pounding extra hard on the keyboard." -- Peter van der Linden
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200511031416.jA3EGqgp006367>