/
githubmirror
/
audit-userspace
Обзор
Документация
Войти
/
githubmirror
/
audit-userspace
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
auparse/test/uid_name_wrap_test.c
46 строк
1 KB
Steve Grubb
Update license and copyrights 2
20 июл 2026, 22:58
20 июл 2026, 22:58
1a67be2
Код
Авторство
О чём код?
/* uid_name_wrap_test.c -- auparse UID cache tests * Copyright 2025 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" #include "internal.h" #include <assert.h> #include <string.h> #include <stdlib.h> /* Verify name->uid->name round trip through the cache */ /* * main - ensure cache lookups are symmetric * * Returns 0 on success or aborts on failure. */ int main(void) { auparse_state_t au; memset(&au, 0, sizeof(au)); uid_t uid = lookup_uid_from_name(&au, "root"); assert(uid == 0); QNode *n = check_lru_uid(au.uid_cache, uid); assert(n && n->name && strcmp(n->name, "root") == 0); destroy_lru(au.uid_cache); return 0; }