View Full Version : umask su ext4
stefanoxjx
12-11-2010, 17:36
Ciao a tutti, volevo chiedere se è possibile impostare umask=000 su una partizione in modo che qualsiasi file creato da qualsiasi utente abbia tutti i diritti di lettura/scrittura/esecuzione.
Ho fatto varie prove, ma non riesco proprio a trovare una soluzione a questo problema :(
per i file non puoi avere un permesso piu alto di 666, se non a mano
per i file il bit di esecuzione non viene impostato con qualsiasi mask
stefanoxjx
12-11-2010, 19:00
ah ok, forse era li che sbagliavo.
Su fstab mettevo umask=000 e in quel modo iniziava a darmi problemi nel mount del volume.
Ora provo con 666 :sperem:
Grazie.
Ciao.
stefanoxjx
12-11-2010, 19:52
Ho provato a cambiare il valore su umask, ma non mi monta più il volume dandomi degli errori.
In cosa sbaglio?
la riga di fstab è questa:
UUID=ee2c5c77-979e-475c-8e13-d510034bfec9 /dati ext4 defaults,umask=111 0 2
C'è forse qualche altro parametro da mettere in combinata con umask?
la regola per i file e':
file 666 - umask = risultato permessi
che errore ti da quando hai messo umask=000 ?
http://www.cyberciti.biz/tips/understanding-linux-unix-umask-value-usage.html
stefanoxjx
12-11-2010, 21:32
la regola per i file e':
file 666 - umask = risultato permessi
che errore ti da quando hai messo umask=000 ?
Questo è il messaggio:
mount: tipo fs errato, opzione non valida, superblocco su /dev/sda6 danneggiato,
codepage o programma ausiliario mancante, o altro errore
In alcuni casi si possono trovare informazioni utili in syslog. Provare
ad esempio 'dmesg | tail'
Con dmesg, trovo questo:
EXT4-fs (sda6): Unrecognized mount option "umask=022" or missing value
Ora umask è 022 perchè ho provato a cambiare il valore, ma comunque da l'errore con qualsiasi valore.
e senza il parametro "umask" viene montato?
p.s.
nel man di mount per ext4 (Mount options for ext4)
non vedo il parametro: umask
stefanoxjx
12-11-2010, 22:01
e senza il parametro "umask" viene montato?
Si, senza nessun problema.
p.s.
nel man di mount per ext4 (Mount options for ext4)
non vedo il parametro: umask
prova a vedere sul tuo man
stefanoxjx
12-11-2010, 22:08
prova a vedere sul tuo man
Già guardato, però su man fstab non c'è nessun riferimento a umask, mentre su man umask c'è questo ma non mi dice nulla di più di quello che già so:
UMASK(2) Linux Programmer's Manual UMASK(2)
NAME
umask - set file mode creation mask
SYNOPSIS
#include <sys/types.h>
#include <sys/stat.h>
mode_t umask(mode_t mask);
DESCRIPTION
umask() sets the calling process's file mode creation mask (umask) to mask & 0777 (i.e., only the file permission bits of mask are used), and returns the previous value
of the mask.
The umask is used by open(2), mkdir(2), and other system calls that create files to modify the permissions placed on newly created files or directories. Specifically,
permissions in the umask are turned off from the mode argument to open(2) and mkdir(2).
The constants that should be used to specify mask are described under stat(2).
The typical default value for the process umask is S_IWGRP | S_IWOTH (octal 022). In the usual case where the mode argument to open(2) is specified as:
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH
(octal 0666) when creating a new file, the permissions on the resulting file will be:
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
(because 0666 & ~022 = 0644; i.e., rw-r--r--).
RETURN VALUE
This system call always succeeds and the previous value of the mask is returned.
CONFORMING TO
SVr4, 4.3BSD, POSIX.1-2001.
NOTES
A child process created via fork(2) inherits its parent's umask. The umask is left unchanged by execve(2).
The umask setting also affects the permissions assigned to POSIX IPC objects (mq_open(3), sem_open(3), shm_open(3)), FIFOs (mkfifo(3)), and Unix domain sockets
(unix(7)) created by the process. The umask does not affect the permissions assigned to System V IPC objects created by the process (using msgget(2), semget(2),
shmget(2)).
SEE ALSO
chmod(2), mkdir(2), open(2), stat(2)
COLOPHON
This page is part of release 3.24 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.ker‐
nel.org/doc/man-pages/.
stefanoxjx
12-11-2010, 22:21
Facendo varie ricerche su internet, vedo che umask viene sempre usato con vfat e ntfs.
Non è che sia utilizzabile solo con questi due tipi di filesystem?
E se così fosse, vuoi che non ci sia il modo di creare in automatico file e cartelle con determinati diritti anche su altri tipi di filesystem? :confused:
dal man di mount sembra proprio cosi'
Mi pare di ricordare che umask funzioni solo fino a ext2....
vBulletin® v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.