-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 10/22/2009 01:20 PM, Martin Nagy wrote:
Fair enough.
All the important points were addressed, thank you. I noticed couple of
other things however.
One more typo I noticed in server/tools/sss_useradd.c:
+ { "create-home", 'm', POPT_ARG_NONE, NULL, 'm',
_("Create
user's directory if does not exist"), NULL },
Insert 'it' between 'if' and 'does'.
Fixed
A more serious bug I see in files.c:
+ while ((cnt = read(ifd, buf, sizeof(buf))) > 0) {
+ while (cnt > 0) {
+ written = write(ofd, buf, (size_t)cnt);
+ if (written == -1) {
+ ret = errno;
+ DEBUG(1, ("Cannot write() to source file '%s': [%d][%
s].\n",
+ dst, ret, strerror(ret)));
+ goto fail;
+ }
+ cnt -= written;
+ }
+ }
You should write like this:
written = write(ofd, buf + written, cnt);
Fixed, although a little differently than you proposed
Plus, this will require you to set written to 0 before the second
while.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora -
http://enigmail.mozdev.org/
iEYEARECAAYFAkrgmusACgkQHsardTLnvCXj4QCfYi3TazraSMyN10C3tb4f45Rm
dEAAmwWiPF7oTKNJun8VXu9cN2wqfchr
=Ikx5
-----END PGP SIGNATURE-----