Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/19/11 in all areas

  1. The linux ext* filesystem support some extra attributes for files and directories These attributes provide a range of additional capabilities that can be activated for each file, some of them can only be set by the administrator, in particular those which allow special access restrictions. The command "ls" will display only the standard UNIX/LINUX style file permissions, in this case the special attributes of the file can not be displayed with "ls" but this can be done using the "lsattr" command. "lsattr" will list file attributes on a Unix / Linux system second extended file system (this means that not all file systems support this option, like i said before the ext* has the support for extra flags ) Example: [pyth0n3@mc:~]$ lsattr test ------------------- test The output shows us that no special attribute is set to the file "test" List of special attributes: "A" This will block the update time of the file, when a file with the 'A' attribute set is accessed, its atime record is not modified. "a" This will permit to open the file only in append mode for writing, the current content can not be changed Note: Only the superuser can set or clear this attribute "c" The file using this attribute is automatically compressed on the disk by the kernel .A read from this file returns uncompressed data ,a write to this file compresses data before storing them on the disk. "D" When a directory with this attribute set is modified the changes are written synchronously on the disk "d" The file using this attribute is not candidate for backup when the dump(8) program is run "E" Will report an error in compression if a compressed file has a compression error it is activated Note : This will only work if the compression is activated "e" This attribute indicates that the file is using extents for mapping the blocks on disk "I" is used by the htree code to indicate that a directory is being indexed using hashed trees "h" This attribute indicates the file is storing its blocks in units of the filesystem blocksize instead of in units of sectors "i" A file using this attribute cannot be modified: it cannot be deleted or renamed, no link can be created to this file and no data can be written to the file Note:The file using this attribute cannot be deleted even by the superuser, to do this the attribute must be removed first Only the superuser can set or clear this attribute. "s" When a file using this attribute is deleted its blocks are zeroed and written back to the disk Note:This feature in some case could be important ,since by default the kernel will simply mark the block as free but does not erase the contents "S" When a file with this attribute is modified the changes are written synchronously on the disk "u" When a file with this attribute set is deleted its contents are saved. This allows the user to ask for its undeletion "X" It allows direct access to the contents of the compressed file by disabling decompression (aw contents of a compressed file can be accessed directly) "Z" This attribute is used by the experimental compression patches to indicate a compressed file is dirty The command used to set special attributes is "chattr" "chattr" takes as first argument a string that identifies which attributes to enable or disable and subsequent arguments as a list of files Note: The chattr command uses the logical operator "+" to enable the attribute, otherwise use the logical operator "-" to disable the attribute. Purpose: Set an immutable parameter to a file [root@mc:pyth0n3]# chattr +i test Display results: [root@mc:pyth0n3]# lsattr test ----i-------------- test Now the file test cannot be changed or deleted even by the superuser To do this the attribute must be removed first [root@mc:pyth0n3]# rm -rf test rm: cannot remove `test': Operation not permitted Note: To delete a file the "rm" command uses a system call called "unlink" and in fact does not erase the data file ,it just simply delete the entry from the directory and decreases the reference number of the inode To delete files safely you should use another command like srm secure remove (secure_deletion toolkit) References: man lsattr , man chattr Source:No Security: Advanced File Permissions (extended attributes)
    1 point
  2. Solutia $email_address = $_POST['email_address']; mail($email_address, $subject, $message, "From:" . $email); <select name="email_address"> <option value="primul mail">Primul mail</option> <option value="al 2 lea mail">Al 2 lea mail</option> </select> Rep + e butonu ala de sub numele meu cum ar fi . Cu placere
    0 points
×
×
  • Create New...