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

add set_ownerhome_stack_byuid function

parent 8d96cf0a
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,7 @@ 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 int set_ownerhome_stack_byuid(char *store, uid_t owner) ;
extern void set_treeinfo(ssexec_t *info) ;
#endif
......@@ -47,13 +47,13 @@ int set_ownerhome(stralloc *base,uid_t owner)
return 1 ;
}
int set_ownerhome_stack(char *store)
int set_ownerhome_stack_byuid(char *store, uid_t owner)
{
log_flow() ;
char const *user_home = 0 ;
int e = errno ;
struct passwd *st = getpwuid(getuid()) ;
struct passwd *st = getpwuid(owner) ;
errno = 0 ;
if (!st) {
if (!errno) errno = ESRCH ;
......@@ -73,3 +73,10 @@ int set_ownerhome_stack(char *store)
return 1 ;
}
int set_ownerhome_stack(char *store)
{
log_flow() ;
return set_ownerhome_stack_byuid(store, getuid()) ;
}
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