RE: libsemanage patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Daniel J Walsh wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> genhomedircon includes the "\n" in /etc/shells so no shells in the
> /etc/passwd match.

Isn't this going to cause problems if the last line in /etc/shells has
no newline?

Instead of:
    temp[strlen(temp)-1]=0;

I would use:
    temp[strcspn(temp, "\n")] = '\0';

That will overwrite the first newline with a NUL or, if there is no
newline, the terminating NUL will be overwritten with another NUL, which
is harmless.  It is a useful idiom...

 - todd


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@xxxxxxxxxxxxx with
the words "unsubscribe selinux" without quotes as the message.

[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux