Loading commands/filesystem/find.cpp +4 −3 Changes for commands/filesystem/find.cpp: 4 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "shell.h" #include "ids.h" #include "modeutil.h" namespace fresh { namespace cmd { Loading Loading @@ -498,9 +499,9 @@ namespace fresh { namespace cmd { auto p=std::make_unique<Perm>(); std::string m=v; if(!m.empty() && (m[0]=='-' || m[0]=='/')){ p->kind=m[0]; m=m.substr(1); } char *end=nullptr; p->mode=(mode_t)strtol(m.c_str(),&end,8); if(m.empty() || *end){ error="invalid mode '"+v+"'"; return nullptr; } // octal, or symbolic as for chmod (u+x, g=rw,o-w, a+rX...), // applied to 000 without the umask, like GNU find if(m.empty() || !mode::apply(m,0,false,0,p->mode)){ error="invalid mode '"+v+"'"; return nullptr; } return p; } if(t=="-user" || t=="-group"){ Loading Loading
commands/filesystem/find.cpp +4 −3 Changes for commands/filesystem/find.cpp: 4 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "shell.h" #include "ids.h" #include "modeutil.h" namespace fresh { namespace cmd { Loading Loading @@ -498,9 +499,9 @@ namespace fresh { namespace cmd { auto p=std::make_unique<Perm>(); std::string m=v; if(!m.empty() && (m[0]=='-' || m[0]=='/')){ p->kind=m[0]; m=m.substr(1); } char *end=nullptr; p->mode=(mode_t)strtol(m.c_str(),&end,8); if(m.empty() || *end){ error="invalid mode '"+v+"'"; return nullptr; } // octal, or symbolic as for chmod (u+x, g=rw,o-w, a+rX...), // applied to 000 without the umask, like GNU find if(m.empty() || !mode::apply(m,0,false,0,p->mode)){ error="invalid mode '"+v+"'"; return nullptr; } return p; } if(t=="-user" || t=="-group"){ Loading