LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-03-2010, 11:10 AM   #1
kais1
Member
 
Registered: Dec 2008
Posts: 61

Rep: Reputation: 17
permission problems in script


Problem with the script :

#!/usr/bin/ksh
echo "************* Bill Printing Extraction Proces *************"

UIDPWD=`cat $MEDT_HOME/restrict/$ORACLE_SID` export UIDPWD


when we use the above,

file is being generated with the below permissions :

-rw-rw---- 1 MEDB dba 213954 Feb 23 13:23 medt-21022010.txt


When we write UIDPWD as hardcode like below:

UIDPWD=MEDGT/******@ORACLE1 export UIDPWD

It extracts files with read permission for OTHER so we can FTP.
-rw-r--r-- 1 MEDB dba 213954 Feb 23 14:23 medt-21022010.txt

We need to run it with no hardcode for UIDPWD and file should have read permission.What am missing here ?


Kai
 
Old 03-03-2010, 11:14 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

Set this as one of the first lines in your script after the hasbang: umask 022

Hope this helps.
 
Old 03-03-2010, 11:15 AM   #3
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
put chmod 644 *.txt in your script ?
 
Old 03-03-2010, 11:58 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,563
Blog Entries: 29

Rep: Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179
Hi Kai

The quoted code does not create any files, it simply envalues a variable with the contents of a file and exports it.

How is the file created? Specifically, how is $UIDPWD passed into the command that creates the file?
 
  


Reply

Tags
permission, umask


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Permission denied executing cgi-script Geminias Linux - Networking 4 07-31-2006 11:02 PM
Shell Script with Root Permission gjagadish Linux - Security 2 02-15-2006 09:38 AM
PHP script permission problem deadlock Linux - Newbie 8 01-11-2006 07:34 AM
Permission change script lluciano Programming 1 10-17-2005 12:39 PM
permission denied when executing my own script Red Squirrel Linux - Newbie 3 03-07-2004 09:21 PM


All times are GMT -5. The time now is 10:15 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration