Create permissions
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Create permissions




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Create permissions  
fazlin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-07-07 01:01 AM

Hi all,

This may be a silly question but plz help me out on this.

I have a directory that is group writable and if i create/copy a file
in the directory, it has the following permissions:

-rw-r--r--   1 fazlin   ukp            0 Jan  4 13:10 test

The issue is that whenever i create/copy files in that directory it has
to be group writable.

Plz lemme know the possible solutions.

Thanks,
Fazlin






[ Post a follow-up to this message ]



    Re: Create permissions  
Pascal Bourguignon


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-07-07 01:01 AM

"fazlin" <fazlincse@gmail.com> writes:

> Hi all,
>
> This may be a silly question but plz help me out on this.
>
> I have a directory that is group writable and if i create/copy a file
> in the directory, it has the following permissions:
>
> -rw-r--r--   1 fazlin   ukp            0 Jan  4 13:10 test
>
> The issue is that whenever i create/copy files in that directory it has
> to be group writable.
>
> Plz lemme know the possible solutions.

The users must set their umask to 002 to have the files created with 664.

With a directory that is group writeable, the users of the group can
still rename and delete that file.  So you may change your application
to do that, instead of trying to append or overwrite the files (at
least when it hasn't write access right on the file).

Or, you could have a daemon that watches for bad access rights in the
directory, and set them right.

A worst case alternative is to make the program suid. (the program
that needs to update or overwrite these files, if this is a specific
program).

Also, instead of letting users do random things in this directory,
restrict its access rights and provide a specific tool to access it
(to copy or update files in it).  You can set the directory 700 and
use a specific owner, and the tool can be owned by the same specific
owner and suid.  So normal users cannot access the contents of the
directory, and the tool can set the access rights as it wants.


--
__Pascal Bourguignon__                     http://www.informatimago.com/

"This statement is false."            In Lisp: (defun Q () (eq nil (Q)))





[ Post a follow-up to this message ]



    Re: Create permissions  
Bo Yang


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-07-07 01:01 AM

fazlin :
> Hi all,
>
> This may be a silly question but plz help me out on this.
>
> I have a directory that is group writable and if i create/copy a file
> in the directory, it has the following permissions:
>
> -rw-r--r--   1 fazlin   ukp            0 Jan  4 13:10 test
>
> The issue is that whenever i create/copy files in that directory it has
> to be group writable.
>
> Plz lemme know the possible solutions.
>
> Thanks,
> Fazlin
>
I think there must a group sticky bit set in your directory!
run the following commands and paste your result here:
ls -ld your directory





[ Post a follow-up to this message ]



    Re: Create permissions  
Pascal Bourguignon


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-07-07 01:01 AM

Bo Yang <struggle@mail.nankai.edu.cn> writes:

> fazlin : 
> I think there must a group sticky bit set in your directory!
> run the following commands and paste your result here:
> ls -ld your directory

This is good to keep the created files inside the same group.  But it
won't matter when you move files there, or for the access rights.


[pjb@thalassa tmp]$ ls -la example/
total 108
drwxr-sr-x    2 pjb      users        4096 Jan  4 12:35 ./
drwxrwxrwt   33 root     root       102400 Jan  4 12:36 ../
[pjb@thalassa tmp]$ touch example/abc
[pjb@thalassa tmp]$ ls -la example/
total 108
drwxr-sr-x    2 pjb      users        4096 Jan  4 12:36 ./
drwxrwxrwt   33 root     root       102400 Jan  4 12:36 ../
-rw-r--r--    1 pjb      users           0 Jan  4 12:36 abc
[pjb@thalassa tmp]$ touch def
[pjb@thalassa tmp]$ mv def example/
[pjb@thalassa tmp]$ ls -la example/
total 108
drwxr-sr-x    2 pjb      users        4096 Jan  4 12:37 ./
drwxrwxrwt   33 root     root       102400 Jan  4 12:37 ../
-rw-r--r--    1 pjb      users           0 Jan  4 12:36 abc
-rw-r--r--    1 pjb      pjb             0 Jan  4 12:37 def


--
__Pascal Bourguignon__                     http://www.informatimago.com/
Litter box not here.
You must have moved it again.
I'll poop in the sink.





[ Post a follow-up to this message ]



    Re: Create permissions  
Daniel Molina Wegener


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-13-07 12:23 PM

fazlin wrote:

> Hi all,

Hello...

>
> This may be a silly question but plz help me out on this.

Not at all...

> I have a directory that is group writable and if i create/copy a file
> in the directory, it has the following permissions:
>
> -rw-r--r--   1 fazlin   ukp            0 Jan  4 13:10 test
>
> The issue is that whenever i create/copy files in that directory it has
> to be group writable.
>
> Plz lemme know the possible solutions.

Ok, try reading the following man pages for C interfaces:
umask(2), chmod(2), fchmod(2), chown(2)

And the following man pages for the command line utilities:
umask, chmod, chown

>
> Thanks,
> Fazlin

Regards,
--
.O. | Daniel Molina Wegener   | C/C++ Developer
.O | dmw [at] unete [dot] cl | FOSS Coding Adict
OOO | BSD & Linux User        | Standards Rocks!






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:42 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register