There seems to be a bug somewhere: chrisbra@256bit:~$ find . -depth |cpio --pass-through --preserve-modification-time --make-directories --unconditional -R chrisbra ../target/ cpio: chrisbra: invalid user chricbra@256bit.org:~$ getent passwd |grep chrisbra chrisbra:x:1004:100::/home/chrisbra:/bin/bash Obviously, the user exists.
That does look broken, but I can't reproduce it. Does `getent passwd chisbra` show the same line?
Hallo Clint!
Clint Adams schrieb am Dienstag, den 22. Dezember 2009:
I have to add, this only affects cpio-2.9 from lenny. My C-Skills are a
little bit rusty, but the following patch seems to work for me:
chrisbra t41:~/source/cpio/cpio-2.9/src [1081:1]% diff -Nu userspec.c{.old,}
--- userspec.c.old 2009-12-23 15:40:09.000000000 +0100
+++ userspec.c 2009-12-23 15:40:21.000000000 +0100
@@ -108,7 +108,7 @@
char *spec; /* A copy we can write on. */
struct passwd *pwd;
struct group *grp;
- char *g, *u, *separator;
+ unsigned char *g, *u, *separator;
char *groupname;
error_msg = NULL;
Yes:
chrisbra@256bit:~/temp/source$ getent passwd chrisbra
chrisbra:x:1004:100::/home/chrisbra:/bin/bash
regards,
Christian
Oh, well, I'm afraid there's not much I can do for lenny but create an unofficial backport of 2.10. Would that help? I'm confused; what is expecting those characters to be unsigned?
Hallo Clint!
Clint Adams schrieb am Donnerstag, den 24. Dezember 2009:
Yes, very much.
A far lines later, you'll find that piece of code:
f (!isnumber_p (u))
error_msg = _("invalid user");
and isnumber_p fails, because u was negative in my case.
regards,
Christian
Maybe I'm dense. Why would isnumber_p() fail on a signed char string?
Hallo Clint! Clint Adams schrieb am Samstag, den 26. Dezember 2009: Because it is just a wrapper that runs isdigit (3) on each char in a loop. And from the manpage isalpha(3) and don't see, that isdigit checks for negative numbers. Well, as I said, my C-Skills are pretty rusty. May be I misunderstood something. regards, Christian
Hallo Clint! Clint Adams schrieb am Samstag, den 26. Dezember 2009: Sorry, I must have been confused. My patch actually does not change anything. Something must have messed up my test. regards, Christian
Additional data:
Ran into this bug after upgrading an ia64 box Etch->Lenny. Haven't
root-caused the bug, but have found a workaround.
In the cpio source file lib/system.c is the following code segment:
#ifndef HAVE_GETPWNAM
struct passwd *
getpwnam (const char *name __attribute__ ((unused)))
{
errno = ENOSYS;
return NULL;
}
#endif
#ifndef HAVE_GETGRGID
struct group *
getgrgid (gid_t gid __attribute__ ((unused)))
{
errno = ENOSYS;
return NULL;
}
#endif
#ifndef HAVE_GETGRNAM
struct group *
getgrnam (const char *name __attribute__ ((unused)))
{
errno = ENOSYS;
return NULL;
}
#endif
It appears that HAVE_GETPWNAM, HAVE_GETGRGID, and HAVE_GETGRNAM are not
being defined even though the system does support the getpwnam(),
getgrgid(), and getpwnam() calls. Autoconf problem? This causes cpio to
be compiled with the lib/system.c versions of the aforementioned
functions instead of linking to the system library versions. Commenting
out the above code segment and recompiling fixes the problem.
Regards,
Bill Skinner
That's interesting. Unfortunately I don't have the build logs from that far back to check the configure output.