Linux Authentication and Access Control 4-2

Total Page:16

File Type:pdf, Size:1020Kb

Linux Authentication and Access Control 4-2 Linux IDs and /etc/passwd Linux Authentication and Each user has a user id (uid) and belongs to (possibly several) groups Access Control each of which has a gid. uid and default gid are stored in /etc/passwd. E.g, in my Fedora VM: root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin adm:x:3:4:adm:/var/adm:/sbin/nologin Tue/Wed/Thu, September 16/17/18, 2014 lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin Reading: Pollock Article; Hacking Linux Exposed sync:x:5:0:sync:/sbin:/bin/sync shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown halt:x:7:0:halt:/sbin:/sbin/halt CS342 Computer Security mail:x:8:12:mail:/var/spool/mail:/sbin/nologin news:x:9:13:news:/etc/news: uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin Department of Computer Science ... Wellesley College lynux:x:500:500:Franklyn Turbak:/home/lynux:/bin/bash gdome:x:501:501:Georgia Dome:/home/gdome:/bin/bash cs342:x:502:502:CS342 Account:/home/cs342:/bin/bash Linux Authentication and Access Control 4-2 /etc/group /etc/shadow /etc/group defines groups and Sysadmins can define new groups, lists which users belong to them. /etc/shadow contains hashed passwords: e.g. on puma root:$1$SdMYD5fz$cr120C7tA0wDhXPrQHc3H1:15583:0:99999:7::: root:x:0:root bin:*:13665:0:99999:7::: bin:x:1:root,bin,daemon • faculty (all cs faculty) daemon:*:13665:0:99999:7::: daemon:x:2:root,bin,daemon • adm:*:13665:0:99999:7::: sys:x:3:root,bin,adm cs111sta (members of the … adm:x:4:root,adm,daemon CS111 teaching staff) lynux:$1$mUwRqvWp$2yfe5MJV0HbtdcDad8E7i/:15583:0:99999:7::: tty:x:5: • cs251stu (cs251 students) gdome:$1$d6tpFiwO$rBD5jd1ASAYatV2UuAlXW.:14274:0:99999:7::: disk:x:6:root cs342:$1$kmTSYJoG$0AnYYfykI2e/nWPRXdjwO.:14194:0:99999:7::: lp:x:7:daemon,lp mem:x:8: kmem:x:9: wheel:x:10:root Your Ubuntu VM uses longer salts and hashes: ... lynux:x:500: wendy:$6$FoFIUVCi$/FUkEldzfdJXMefmv/s76m4wRpeZPnHjsVdJ9pO.QgKWuZmV gdome:x:501: cjt5J53lZ8Sifj9Q3Pm6n6ukR9p8A1\43mnE2Q0:15594:0:99999:7::: cs342:x:502: cs342sta:x:503:cs342,lynux cs342stu:x:504:cs342,gdome,lynux Linux Authentication and Access Control 5-3 Linux Authentication and Access Control 5-4 LDAP Checking/Changing Who You Are Our networked dept. machines now use LDAP, a database system for o whoami: name associated with current uid users/groups that does not use /etc/passwd and /etc/group directly. o groups: groups of which current uid is a member (But you will be using /etc/passwd and /etc/group on the machines you o su username : "become" username administer in E125.) o su - username: "become" username, using initialization files On puma, use getent command to get info from the LDAP database: o su: "become" root (su = superuser) [fturbak@puma ~] getent passwd fturbak o sudo command: Execute command as root fturbak:x:708:708:Franklyn Turbak:/home/fturbak:/bin/bash (if youre in /etc/sudoers and you give your password.) [fturbak@puma ~] getent passwd acarnigl acarnigl:x:4568:4569:Allison Carniglia class of 2013:/students/acarnigl:/usr/local/bin/scponly # /usr/local/bin/scponly only allows SCP, not login access. For 110/111 students [fturbak@puma ~] getent group cs242stu cs242stu:x:4678:networks,fturbak,amckenna,choover,clee2,cvaldes,kneugent,ksulliv3,lbell, gwunnava,skim17 http://xkcd.com/688/ Linux Authentication and Access Control 5-5 Linux Authentication and Access Control 5-6 Checking/Changing Who You Are: Examples sudo in Ubuntu [fturbak@puma ~] whoami fturbak [fturbak@puma ~] echo $UID The culture in Ubuntu is to use sudo rather than su to root. 708 [fturbak@puma ~] groups fturbak faculty cvs lumberjacks cs301stu cs301pri cs301sta itr2004 • Reminds you that you’re doing rooty things: less likely to cs230pri cs230sta cs230stu cs251pri cs251stu … accidentally do something bad (e.g. rm –rf * on /) [fturbak@puma ~] su – gdome Password: ********** • Don’t have to remember root password, only your own. [gdome@puma ~] whoami gdome • Can still become root if you want to (red part not echoed) [gdome@puma ~] echo $UID 707 wendy@cs342-ubuntu-1:~$ sudo su – [gdome@puma ~] groups gdome cs301stu cs230stu cs251stu cs235stu cs242stu [sudo] password for wendy: Tr0ub4dor&3 [gdome@puma ~] su – root@cs342-ubuntu-1:~# Password: ********** [root@puma ~] whoami root [root@puma ~] echo $UID 0 [root@puma ~] groups root bin daemon sys adm disk wheel Linux Authentication and Access Control 5-7 Linux Authentication and Access Control 5-8 passwd: Change Password useradd: Create User Account Sudoer wendy changes guest password (red parts not echoed) Sudoer wendy adds user acct1 wendy@cs342-ubuntu-1:~$! sudo passwd guest wendy@cs342-ubuntu-1:~$! sudo useradd -m -s /bin/bash acct1 [sudo] password for wendy: Tr0ub4dor&3 [sudo] password for wendy: Tr0ub4dor&3 Enter new UNIX password: foobar Retype new UNIX password: foobar • By default, puts user in empty group with same name as user passwd: password updated successfully /etc/passwd now has: acct1:x:1101:1101::/home/acct1:/bin/bash! /etc/group now has: acct1:x:1101: • As root, wouldn’t need extra sudo password • Still need to set password (via passwd); ! in /etc/shadow locks user out: acct1:!:15601:0:99999:7::: • Can change anyone’s password as root • -m creates account /home/acct1 • Anyone change her own password w/o being root. • -s specifies shell program for user. • Many more options; see man useradd • Add user to group sudo to make her a sudoer • There are graphical user interfaces for creating accounts, setting passwords, etc. but you will not have access to these in many contexts (like Capture the Flag contests) So best to learn shell commands instead! Linux Authentication and Access Control 5-9 Linux Authentication and Access Control 5-10 File Permissions in Linux What Do Permissions Mean? [lynux@localhost cs342]$ ls -al handouts total 68 o On file: drwxrwx--- 4 lynux lynux 4096 2008-09-12 07:36 . drwxrwxr-x 6 lynux lynux 4096 2008-09-02 03:08 .. r: can read from file drwxrwx--- 2 lynux lynux 4096 2008-09-02 03:15 course-info -rw-rw---- 1 lynux lynux 638 2008-09-09 08:59 linux-commands.txt w: can write to file -rw-rw---- 1 lynux lynux 12335 2008-09-12 07:33 os-security.txt -rw-rw---- 1 lynux lynux 3073 2008-09-11 21:27 os-security.txt~ x: can execute file as a program drwxrwx--- 2 lynux lynux 4096 2008-09-09 05:38 security o On directory: How do you read a permission string (e.g. drwxrwxr-x, -rw-rw----)? r: can list the filenames in the directory. Leftmost chars: Other 9 chars: w: can add new file and delete existing file read (r), write (w), execute (x) (even if don't have any permissions on file!) - normal file permissions for 3 entities: x: can cd to directory and “search” files in directory d directory • 3 chars for owner (u=user); (i.e., get inode information necessary for file contents.) l link • 3 for group (g); s socket • 3 for everyone else (o=other) Linux Authentication and Access Control 5-11 Linux Authentication and Access Control 5-12 Special permissions Permissions as Bits & Octal Numbers There are 12 (not 9) permission bits in Linux. 11 10 9 8 7 6 5 4 3 2 1 0 11 10 9 8 7 6 5 4 3 2 1 0 set set stic- user user user group group group other other other uid gid key r w x r w x r w x set set stic- user user user group group group other other other uid gid key r w x r w x r w x setuid bit permissions octal setuid bit changes user "x" to "s" -rwxrwxrwx 777 • on executable program: change effective user id (more later) and no "x" to "S" -rwxr-x--- 750 setgid bit setgid bit -rw-r—-r-- 644 • on executable program: change effective group (more later) changes group "x" to "s" -rwsr-sr-- 6754 • on directory: files/subdirectories inherit group and its permissions and no "x" to "S" from directory -rwsr-Sr-- 6744 sticky bit -rwsr-xr-- 4754 sticky bit changes other "x" to "t" -rwxr-sr-- 2754 • on directory: only owner can delete files in the dir (used in /tmp) and no "x" to "T -rwxr-xr-t 1755 -rwxr-xr-T 1754 Linux Authentication and Access Control 5-13 Linux Authentication and Access Control 5-14 Changing File Permissions in Linux Changing File Permissions in Linux (Continued) chmod perms file … : changes file permissions [lynux@localhost handouts]$ chmod u+s os-security.txt; ls -al os-security.txt chmod -R perms file … : changes file permissions recursively -rwsr-xr-- 1 lynux lynux 13290 2008-09-12 07:48 os-security.txt [lynux@localhost handouts]$ chmod g+s os-security.txt; ls -al os-security.txt [lynux@localhost handouts]$ ls -al os-security.txt -rwsr-sr-- 1 lynux lynux 13290 2008-09-12 07:48 os-security.txt -rw-rw---- 1 lynux lynux 13290 2008-09-12 07:48 os-security.txt [lynux@localhost handouts]$ chmod 754 os-security.txt; ls -al os-security.txt [lynux@localhost handouts]$ chmod o+rx os-security.txt; ls -al os-security.txt -rwxr-xr-- 1 lynux lynux 13290 2008-09-12 07:48 os-security.txt -rw-rw-r-x 1 lynux lynux 13290 2008-09-12 07:48 os-security.txt [lynux@localhost handouts]$ chmod 4754 os-security.txt; ls -al os-security.txt [lynux@localhost handouts]$ chmod g-w os-security.txt; ls -al os-security.txt -rwsr-xr-- 1 lynux lynux 13290 2008-09-12 07:48 os-security.txt -rw-r--r-x 1 lynux lynux 13290 2008-09-12 07:48 os-security.txt [lynux@localhost handouts]$ ls -al .
Recommended publications
  • Chrooting All Services in Linux
    LinuxFocus article number 225 http://linuxfocus.org Chrooting All Services in Linux by Mark Nielsen (homepage) About the author: Abstract: Mark works as an independent consultant Chrooted system services improve security by limiting damage that donating time to causes like someone who broke into the system can possibly do. GNUJobs.com, writing _________________ _________________ _________________ articles, writing free software, and working as a volunteer at eastmont.net. Introduction What is chroot? Chroot basically redefines the universe for a program. More accurately, it redefines the "ROOT" directory or "/" for a program or login session. Basically, everything outside of the directory you use chroot on doesn't exist as far a program or shell is concerned. Why is this useful? If someone breaks into your computer, they won't be able to see all the files on your system. Not being able to see your files limits the commands they can do and also doesn't give them the ability to exploit other files that are insecure. The only drawback is, I believe it doesn't stop them from looking at network connections and other stuff. Thus, you want to do a few more things which we won't get into in this article too much: Secure your networking ports. Have all services run as a service under a non-root account. In addition, have all services chrooted. Forward syslogs to another computer. Analyze logs files Analyze people trying to detect random ports on your computer Limit cpu and memory resources for a service. Activate account quotas. The reason why I consider chroot (with a non-root service) to be a line of defense is, if someone breaks in under a non-root account, and there are no files which they can use to break into root, then they can only limit damage to the area they break in.
    [Show full text]
  • The Linux Kernel Module Programming Guide
    The Linux Kernel Module Programming Guide Peter Jay Salzman Michael Burian Ori Pomerantz Copyright © 2001 Peter Jay Salzman 2007−05−18 ver 2.6.4 The Linux Kernel Module Programming Guide is a free book; you may reproduce and/or modify it under the terms of the Open Software License, version 1.1. You can obtain a copy of this license at http://opensource.org/licenses/osl.php. This book is distributed in the hope it will be useful, but without any warranty, without even the implied warranty of merchantability or fitness for a particular purpose. The author encourages wide distribution of this book for personal or commercial use, provided the above copyright notice remains intact and the method adheres to the provisions of the Open Software License. In summary, you may copy and distribute this book free of charge or for a profit. No explicit permission is required from the author for reproduction of this book in any medium, physical or electronic. Derivative works and translations of this document must be placed under the Open Software License, and the original copyright notice must remain intact. If you have contributed new material to this book, you must make the material and source code available for your revisions. Please make revisions and updates available directly to the document maintainer, Peter Jay Salzman <[email protected]>. This will allow for the merging of updates and provide consistent revisions to the Linux community. If you publish or distribute this book commercially, donations, royalties, and/or printed copies are greatly appreciated by the author and the Linux Documentation Project (LDP).
    [Show full text]
  • LM1881 Video Sync Separator Datasheet
    Product Sample & Technical Tools & Support & Folder Buy Documents Software Community LM1881 SNLS384G –FEBRUARY 1995–REVISED JUNE 2015 LM1881 Video Sync Separator 1 Features 3 Description The LM1881 Video sync separator extracts timing 1• AC Coupled Composite Input Signal information including composite and vertical sync, • >10-kΩ Input Resistance burst or back porch timing, and odd and even field • <10-mA Power Supply Drain Current information from standard negative going sync NTSC, • Composite Sync and Vertical Outputs PAL (1) and SECAM video signals with amplitude from • Odd and Even Field Output 0.5-V to 2-V p-p. The integrated circuit is also capable of providing sync separation for non- • Burst Gate or Back Porch Output standard, faster horizontal rate video signals. The • Horizontal Scan Rates to 150 kHz vertical output is produced on the rising edge of the • Edge Triggered Vertical Output first serration in the vertical sync period. A default vertical output is produced after a time delay if the • Default Triggered Vertical Output for Non- rising edge mentioned above does not occur within Standard Video Signal (Video Games-Home the externally set delay period, such as might be the Computers) case for a non-standard video signal. 2 Applications Device Information(1) • Video Cameras and Recorders PART NUMBER PACKAGE BODY SIZE (NOM) SOIC (8) 4.90 mm × 3.91 mm • Broadcasting Systems LM1881 • Set-Top Boxes PDIP (8) 9.81 mm × 6.35 mm • Home Entertainment (1) For all available packages, see the orderable addendum at the end of the data sheet. • Computing and Gaming Applications (1) PAL in this datasheet refers to European broadcast TV standard “Phase Alternating Line”, and not to Programmable Array Logic.
    [Show full text]
  • Process Text Streams Using Filters
    Process Text Streams Using Filters OBJECTIVE: Candidates should should be able to apply filters to text streams. 1 Process Text Streams Using Filters KeyKEY knowledge KNOWLEDGE area(s): AREAS: Send text files and output streams through text utility filters to modify the output using standard UNIX commands found in the GNU textutils package. 2 Process Text Streams Using Filters KEY FILES,TERMS, UTILITIES cat nl tail cut paste tr expand pr unexpand fmt sed uniq head sort wc hexdump split join tac 3 cat cat the editor - used as a rudimentary text editor. cat > short-message we are curious to meet penguins in Prague Crtl+D *Ctrl+D - command is used for ending interactive input. 4 cat cat the reader More commonly used to flush text to stdout. Options: -n number each line of output -b number only non-blank output lines -A show carriage return Example cat /etc/resolv.conf ▶ search mydomain.org nameserver 127.0.0.1 5 tac tac reads back-to-front This command is the same as cat except that the text is read from the last line to the first. tac short-message ▶ penguins in Prague to meet we are curious 6 head or tail using head or tail - often used to analyze logfiles. - by default, output 10 lines of text. List 20 first lines of /var/log/messages: head -n 20 /var/log/messages head -20 /var/log/messages List 20 last lines of /etc/aliases: tail -20 /etc/aliases 7 head or tail The tail utility has an added option that allows one to list the end of a text starting at a given line.
    [Show full text]
  • Software Distributor Administration Guide for HP-UX 11I
    Software Distributor Administration Guide for HP-UX 11i HP Computers Manufacturing Part Number: B2355-90754 June 2002, Edition 3 © Copyright 2002 Hewlett-Packard Company. Legal Notices The information in this document is subject to change without notice. Hewlett-Packard makes no warranty of any kind with regard to this manual, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. Hewlett-Packard shall not be held liable for errors contained herein or direct, indirect, special, incidental or consequential damages in connection with the furnishing, performance, or use of this material. Warranty A copy of the specific warranty terms applicable to your Hewlett-Packard product and replacement parts can be obtained from your local Sales and Service Office. Restricted Rights Legend Use, duplication or disclosure by the U.S. Government is subject to restrictions as set forth in subparagraph (c) (1) (ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013 for DOD agencies, and subparagraphs (c) (1) and (c) (2) of the Commercial Computer Software Restricted Rights clause at FAR 52.227-19 for other agencies. HEWLETT-PACKARD COMPANY 3000 Hanover Street Palo Alto, California 94304 U.S.A. Use of this document and any supporting software media supplied for this pack is restricted to this product only. Additional copies of the programs may be made for security and back-up purposes only. Resale of the programs, in their present form or with alterations, is expressly prohibited. Copyright Notice Copyright 1997-2002 Hewlett-Packard Company. All rights reserved.
    [Show full text]
  • A Brief Introduction to Unix-2019-AMS
    Brief Intro to Linux/Unix Brief Intro to Unix (contd) A Brief Introduction to o Brief History of Unix o Compilers, Email, Text processing o Basics of a Unix session o Image Processing Linux/Unix – AMS 2019 o The Unix File System Pete Pokrandt o Working with Files and Directories o The vi editor UW-Madison AOS Systems Administrator o Your Environment [email protected] o Common Commands Twitter @PTH1 History of Unix History of Unix History of Unix o Created in 1969 by Kenneth Thompson and Dennis o Today – two main variants, but blended o It’s been around for a long time Ritchie at AT&T o Revised in-house until first public release 1977 o System V (Sun Solaris, SGI, Dec OSF1, AIX, o It was written by computer programmers for o 1977 – UC-Berkeley – Berkeley Software Distribution (BSD) linux) computer programmers o 1983 – Sun Workstations produced a Unix Workstation o BSD (Old SunOS, linux, Mac OSX/MacOS) o Case sensitive, mostly lowercase o AT&T unix -> System V abbreviations 1 Basics of a Unix Login Session Basics of a Unix Login Session Basics of a Unix Login Session o The Shell – the command line interface, o Features provided by the shell o Logging in to a unix session where you enter commands, etc n Create an environment that meets your needs n login: username n Some common shells n Write shell scripts (batch files) n password: tImpAw$ n Define command aliases (this Is my password At work $) Bourne Shell (sh) OR n Manipulate command history IHateHaving2changeMypasswordevery3weeks!!! C Shell (csh) n Automatically complete the command
    [Show full text]
  • How the /Etc/Passwd File Relates to the Laua User
    Page 1 (2) System Foundation 9.0 laua User and Group How the /etc/passwd File Relates to the laua User Scenario Most users who need access to the Lawson environment will need to have a user account set up on the Operating System where Lawson System Foundation 9.0 has been installed. Users will need resources allocated to run their jobs and space in the directory structure to store their print files. The user account on the Operating System is what allows the allocation of resources and space. In the example presented in this session, users are associated to the Unix Operating System and setup via the /etc/passwd file. The information stored on the user account in the file is used by Lawson’s Legacy Security System, laua. This scenario will present the /etc/passwd file and highlight the important parts of the user represented in the file and how it relates to user setup. Workflow Step 1 of 3: To verify that a user has an account on the Unix Operating System where the Lawson server resides, view the /etc/passwd file on the Lawson server. To do so, you must first access a command line which can be done either through LID (Lawson Insight Desktop) or through lawterminal which is command line access through the Lawson portal. This demonstration will use LID. First access your command line. Action: Type in 'cd /etc' and press the 'Enter' key. © Copyright Lawson Learning 2008 Page 2 (2) Step 2 of 3: You can use any method you choose to view the file.
    [Show full text]
  • File Permissions Do Not Restrict Root
    Filesystem Security 1 General Principles • Files and folders are managed • A file handle provides an by the operating system opaque identifier for a • Applications, including shells, file/folder access files through an API • File operations • Access control entry (ACE) – Open file: returns file handle – Allow/deny a certain type of – Read/write/execute file access to a file/folder by – Close file: invalidates file user/group handle • Access control list (ACL) • Hierarchical file organization – Collection of ACEs for a – Tree (Windows) file/folder – DAG (Linux) 2 Discretionary Access Control (DAC) • Users can protect what they own – The owner may grant access to others – The owner may define the type of access (read/write/execute) given to others • DAC is the standard model used in operating systems • Mandatory Access Control (MAC) – Alternative model not covered in this lecture – Multiple levels of security for users and documents – Read down and write up principles 3 Closed vs. Open Policy Closed policy Open Policy – Also called “default secure” • Deny Tom read access to “foo” • Give Tom read access to “foo” • Deny Bob r/w access to “bar” • Give Bob r/w access to “bar • Tom: I would like to read “foo” • Tom: I would like to read “foo” – Access denied – Access allowed • Tom: I would like to read “bar” • Tom: I would like to read “bar” – Access allowed – Access denied 4 Closed Policy with Negative Authorizations and Deny Priority • Give Tom r/w access to “bar” • Deny Tom write access to “bar” • Tom: I would like to read “bar” – Access
    [Show full text]
  • 26 Disk Space Management
    26 Disk Space Management 26.1 INTRODUCTION It has been said that the only thing all UNIX systems have in common is the login message asking users to clean up their files and use less disk space. No matter how much space you have, it isn’t enough; as soon as a disk is added, files magically appear to fill it up. Both users and the system itself are potential sources of disk bloat. Chapter 12, Syslog and Log Files, discusses various sources of logging information and the techniques used to manage them. This chapter focuses on space problems caused by users and the technical and psy- chological weapons you can deploy against them. If you do decide to Even if you have the option of adding more disk storage to your system, add a disk, refer to it’s a good idea to follow this chapter’s suggestions. Disks are cheap, but Chapter 9 for help. administrative effort is not. Disks have to be dumped, maintained, cross-mounted, and monitored; the fewer you need, the better. 26.2 DEALING WITH DISK HOGS In the absence of external pressure, there is essentially no reason for a user to ever delete anything. It takes time and effort to clean up unwanted files, and there’s always the risk that something thrown away might be wanted again in the future. Even when users have good intentions, it often takes a nudge from the system administrator to goad them into action. 618 Chapter 26 Disk Space Management 619 On a PC, disk space eventually runs out and the machine’s primary user must clean up to get the system working again.
    [Show full text]
  • How UNIX Organizes and Accesses Files on Disk Why File Systems
    UNIX File Systems How UNIX Organizes and Accesses Files on Disk Why File Systems • File system is a service which supports an abstract representation of the secondary storage to the OS • A file system organizes data logically for random access by the OS. • A virtual file system provides the interface between the data representation by the kernel to the user process and the data presentation to the kernel in memory. The file and directory system cache. • Because of the performance disparity between disk and CPU/memory, file system performance is the paramount issue for any OS Main memory vs. Secondary storage • Small (MB/GB) Large (GB/TB) • Expensive Cheap -2 -3 • Fast (10-6/10-7 sec) Slow (10 /10 sec) • Volatile Persistent Cannot be directly accessed • Directly accessible by CPU by CPU – Interface: (virtual) memory – Data should be first address brought into the main memory Secondary storage (disk) • A number of disks directly attached to the computer • Network attached disks accessible through a fast network - Storage Area Network (SAN) • Simple disks (IDE, SATA) have a described disk geometry. Sector size is the minimum read/write unit of data (usually 512Bytes) – Access: (#surface, #track, #sector) • Smart disks (SCSI, SAN, NAS) hide the internal disk layout using a controller type function – Access: (#sector) • Moving arm assembly (Seek) is expensive – Sequential access is x100 times faster than the random access Internal disk structure • Disk structure User Process Accessing Data • Given the file name. Get to the file’s FCB using the file system catalog (Open, Close, Set_Attribute) • The catalog maps a file name to the FCB – Checks permissions • file_handle=open(file_name): – search the catalog and bring FCB into the memory – UNIX: in-memory FCB: in-core i-node • Use the FCB to get to the desired offset within the file data: (CREATE, DELETE, SEEK, TRUNCATE) • close(file_handle): release FCB from memory Catalog Organization (Directories) • In UNIX, special files (not special device files) called directories contain information about other files.
    [Show full text]
  • Linux Kernel and Driver Development Training Slides
    Linux Kernel and Driver Development Training Linux Kernel and Driver Development Training © Copyright 2004-2021, Bootlin. Creative Commons BY-SA 3.0 license. Latest update: October 9, 2021. Document updates and sources: https://bootlin.com/doc/training/linux-kernel Corrections, suggestions, contributions and translations are welcome! embedded Linux and kernel engineering Send them to [email protected] - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 1/470 Rights to copy © Copyright 2004-2021, Bootlin License: Creative Commons Attribution - Share Alike 3.0 https://creativecommons.org/licenses/by-sa/3.0/legalcode You are free: I to copy, distribute, display, and perform the work I to make derivative works I to make commercial use of the work Under the following conditions: I Attribution. You must give the original author credit. I Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one. I For any reuse or distribution, you must make clear to others the license terms of this work. I Any of these conditions can be waived if you get permission from the copyright holder. Your fair use and other rights are in no way affected by the above. Document sources: https://github.com/bootlin/training-materials/ - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 2/470 Hyperlinks in the document There are many hyperlinks in the document I Regular hyperlinks: https://kernel.org/ I Kernel documentation links: dev-tools/kasan I Links to kernel source files and directories: drivers/input/ include/linux/fb.h I Links to the declarations, definitions and instances of kernel symbols (functions, types, data, structures): platform_get_irq() GFP_KERNEL struct file_operations - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 3/470 Company at a glance I Engineering company created in 2004, named ”Free Electrons” until Feb.
    [Show full text]
  • The AWK Programming Language
    The Programming ~" ·. Language PolyAWK- The Toolbox Language· Auru:o V. AHo BRIAN W.I<ERNIGHAN PETER J. WEINBERGER TheAWK4 Programming~ Language TheAWI(. Programming~ Language ALFRED V. AHo BRIAN w. KERNIGHAN PETER J. WEINBERGER AT& T Bell Laboratories Murray Hill, New Jersey A ADDISON-WESLEY•• PUBLISHING COMPANY Reading, Massachusetts • Menlo Park, California • New York Don Mills, Ontario • Wokingham, England • Amsterdam • Bonn Sydney • Singapore • Tokyo • Madrid • Bogota Santiago • San Juan This book is in the Addison-Wesley Series in Computer Science Michael A. Harrison Consulting Editor Library of Congress Cataloging-in-Publication Data Aho, Alfred V. The AWK programming language. Includes index. I. AWK (Computer program language) I. Kernighan, Brian W. II. Weinberger, Peter J. III. Title. QA76.73.A95A35 1988 005.13'3 87-17566 ISBN 0-201-07981-X This book was typeset in Times Roman and Courier by the authors, using an Autologic APS-5 phototypesetter and a DEC VAX 8550 running the 9th Edition of the UNIX~ operating system. -~- ATs.T Copyright c 1988 by Bell Telephone Laboratories, Incorporated. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopy­ ing, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America. Published simultaneously in Canada. UNIX is a registered trademark of AT&T. DEFGHIJ-AL-898 PREFACE Computer users spend a lot of time doing simple, mechanical data manipula­ tion - changing the format of data, checking its validity, finding items with some property, adding up numbers, printing reports, and the like.
    [Show full text]