g pdZddlZddlmZddlmZddlmZmZddl m Z eGddZ dS) u  This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program.  If not, see . Copyright © 2019 Cloud Linux Software Inc. This software is also available under ImunifyAV commercial license, see N) dataclass)Path)ListSet) is_cloudwaysc eZdZUdZdZeed<dZeed<e de ddde ede e jd df d Ze de d ede ede e jd ef d Ze de d ede ede e jd ef dZdS) CloudwaysUsera Helper to override a `user` for Cloudways environment where a file (db) in a customer's directory may belong to another user but should be visible for the customer and at the same time it must be cleanable (the true `owner` of a file is used for cleaning up) Nnameuidpathfallbackusers_from_panelpw_allreturncdtrtfd|D|S|S)Nc3K|]?}|jvr4t|jjv&|j|jV@dS))r r N)pw_namerpw_dirparentspw_uid).0pwclsr rs T/opt/imunify360/venv/lib/python3.11/site-packages/imav/malwarelib/utils/cloudways.py z3CloudwaysUser.get_user_from_path..4sgz%555RY4<77CRZRY7778777 )rnext)rr r rrs`` ` rget_user_from_pathz CloudwaysUser.get_user_from_path*sa >> $  r fallback_namecX||}|||||}|jS)N)r )rr )rr rrrr users roverride_name_by_pathz#CloudwaysUser.override_name_by_path>s83M***%%dH6FOOyr fallback_uidcX||}|||||}|jS)N)r )rr )rr r#rrr r!s roverride_uid_by_pathz"CloudwaysUser.override_uid_by_pathJs73<(((%%dH6FOOxr)__name__ __module__ __qualname____doc__r str__annotations__r int classmethodrrrpwd struct_passwdrr"r%rrr r sQD#COOO"c(  S&'   [&   c(  S&'    [    c(  S&'    [   rr ) r)r. dataclassesrpathlibrtypingrrdefence360agent.utilsrr r0rrr5s* !!!!!!...... 5555555 555r