5bb5b236fe8c663b7d4db5ccaf3e3e7942bf6abdZbigniew Jędrzejewski-Szmek This file is part of systemd.
5bb5b236fe8c663b7d4db5ccaf3e3e7942bf6abdZbigniew Jędrzejewski-Szmek Copyright 2015 Zbigniew Jędrzejewski-Szmek
5bb5b236fe8c663b7d4db5ccaf3e3e7942bf6abdZbigniew Jędrzejewski-Szmek systemd is free software; you can redistribute it and/or modify it
5bb5b236fe8c663b7d4db5ccaf3e3e7942bf6abdZbigniew Jędrzejewski-Szmek under the terms of the GNU Lesser General Public License as published by
5bb5b236fe8c663b7d4db5ccaf3e3e7942bf6abdZbigniew Jędrzejewski-Szmek the Free Software Foundation; either version 2.1 of the License, or
5bb5b236fe8c663b7d4db5ccaf3e3e7942bf6abdZbigniew Jędrzejewski-Szmek (at your option) any later version.
5bb5b236fe8c663b7d4db5ccaf3e3e7942bf6abdZbigniew Jędrzejewski-Szmek systemd is distributed in the hope that it will be useful, but
5bb5b236fe8c663b7d4db5ccaf3e3e7942bf6abdZbigniew Jędrzejewski-Szmek WITHOUT ANY WARRANTY; without even the implied warranty of
5bb5b236fe8c663b7d4db5ccaf3e3e7942bf6abdZbigniew Jędrzejewski-Szmek MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5bb5b236fe8c663b7d4db5ccaf3e3e7942bf6abdZbigniew Jędrzejewski-Szmek Lesser General Public License for more details.
5bb5b236fe8c663b7d4db5ccaf3e3e7942bf6abdZbigniew Jędrzejewski-Szmek You should have received a copy of the GNU Lesser General Public License
5bb5b236fe8c663b7d4db5ccaf3e3e7942bf6abdZbigniew Jędrzejewski-Szmek along with systemd; If not, see <http://www.gnu.org/licenses/>.
5bb5b236fe8c663b7d4db5ccaf3e3e7942bf6abdZbigniew Jędrzejewski-Szmekstatic void test_add_acls_for_user(void) {
5bb5b236fe8c663b7d4db5ccaf3e3e7942bf6abdZbigniew Jędrzejewski-Szmek char fn[] = "/tmp/test-empty.XXXXXX";
5bb5b236fe8c663b7d4db5ccaf3e3e7942bf6abdZbigniew Jędrzejewski-Szmek fd = mkostemp_safe(fn, O_RDWR|O_CLOEXEC);
5bb5b236fe8c663b7d4db5ccaf3e3e7942bf6abdZbigniew Jędrzejewski-Szmek /* Use the mode that user journal files use */
d879fca6bcc391ec69a900affaafaaa51e02e5c5Zbigniew Jędrzejewski-Szmek assert_se(fchmod(fd, 0640) == 0);
5bb5b236fe8c663b7d4db5ccaf3e3e7942bf6abdZbigniew Jędrzejewski-Szmek cmd = strjoina("getfacl -p ", fn);
5bb5b236fe8c663b7d4db5ccaf3e3e7942bf6abdZbigniew Jędrzejewski-Szmek r = get_user_creds(&nobody, &uid, NULL, NULL, NULL);
5bb5b236fe8c663b7d4db5ccaf3e3e7942bf6abdZbigniew Jędrzejewski-Szmek cmd = strjoina("getfacl -p ", fn);
5bb5b236fe8c663b7d4db5ccaf3e3e7942bf6abdZbigniew Jędrzejewski-Szmek /* set the acls again */
5bb5b236fe8c663b7d4db5ccaf3e3e7942bf6abdZbigniew Jędrzejewski-Szmek cmd = strjoina("getfacl -p ", fn);
5bb5b236fe8c663b7d4db5ccaf3e3e7942bf6abdZbigniew Jędrzejewski-Szmekint main(int argc, char **argv) {