\x89PNG\r\n\x1a\n\x00\x00\x00\x0DIHDR\x00\x00\x00\x01\x00 \x00\x00\x01\x08\x06\x00\x00\x00\x1F\x15\xC4\x89\x00\x00\x00 \x0AIDATx\x9Ccb\x00\x00\x00\x06\x00\x03\x1A\x05\x9D\x00\x00 \x00\x00IEND\xAE\x42\x60\x82
| Path : /var/www/html/yedekledb24/DatabaseBackupMaster/ |
|
B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H |
| Current File : /var/www/html/yedekledb24/DatabaseBackupMaster/fix_gpg_encryption_simple.py |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
YedekleDB24 için GPG şifreleme yardımcı fonksiyonlarını güncelleyen script.
Python-GnuPG kütüphanesinin farklı sürümleriyle uyumluluk için güncelleme yapar.
"""
import os
import sys
import logging
import shutil
from pathlib import Path
# Logging yapılandırması
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
def update_encryption_utils():
"""
encryption_utils.py dosyasını en basit yöntemle günceller
"""
# Güncellenecek dosya yolları
encryption_utils_path = "encryption_utils.py"
encryption_utils_simplified_path = "encryption_utils_simplified.py"
for file_path in [encryption_utils_path, encryption_utils_simplified_path]:
if not os.path.exists(file_path):
logger.warning(f"Dosya bulunamadı: {file_path}")
continue
# Dosyayı yedekle
backup_path = f"{file_path}.bak"
shutil.copy2(file_path, backup_path)
logger.info(f"Yedek oluşturuldu: {backup_path}")
try:
with open(file_path, 'r', encoding='utf-8') as f:
content = f.read()
# gnupghome -> homedir olarak değiştir
content = content.replace("gnupg.GPG(gnupghome=", "gnupg.GPG(homedir=")
# ignore_homedir_permissions ekle
content = content.replace("gpg = gnupg.GPG(homedir=gpg_home_dir)",
"gpg = gnupg.GPG(homedir=gpg_home_dir)\n gpg.ignore_homedir_permissions = True")
# Değişiklikleri kaydet
with open(file_path, 'w', encoding='utf-8') as f:
f.write(content)
logger.info(f"Dosya başarıyla güncellendi: {file_path}")
except Exception as e:
logger.error(f"Dosya güncellenirken hata oluştu: {str(e)}")
# Hata durumunda yedeği geri yükle
if os.path.exists(backup_path):
shutil.copy2(backup_path, file_path)
logger.info(f"Yedek geri yüklendi: {backup_path} -> {file_path}")
def main():
"""Ana fonksiyon"""
logger.info("GPG şifreleme fonksiyonlarını güncelleme başlatılıyor...")
update_encryption_utils()
logger.info("GPG şifreleme fonksiyonları güncelleme tamamlandı.")
if __name__ == "__main__":
main()