LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-01-2008, 03:23 PM   #1
ufmale
Member
 
Registered: Feb 2007
Posts: 386

Rep: Reputation: 30
mkpath file permission on help


I have a window machine connecting (via samba) to my linux box to create a directory.

From windows, I call mkpath "z:/temp", 0777 inside a perl code.
where z: = /home/user1 is the shared linux drive.

On Linux (redhat), the temp direct created under /home/user1/ has following permission:

drwxr-xr-x 2 user1 user1 4096 May 1 16:15 temp

I want to create a directory with 777 permission, but it didn't work.
In linux, i even call umask to set the permission on the directory:
[user1@comp]$ umask 777

Does anyone know the trick to make the permission to be 777 when creating a directory
 
Old 05-01-2008, 09:45 PM   #2
eggixyz
Member
 
Registered: Apr 2008
Posts: 310

Rep: Reputation: 30
Hey There,

You may be stuck because of the hierarchical directory permissions on Windows, which I don't think Perl can change directly.

It's possible, though, that if you change your umask to "0", rather than "777" that it might help. 777 imposes total restriction (on Unix/Linux it would make your files/dir permissions 000) and 0 doesn't impose any. That's one reason I think the problem might need to be fixed on the windows end.

If that is the case, check out cpan(dot)org or check if active state perl has any modules to help out with setting ACL's on windows through Perl.

Best wishes,

Mike
 
Old 05-02-2008, 12:36 AM   #3
ufmale
Member
 
Registered: Feb 2007
Posts: 386

Original Poster
Rep: Reputation: 30
Change the command to $umask 000 , but still does not work. I still get the same dir permission once it created by mkpath. Not sure yet how to fix in windows.
 
Old 05-04-2008, 10:29 AM   #4
legine
LQ Newbie
 
Registered: Apr 2008
Posts: 10

Rep: Reputation: 0
Doesnt samba has its own rights management?

Speak. In sambaconfiguration you say somewhere what rights the data has? (or defaults too?)

I dont think it is a windows Problem since Windows Rightsmanagement differs a lot from Linux and is controlled by Samba (I believe)

However i am not a samba expert. But Imho thats the direction to look.

Have fun...
 
Old 05-04-2008, 11:26 PM   #5
eggixyz
Member
 
Registered: Apr 2008
Posts: 310

Rep: Reputation: 30
Hey there,

If it's a samba thing, check out "swat" and when you have that up and running choose to show all options. There a ton of them. Perhaps it's in there. Of course, check without showing all options first, because the smb.conf has a ton of them

, Mike
 
Old 05-06-2008, 12:47 PM   #6
ufmale
Member
 
Registered: Feb 2007
Posts: 386

Original Poster
Rep: Reputation: 30
It still have problem.. This problem cause me a lot of pain, that i have to
go to the directory ee and do the chmod -r 777 * every time a new dir under subdirecotry of b1 is created by apache user or mkpath 0777 cmd, say ./b1/john/temp1

Below is my samba setting. Can anyone help me please?

[a1]
comment = a1
path = /home/ee/a1
writeable = yes
guest ok = yes
public = yes
create mask = 0000

[b1]
comment = results
path = /home/ee/a1/b1
writeable = yes
guest ok = yes
public = yes
create mask = 0000
 
Old 05-07-2008, 12:52 AM   #7
legine
LQ Newbie
 
Registered: Apr 2008
Posts: 10

Rep: Reputation: 0
Quote:
Originally Posted by ufmale View Post
It still have problem.. This problem cause me a lot of pain, that i have to
go to the directory ee and do the chmod -r 777 * every time a new dir under subdirecotry of b1 is created by apache user or mkpath 0777 cmd, say ./b1/john/temp1

Below is my samba setting. Can anyone help me please?

[a1]
comment = a1
path = /home/ee/a1
writeable = yes
guest ok = yes
public = yes
create mask = 0000

[b1]
comment = results
path = /home/ee/a1/b1
writeable = yes
guest ok = yes
public = yes
create mask = 0000
How about checking Apache Config? I think that one has also own settings for Rights management... Or why do you talk of apache user :P?
 
Old 05-07-2008, 02:25 AM   #8
eggixyz
Member
 
Registered: Apr 2008
Posts: 310

Rep: Reputation: 30
Hey There,

You may need to set the "directory mask" and change your "create mask" -- Try it with

create mask = 0644
directory mask = 0755

and everything new should be created with those perms.

Hope that helps

, Mike
 
  


Reply

Tags
samba permissions



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
regarding file permission for db2 backup image file lx4all Linux - General 1 12-13-2007 03:37 PM
Changing file permission, How to edit a file? rainchild Linux - Newbie 8 01-14-2007 10:18 PM
change file permission of a mouse device file permanently alexandre_fs Linux - General 5 01-09-2007 06:30 AM
file permission !!! hitesh_linux Linux - General 5 03-25-2003 12:27 PM
File Permission glock19 Linux - General 4 01-02-2002 07:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:15 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