The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ld: fatal: relocations remain against allocatable but non-writable sections tdallagn SUN Solaris 0 05-21-2008 08:58 AM
make a recovery CD/DVD - system has no writable devices stevek007 AIX 0 09-17-2007 07:08 AM
How to find world writable files? (AIX) matifr AIX 1 01-19-2006 11:29 AM
how to check whether a directory is writable ropers Shell Programming and Scripting 14 03-22-2004 12:44 PM
Multiple protected directories ericg UNIX for Dummies Questions & Answers 2 06-10-2002 11:58 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 3.00 average. Display Modes
  #1 (permalink)  
Old 10-28-2008
Smoker's Avatar
Smoker Smoker is offline
Registered User
  
 

Join Date: May 2005
Posts: 12
writable protected file

Greetings

I am trying to create a solution that will log information into a file. That is the easy part.

What I am trying to do is have a front end script that ill ask a user what their reasoning is for logging in and log that reason into a file. The hard part I am finding is that I need that file to be such that the user can not modify it.

My first thought is that if the file can be written to then it can be modified but I wanted to ask here to see if this is possible.
  #2 (permalink)  
Old 10-28-2008
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,960
Not sure I understand.

What do you mean by reason should be logged but user should not be able to modify that ?

One thing that I could think of is,
run the logging script as a different user - then its done
  #3 (permalink)  
Old 10-28-2008
Smoker's Avatar
Smoker Smoker is offline
Registered User
  
 

Join Date: May 2005
Posts: 12
When a user logs in, there is a script that is run which prompts for a reason that they are logging in. That reason should then be logged in a file that is "protected". So that it can not be modified.
  #4 (permalink)  
Old 10-28-2008
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2005
Location: Switzerland - GE
Posts: 1,585
More:
How will the front end script be called?
If the user can find out and look at it, he will know the name of the logfile... and yes if you can write to it you can modify it...
  #5 (permalink)  
Old 10-28-2008
Smoker's Avatar
Smoker Smoker is offline
Registered User
  
 

Join Date: May 2005
Posts: 12
The script is called via exec with traps from the user's .profile.
  #6 (permalink)  
Old 10-28-2008
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,246
You could simply use the "logger" command with an appropriate priority in the script and use syslog to handle the logging part. That should resolve the issue you are having.
  #7 (permalink)  
Old 10-28-2008
Smoker's Avatar
Smoker Smoker is offline
Registered User
  
 

Join Date: May 2005
Posts: 12
Quote:
Originally Posted by reborg View Post
You could simply use the "logger" command with an appropriate priority in the script and use syslog to handle the logging part. That should resolve the issue you are having.
hmmmm good lead, however it will only log to the syslog. Would be perfect if I could specify a file to write the message to.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:45 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0