Nové číslo časopisu Raspberry Pi zdarma ke čtení: Raspberry Pi Official Magazine 168 (pdf).
Open-source citační manažer Zotero (Wikipedie, GitHub) byl vydán v nové major verzi 10. Přehled novinek v příspěvku na blogu.
Interaktivní editor binárních dat GNU poke byl vydán ve verzi 5.0 (seznam změn).
Byla vydána verze 0.85 telnet a ssh klienta PuTTY (Wikipedie). Řešeno je 5 zranitelností.
Byly publikovány novinky z vývoje GIMPu. Pracuje se na novém formátu souborů. Stávající binární XCF bude nahrazen "zazipovaným XML". XCF zůstane plně podporován pouze pro načítání starých souborů.
Workshop o umělé inteligenci v Dartmouthu proběhl před 70 lety, od 18. června do 17. srpna 1956. Dvouměsíční soustředění 6–11 informatiků, iniciované Johnem McCarthym, položilo základy oboru umělé inteligence.
Po 9 týdnech vývoje od vydání Linuxu 7.1 oznámil Linus Torvalds vydání Linuxu 7.2. Podrobný přehled novinek a vylepšení na Linux Kernel Newbies nebo LWN.net: první a druhá polovina začleňovacího okna.
Debian dnes slaví 33 let. Ian Murdock oznámil vydání "Debian Linux Release" 16. srpna 1993.
Probíhá hlasování o používání LLM při vývoji Debianu. Vývojáři Debianu mají na výběr 9 možností (návrhy A až H a žádný z nich).
Omarchy je linuxová distribuce s dlaždicovým správcem oken Hyprland. Založena je na Arch Linuxu. Vydána byla v nové major verzi 4.0.0 - The Quattro Release. Videopředstavení na YouTube. Celý desktop shell byl přepsán do Quickshellu. Přidána byla podpora pluginů.
chrootu můžete posoudit třeba s takovýmto programem:
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <dirent.h>
#include <string.h>
#define CHROOT_TEMP "chroot_temp"
int ls(char *dirname) {
DIR *dir = opendir(dirname);
struct dirent *dirent;
char tmp[4096];
struct stat st;
if (dir == NULL) return -1;
printf("Výpis adresáře '%s'\n", dirname);
while ((dirent = readdir(dir))) {
strcpy(tmp, dirname);
strcat(tmp, "/");
strcat(tmp, dirent->d_name);
lstat(tmp, &st);
if (S_ISDIR(st.st_mode)) printf("d"); else
if (S_ISLNK(st.st_mode)) printf("l"); else
if (S_ISBLK(st.st_mode)) printf("b"); else
if (S_ISCHR(st.st_mode)) printf("c"); else
if (S_ISFIFO(st.st_mode)) printf("p"); else
if (S_ISSOCK(st.st_mode)) printf("s"); else
if (S_ISREG(st.st_mode)) printf("-"); else printf("?");
if (st.st_mode & 00400) printf("r"); else printf("-");
if (st.st_mode & 00200) printf("w"); else printf("-");
if (st.st_mode & 04000)
if (st.st_mode & 00100)
printf("s");
else printf("S");
else
if (st.st_mode & 00100)
printf("x");
else
printf("-");
if (st.st_mode & 00040) printf("r"); else printf("-");
if (st.st_mode & 00020) printf("w"); else printf("-");
if (st.st_mode & 02000)
if (st.st_mode & 00010)
printf("s");
else
printf("S");
else
if (st.st_mode & 00010)
printf("x");
else
printf("-");
if (st.st_mode & 00004) printf("r"); else printf("-");
if (st.st_mode & 00002) printf("w"); else printf("-");
if (st.st_mode & 01000)
if (st.st_mode & 00001)
printf("t");
else
printf("T");
else
if (st.st_mode & 00001)
printf("x");
else
printf("-");
printf(" %2u %6u %6u %10lu %s", st.st_nlink, st.st_uid,
st.st_gid, st.st_size, dirent->d_name);
if (S_ISLNK(st.st_mode)) {
tmp[readlink(tmp, tmp, sizeof(tmp))] = 0;
printf(" -> %s", tmp);
}
printf("\n");
}
return 0;
}
int main() {
int d;
int i;
struct stat fi;
char buf[1024];
printf("Aktuální adresář: %s\n", getcwd(buf, sizeof(buf)));
ls(".");
if (stat("chroot_temp", &fi) < 0)
mkdir("chroot_temp", 0700); /* uděláme si podadresář */
else
if ((fi.st_mode & S_IFDIR) == 0) {
printf("Dočasný adresář '" CHROOT_TEMP "' nelze vytvořit.\n");
return 1;
}
d = open(".", O_RDONLY); /* vytvoříme si návratový bod */
chroot("chroot_temp"); /* zanoříme se do podadresáře */
fchdir(d); /* vyskočíme zpět a chroot pokazíme */
for (i = 0; i < 10000; i++) /* utečeme */
chdir("..");
chroot("."); /* a potvrdíme to */
printf("Aktuální adresář: %s\n", getcwd(buf, sizeof(buf)));
ls(".");
return 0;
}
Prográmek se přeloží a vyzkouší takto:
gcc -static -o chroot_test chroot_test.c chroot `pwd` /chroot_testFungovat to však bude jen se správcovskými právy - to je koneckonců napsáno i v manuálové stránce:
man 2 chroot.
O této problematice najdete více tady a ještě tady.
If the user is root or the program is setuid root, special care must be taken. The setuid function checks the effec- tive uid of the caller and if it is the superuser, all process related user ID's are set to uid. After this has occurred, it is impossible for the program to regain root privileges.
book:/# chroot /tmp/ /chroot_test Aktuální adresár: / Výpis adresáre '.' drwxr-xr-x 3 0 0 42 . drwxr-xr-x 3 0 0 42 .. -rwxr-xr-x 1 1000 100 502147 chroot_test drwx------ 2 0 0 6 chroot_temp Aktuální adresár: / Výpis adresáre '.' drwx------ 2 0 0 6 . drwx------ 2 0 0 6 ..
Tiskni
Sdílej: