| Server IP : 3.96.16.70 / Your IP : 216.73.216.15 Web Server : Apache System : Linux ip-172-31-26-103.ca-central-1.compute.internal 6.1.163-186.299.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Feb 24 16:35:42 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3.9/site-packages/cfnbootstrap/__pycache__/ |
Upload File : |
a
��0i� � @ s� d dl Z d dlZd dlZd dlZd dlmZ d dlmZ e�d�Z dd� Z
ddd�Zg ddfd d
�Zg dfdd�Z
d
d� Zg ddfdd�Zdd� Zdd� ZdS )� N)� ToolError)�
ProcessHelperzcfn.initc C s� d}d}|r>zt �|�d }W n ty< td| ��Y n0 |rtzt�|�d }W n tyr td| ��Y n0 |dks�|dkr�t�d||| � t� | ||� d S )N���� z%s is not a valid user name�%s is not a valid group namez$Setting owner %s and group %s for %s)
�pwd�getpwnam�KeyErrorr �grp�getgrnam�logging�debug�os�lchown)�filenameZ
owner_name�
group_nameZowner_idZgroup_id� r �?/usr/lib/python3.9/site-packages/cfnbootstrap/posix_security.py�set_owner_and_group s r c C s� zFt �| �}|r6t|d �|kr6td| |d |f ��t�d| � W dS tyX Y n0 ddg}|rt|�d|g� |�| � t |��
� }|jr�t�d| � t�d |j
� td| ��nt�d
| � dS dS )
z:Create a group in the OS, returning True if one is createdr z5Group %s exists with gid %s, but gid %s was requestedzGroup %s already existsFz/usr/sbin/groupadd�-rz-gzFailed to create group %szGroupadd output: %szCreated group %s successfullyTN)r
r �strr �logr
r �extend�appendr �call�
returncode�error�stdout�info)r �gidZgroup_record�cmd�resultr r r �create_group- s&