thanks dpiniella.
i add umask 0000 to .shrc and when i re logged back in and my umask is 0000.
however, the file permission is rw-rw-rw, but i need it to be rwxr-xr-x.
what else should i do.
thanks
Main Topics
Browse All Topicsi am working on a web project that runs on freebsd.
currently all the file that created dynamically by the internet user (they upoad file through web browser) has a default file permission of 0644.
however, i need these files to have a default extension of 0755 in order to have my perl code working.
i changed the umask from 022 to 000 for both user and root and nothing happens. every time i re-logged back in and my umask number stays the same.
i am very confuse and don't know what to do.
thanks for anybody that can give me a hand.
thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
you don't need to have execute rights on a file to chmod it -- you need to either own it or be part of the group that owns it:
[root@here ~]# ls -la hello
-rw-r--r-- 1 root root 0 Mar 13 15:43 hello
[root@here ~]# chmod 755 hello
[root@here ~]# ls -la hello
-rwxr-xr-x 1 root root 0 Mar 13 15:43 hello
[root@here ~]#
> actually i am looking for something similiar to umask that allow every new file that the internet user create will have a default execute permission.
this will not happen
umask masks out some bits for files
if creator program does not want +x bit, then umask is of no help
compilers do produce +x files, editors do not.
Perl was not mentioned.
Perl behaves like editor. It can set permissions http://www.perl.com/doc/ma
Compilers do create executables and mark them so.
the chmod does not work in this case.
the internet user upload the file. once the file is upload, the file's owner become "UserA" and the perl script can't chmod because it does not own the file and does not have execute permission.
thus, i like to have the default execute permission turn on. in this case, the perl script can chmod it.
thanks
thanks gheist.
i got the site command to work, but i didn't see anything that involves w/ anti-idle and chmod
but i did find the following information, not sure if it is useful.
ServerRoot /www/vapache/userA
User userA
Group userA
Include conf/main.conf
PidFile /www/vapache/userA/logs/ht
ErrorLog /www/vapache/userA/logs/er
ScoreboardFile /www/vapache/userA/httpd.s
<Directory /www/virtual/userA>
Options +Includes +ExecCGI
</Directory>
telnet ftp.server.dom 21
USER username
PASS password
HELP SITE
<post this response>
SITE HELP
<post this response>
QUIT
...
httpd was not involved in question, so keep it off the discussion.
when i ssh into my server and su to super user.
i type "help site"
help: Command not found.
i type "site help"
site: Unknown command 'h'
but when i type "site"
Usage: site <command> <site> [<username> {<ip>}]
d Dump site configuration
a <site> <username> [<ip>]
Add VirtualHost
x <site>
Remove VirtualHost
q <username>
Query user configuration
Q <site> [<parameter>]
Query VirtualHost configuration
e <site> <username>
Extended recursive query
E <site> <username>
Extended recursive query (2)
i <ip>
Query sites using an IP address
r <site> <username> [<ip>]
Reassign IP address as single listener of ip
R <username> <old ip> [<new ip>]
Replace all instances of oldip with newip
s <site>
Suspend site on system
u <site>
Unsuspend site on system
S <user>
Suspend all user's sites
U <user>
Unsuspend all user's sites
That will look like this (colon prepended to what you have to type):
( example taken from actual FreeBSD system, usernames/hostnames replaced)
> telnet ftp.server.dom 21
220 ftp.server.dom FTP server (Version 6.00LS) ready.
:USER xxx
331 Password required for xxx.
:PASS xxx
230 User xxx logged in.
:HELP SITE
214- The following SITE commands are recognized (* =>'s unimplemented).
MD5 UMASK IDLE CHMOD HELP
214 Direct comments to ftp-bugs@ftp.server.dom.
:SITE HELP
214- The following SITE commands are recognized (* =>'s unimplemented).
MD5 UMASK IDLE CHMOD HELP
214 Direct comments to ftp-bugs@ftp.server.dom.
:SYST
215 UNIX Type: L8 Version: BSD-199506
:QUIT
221 Goodbye.
>
So you have chmod command server over FTP
type
SITE CHMOD 0777 filename.xxx
inside raw ftp session.
If your default FTP client does not support raw commands, use ncftp or lftp that do even instrument SITE CHMOD using chmod ftp client command. In Windows 3.11 ftp client raw commands can be entered using "lit" command
SYST is used for server type autodetection by most of smarter FTP Client software, yours look good enough - just UNIX, no MVS, windows or whatever.
i can NOT use chmod.
the problem current is that when an internet user upload a file by using web browser such as IE or firefox, the perl script will receive that file. however, when the file is created by perl script, it is default to userA and w/ permission of 0644. since the file is created w/ 0644 and the owner of file is not internet user or perl script, the chmod will not work because it does not have any execute permission on it. so my question is how to turn on the default execute permission.
currently i played w/ umask, w/ umask 022, i get 0644 and w/ umask 000, i get 0666.
thus, i am looking for a way to turn on the default execute permission.
thanks
i didn't create it this way. this comes as a default.
i believe the server admin did this part, i am just a programmer.
currently i think the quickest way to fix this is to have all files created w/ default execute permission.
in order to have chmod work on any files regardless of ownership is to have all files comes w/ default execute permission.
thus instead of created a file w/ default permission of 0644, i need it to have 0755.
thanks
i can't use site chmod of my ftp client to do this becaus everything should be automated.
imagine an internet user upload 2 ~ 3 files a day, i don't want to ftp in and chmod everyday.
thus, the only solution of doing this is to have all files created default w/ execute permission and perl script will chmod the file everytime an user upload a file.
Business Accounts
Answer for Membership
by: dpiniellaPosted on 2006-03-12 at 18:34:30ID: 16170898
change the umask of the user in their shell rc file so that it's permanent
if it's an script that creates the files, make the script su to a user and change to the umask you need before creating the files (or have it chmod the permissions after everything's done).