Commit 24863c91 authored by Eric Vidal's avatar Eric Vidal 💬

pass through scan_mode instead of dir_search

parent e47309b2
......@@ -337,13 +337,13 @@ int set_rules(char const *tree,uid_t *uids, size_t uidn,unsigned int what)
uint32_pack(pack,uids[i+1]) ;
pack[uint_fmt(pack,uids[i+1])] = 0 ;
char ut[treelen + SS_RULES_LEN + 1 + uint_fmt(pack,uids[i+1]) + 1] ;
r = dir_search(tmp,pack,S_IFREG) ;
if (r)
memcpy(ut,tmp,treelen + SS_RULES_LEN) ;
memcpy(ut + treelen + SS_RULES_LEN,"/",1) ;
memcpy(ut + treelen + SS_RULES_LEN + 1,pack,uint_fmt(pack,uids[i+1])) ;
ut[treelen + SS_RULES_LEN + 1 + uint_fmt(pack,uids[i + 1])] = 0 ;
r = scan_mode(tmp,S_IFREG) ;
if (r == 1)
{
memcpy(ut,tmp,treelen + SS_RULES_LEN) ;
memcpy(ut + treelen + SS_RULES_LEN,"/",1) ;
memcpy(ut + treelen + SS_RULES_LEN + 1,pack,uint_fmt(pack,uids[i+1])) ;
ut[treelen + SS_RULES_LEN + 1 + uint_fmt(pack,uids[i + 1])] = 0 ;
log_trace("unlink: ",ut) ;
r = unlink(ut) ;
if (r == -1) return 0 ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment