§ HeNja( ã óz — d dl mZ d dl mZ d dl mZ d dlZd dlZd dlZd dlZd dlZd dl Z d dl Z d dlmZm Z d dlmZmZmZmZmZmZmZ d dlmZmZmZmZmZmZ d dl Z e j e¦ « Ze e j! ¦ « dd„Z"dd „Z#d „ Z$d„ Z%d„ Z&d „ Z'd„ Z(d„ Z)edk r e)ej* dd… Ž dS dS )é )Úprint_function)Údivision)Úabsolute_importN)Úget_boolean_paramÚCL_CONFIG_FILE)ÚQuotaWrapperÚNoSuchPackageExceptionÚNoSuchUserExceptionÚIncorrectLimitFormatExceptionÚInsufficientPrivilegesExceptionÚGeneralExceptionÚQuotaDisabledException)Ú print_textÚ print_csvÚ print_jsonÚprint_text_errorÚprint_csv_errorÚprint_json_errorc ó — | ¦ « dk rdS t j | ¦ « j }t |¦ « S # t $ r t | ¦ « ‚w xY w)zC Checks if username is valid one and returns UID as string ÚdefaultÚ0)ÚlowerÚpwdÚgetpwnamÚpw_uidÚstrÚKeyErrorr )ÚusernameÚuids úG/opt/cloudlinux/venv/lib64/python3.11/site-packages/clquota/cl_quota.pyÚ!check_username_and_convert_to_uidr! 0 si € ð ‡~‚~ÑÔ˜9Ò$Ð$؈sð,ÝŒl˜8Ñ$Ô$Ô+ˆÝ�3‰xŒxˆøÝð ,ð ,ð ,Ý! (Ñ+Ô+Ð+ð,øøøs œ'A ÁAc ó4 — t j d¦ « }| | ¦ « }|st | ¦ « ‚| d¦ « } | dk r| S t j t | ¦ « ¦ « n# t $ r t | ¦ « ‚w xY w| S )z< Checks if UID is valid one and retuns it as string z(\d+)é r ) ÚreÚcompileÚsearchr Úgroupr ÚgetpwuidÚintr )r ÚpÚpms r Ú check_uidr, = s¡ € õ Œ �8ÑÔ€AØ �Š�#‰Œ€BØ ð 'Ý! #Ñ&Ô&Ð&Ø �(Š(�1‰+Œ+€CØ ˆc‚z€z؈ ð'ÝŒ•S˜‘X”XÑÔÐÐøÝð 'ð 'ð 'Ý! #Ñ&Ô&Ð&ð'øøøà€Js Á!A; Á;Bc ó* — t j d¦ « } | t j ¦ « t j d¬¦ « }t j d¬¦ « }| |¦ « | |¦ « | S )z4 Sets syslog logger and returns its handler Úclquotaz/dev/log)Úaddressz"%(name)s:%(levelname)s %(message)s)Úfmt) ÚloggingÚ getLoggerÚsetLevelÚINFOÚhandlersÚ SysLogHandlerÚ FormatterÚsetFormatterÚ addHandler)ÚloggerÚ sysloggerÚ formatters r Úsetup_system_logr= O s‚ € õ Ô ˜yÑ )Ô )€FØ ‡O‚O•G”LÑ!Ô!Ð!ÝÔ ×.Ò.°zÐ.ÑBÔB€IÝÔ!Ð&JÐKÑKÔK€IØ ×Ò˜9Ñ%Ô%Ð%Ø ×Ò�iÑ Ô Ð Ø€Mó c óN — t d¦ « t dt j d z dz ¦ « t d¦ « t d¦ « t d¦ « t d¦ « t d¦ « t d ¦ « t d ¦ « t d¦ « t d¦ « t d ¦ « t d¦ « t d¦ « t d¦ « t d¦ « t d¦ « t d¦ « d S )NÚ zUsage: r z [OPTIONS]z9If no options given prints quota statistics for all userszOptions:z/ -u | --user : specifies the userz2 -U | --user-id : specifies the user IDz• -S | --soft-limit : sets the soft limit for a user. Pass 0 or 'default' to set package default limit. Pass -1 or 'unlimited' to cancel limitz• -H | --hard-limit : sets the hard limit for a user. Pass 0 or 'default' to set package default limit. Pass -1 or 'unlimited' to cancel limitzC -V | --csv : returns data as comma separated valuesz1 -J | --json : returns data as jsonzE -p | --package : specifies a package to set or get limitsz2 -P | --package-limits : prints package limitszZ -a | --all-package-limits : prints all package limits (including packages without limits)zU -Y | --sync : synchronizes packages and users limits with the databasezD -C | --cache-content : cache quota data to a file the databasezR -F | --force : save user quotas even when they are equal to defaultsz§ --check : Deprecated. Check if quotas is enabled/activated/suported; if disabled show diagnostic information; using with --user or --user-id options)ÚprintÚsysÚargv© r> r ÚusagerE \ sF € Ý ˆ"�I„I€IÝ ˆ)•c”h˜q”kÑ ! LÑ 0Ñ1Ô1Ð1Ý Ð EÑFÔFÐFÝ ˆ*ÑÔÐÝ ˆ"�I„I€IÝ Ð ;Ñ<Ô<Ð<Ý Ð >Ñ?Ô?Ð?Ý ð iñ jô jð jå ð iñ jô jð jå Ð OÑPÔPÐPÝ Ð =Ñ>Ô>Ð>Ý Ð QÑRÔRÐRÝ Ð >Ñ?Ô?Ð?Ý Ð fÑgÔgÐgÝ Ð aÑbÔbÐbÝ Ð PÑQÔQÐQÝ Ð ^Ñ_Ô_Ð_Ý ð \ñ ]ô ]ð ]ð ]ð ]r> c ór — t ¦ « } | ¦ « | ¦ « dS )z, Quota synchronization :return: N)r ÚsynchronizeÚsave_user_cache)Úqs r Ú quota_syncrJ t s2 € õ ‰Œ€A؇M‚M�O„O€OØ×ÒÑÔÐÐÐr> c óŽ — t t dd¬¦ « s-t dt z ¦ « t j d¦ « dS dS )zc Check autosynchronization parameter in config file and exit if it`s disabled :return: Úcl_quota_limits_autosyncT)Údefault_valz:cl-quota limits autosynchronization is disabled in config r N)r r rA rB ÚexitrD r> r Úcheck_autosync_disabledrO ~ sL € õ �^Ð-GÐUYÐZÑZÔZð Ý ÐJÍ^Ñ[Ñ\Ô\Ð\ÝŒ�‰Œˆˆˆðð r> c ó, — t j | dg d¢¦ « \ }}n7# t j $ r% t ¦ « t j d¦ « Y nw xY wi }d |d<