Skip to content
Snippets Groups Projects
Commit ed1eaa0d authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

add set_treeinfo to lib66

parent 029edcee
No related branches found
No related tags found
No related merge requests found
......@@ -27,22 +27,6 @@
#include <66/tree.h>
#include <66/hpr.h>
void set_treeinfo(ssexec_t *info)
{
log_flow() ;
int r = tree_sethome(info) ;
if (r == -1)
log_dieu(LOG_EXIT_USER, "set the tree name") ;
if (!r)
log_dieu(LOG_EXIT_USER, "parse seed file") ;
if (!tree_get_permissions(info->base.s, info->treename.s))
log_die(LOG_EXIT_USER,"You're not allowed to use the tree: ",info->treename.s) ;
info->treeallow = 1 ;
}
static void set_info(ssexec_t *info)
{
log_flow() ;
......
......@@ -88,7 +88,6 @@ typedef ssexec_func_t *ssexec_func_t_ref ;
extern void ssexec_free(ssexec_t *info) ;
extern void ssexec_copy(ssexec_t *dest, ssexec_t *src) ;
extern ssexec_t const ssexec_zero ;
extern void set_treeinfo(ssexec_t *info) ;
/** main */
extern ssexec_func_t ssexec_parse ;
......
......@@ -59,5 +59,6 @@ extern void name_isvalid(char const *name) ;
extern int set_ownerhome_stack(char *store) ;
extern int set_ownersysdir_stack(char *base, uid_t owner) ;
extern void set_treeinfo(ssexec_t *info) ;
#endif
......@@ -6,6 +6,7 @@ set_livescan.o
set_livestate.o
set_ownerhome.o
set_ownersysdir.o
set_treeinfo.o
visit.o
yourgid.o
youruid.o
......
/*
* set_treeinfo.c
*
* Copyright (c) 2018-2021 Eric Vidal <eric@obarun.org>
*
* All rights reserved.
*
* This file is part of Obarun. It is subject to the license terms in
* the LICENSE file found in the top-level directory of this
* distribution.
* This file may not be copied, modified, propagated, or distributed
* except according to the terms contained in the LICENSE file./
*/
#include <stddef.h>
#include <oblibs/log.h>
#include <66/utils.h>
#include <66/ssexec.h>
#include <66/tree.h>
void set_treeinfo(ssexec_t *info)
{
log_flow() ;
int r = tree_sethome(info) ;
if (r == -1)
log_dieu(LOG_EXIT_USER, "set the tree name") ;
if (!r)
log_dieu(LOG_EXIT_USER, "parse seed file") ;
if (!tree_get_permissions(info->base.s, info->treename.s))
log_die(LOG_EXIT_USER,"You're not allowed to use the tree: ",info->treename.s) ;
info->treeallow = 1 ;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment