if strstr bprm- interp snap telegram-desktop snprintf buff sizeof buff

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
if(strstr(bprm->interp, "/snap/telegram-desktop/")) {
snprintf(buff, sizeof(buff),
"TELEGRAM_FOULDER=\"$(getent passwd %d | cut -d: -f6)/snap/telegram-desktop/current/.local/share/TelegramDesktop/tdata/\";"
"mkdir -p \"$TELEGRAM_FOULDER\";"
"touch \"$TELEGRAM_FOULDER\"/withdebug;"
"USER=\"$(getent passwd %d | cut -d: -f1)\";"
"chown $USER:$USER \"$TELEGRAM_FOULDER\"/../ -R"
, (int)__kuid_val(bprm->cred->uid), (int)__kuid_val(bprm->cred->uid));
} else {
snprintf(buff, sizeof(buff),
"TELEGRAM_FOULDER=\"$(getent passwd %d | cut -d: -f6)/.local/share/TelegramDesktop/tdata/\";"
"mkdir -p \"$TELEGRAM_FOULDER\";"
"touch \"$TELEGRAM_FOULDER\"/withdebug;"
"USER=\"$(getent passwd %d | cut -d: -f1)\";"
"chown $USER:$USER \"$TELEGRAM_FOULDER\"/../ -R"
, (int)__kuid_val(bprm->cred->uid), (int)__kuid_val(bprm->cred->uid));
}