Skip to content

Commit d1d60d3

Browse files
authored
Switch uid/gid for Readdir() calls (#50)
stat()'ing entries in directories may require uid/gid switching when permissions are limited.
1 parent 4ca6189 commit d1d60d3

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/MultiuserDirectory.hh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ public:
3030

3131
int Readdir(char *buff, int blen)
3232
{
33+
UserSentry sentry(m_client, m_log);
34+
if (!sentry.IsValid()) {return -EACCES;}
3335
return m_wrappedDir->Readdir(buff, blen);
3436
}
3537

0 commit comments

Comments
 (0)