[SSSD] [PATCH] User home directories management
Jakub Hrozek
jhrozek at redhat.com
Thu Oct 22 17:48:27 UTC 2009
-----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-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-User-home-directories-management.patch
Type: text/x-patch
Size: 83639 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20091022/047a82e9/attachment.bin>
More information about the sssd-devel
mailing list