LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 12-14-2004, 06:26 PM   #1
skel
Member
 
Registered: Jan 2004
Distribution: Slackware 10 ; Gentoo ; OpenBSD 3.6
Posts: 101

Rep: Reputation: 15
default permissions


Is there any way to set the default permissions on a new file that is created?

What I want is for users that are not the owner or in the group to have no rwx access to the file that is created.
 
Old 12-14-2004, 06:27 PM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Code:
UMASK(2)                   Linux Programmer's Manual                  UMASK(2)



NAME
       umask - set file creation mask

SYNOPSIS
       #include <sys/types.h>
       #include <sys/stat.h>

       mode_t umask(mode_t mask);

DESCRIPTION
       umask sets the umask to mask & 0777.

       The  umask  is  used  by  open(2)  to set initial file permissions on a
       newly-created file.  Specifically, permissions in the umask are  turned
       off  from  the  mode  argument  to open(2) (so, for example, the common
       umask default value of 022 results in new files being created with per-
       missions  0666  &  ~022  = 0644 = rw-r--r-- in the usual case where the
       mode is specified as 0666).

RETURN VALUE
       This system call always succeeds and the previous value of the mask  is
       returned.

CONFORMING TO
       SVr4, SVID, POSIX, X/OPEN, BSD 4.3

SEE ALSO
       creat(2), open(2)



Linux                             1998-08-09                          UMASK(2)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
default permissions crane Linux - Security 1 01-01-2005 12:36 PM
Oh no! Default permissions? Loiosh Fedora 5 12-17-2004 11:35 PM
what are default permissions for /etc timsch75 Slackware 2 08-06-2004 10:34 PM
what are the default permissions figmentium Linux - Newbie 4 12-25-2003 06:50 AM
Need someone to let me know certain default permissions. Nu-Bee Linux - General 2 11-27-2003 07:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration