Sponsored Content
Top Forums UNIX for Advanced & Expert Users Testing privileges -lock lockfile /var/lock/subsys/..- Permission denied Post 302557769 by Dedalus on Thursday 22nd of September 2011 05:05:02 AM
Old 09-22-2011
Testing privileges -lock lockfile /var/lock/subsys/..- Permission denied

Hi all,

I have to test some user priviliges. The goal is to be sure that an unauthorized user can't restart some modules (ssh, mysql etc...).
I'm trying to automate it with a shell script but in same cases I got the syslog broadcast message.
Quote:
lockfile /var/lock/subsys/$under_test- Permission denied
Is there any way to simply get a return code (allowed or not) without see the broadcast message on all terminals?

Thanks in advance
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to lock keyboard without using lock command

how can I lock my keyboard while I'm away from the computer without using lock command. What other commands gives me the option to lock keyboard device? thanks (7 Replies)
Discussion started by: dianayun
7 Replies

2. UNIX for Dummies Questions & Answers

Files still being created in /var/spool/mmdf/lock/home

Hi all I need help finding a process that is continuing to create files in the above area. There are three sub folder titled addr q.local and msg . I have already found a process called mmdf running and have used the kill command to stop this from running. I have also looked for sendmail or... (12 Replies)
Discussion started by: TeaMaker
12 Replies

3. HP-UX

How to Lock In HP-UX

Hi , How should i implemet a lock function Hp-ux . I want to a lock a file through fcntl in Hp-ux . But is not locking properly . Thanks Narendra (7 Replies)
Discussion started by: naren_chella
7 Replies

4. Shell Programming and Scripting

Lock for this script

Hi, My requirement is to service a process and below is the script which i wrote for that and works fine, I have kept it in a crontab and running this everyminute, how do I lock this if its already running and i dont want to open if its running and not completed yet. The crontab need to run... (4 Replies)
Discussion started by: strunz
4 Replies

5. Shell Programming and Scripting

lock an account

hi how can I Lock an account, by prepending ”*LK*” to the password field in /etc/shadow. I dont want to use passwd -l . Any idea? (3 Replies)
Discussion started by: tjay83
3 Replies

6. Red Hat

Security Question: Lock after invalid login, Session Lock and Required Minimum Password Length

Hello all, If anyone has time, I have a few questions: How do I do the following in Linux. We are using Red Hat and Oracle Enterprise Linux, which is based on Red Hat too. 1. How to lock the account after a few (like 3) invalid password attempts? 2. How do you lock a screen after 30... (1 Reply)
Discussion started by: nstarz
1 Replies

7. Red Hat

/usr/sbin/crond: can't lock /var/run/crond.pid,

please tell pre-requisite steps to activate cron. i activated the cron but it not executing the script which i set in crontab entry.through root user i passed the service crond start it get start.but when i go to etc/init.d and passed crond stop command.it gets crond: can't lock /var/run/crond.pid,... (2 Replies)
Discussion started by: umair
2 Replies

8. UNIX for Advanced & Expert Users

/var/mail/$LOGINNAME.lock

I'm not able to view my inbox mails, I'm using Thunderbird. I have checked the /var/mail/ directory files. There I saw the lock file. . I have removed the lock file and restarted the Thunderbird, again the lock file is created. I have changed the file group as mail from users. after that... (1 Reply)
Discussion started by: ungalnanban
1 Replies

9. Linux

/var/lock/subsys permission denied for root

Hello I have simple line of code here: FILE *lockfp = fopen("/var/lock/subsys/processName", "w"); which is denied even running as root. The result is locking failed for the following reason: Permission denied How is this possible? Why is this happening? Thanks for your... (4 Replies)
Discussion started by: flagman5
4 Replies

10. UNIX for Advanced & Expert Users

Can't open nodes-6379.conf in order to acquire a lock: Permission denied

I am getting error on redis server on linux 7.5 after change the default path /var/lib/redis to /redisdata, and enable cluster-enabled yes. It would be really appreciate if some one can check and suggest on this issue. error code: 1240:C 09 Sep 2018 13:53:51.058 # oO0OoO0OoO0Oo Redis is... (3 Replies)
Discussion started by: nadeemrafikhan
3 Replies
dotlock(1)							   User Manuals 							dotlock(1)

NAME
lbdb_dotlock - Lock mail spool files. SYNOPSIS
lbdb_dotlock [-t|-f|-u|-d] [-r retries] file DESCRIPTION
dotlock implements the traditional mail spool file locking method: To lock file, a file named file.lock is created. OPTIONS
-t Just try. dotlock won't actually lock a file, but inform the invoking process if it's at all possible to lock file. -f Force the lock. If another process holds a lock on file longer than a certain amount of time, dotlock will break that lock by removing the lockfile. -u Unlock. dotlock will remove file.lock. -d Delete. dotlock will lock file, remove it if it has length 0, and afterwards remove file.lock. -r retries This command line option tells dotlock to try locking retries times before giving up or (if invoked with the -f command line option) break a lock. The default value is 5. dotlock waits one second between successive locking attempts. FILES
file.lock The lock file dotlock generates. SEE ALSO
fcntl(2), flock(2), lockfile(1), lbdb-fetchaddr(1) DIAGNOSTICS
dotlock gives all diagnostics in its return values: 0 - DL_EX_OK The program was successful. 1 - DL_EX_ERROR An unspecified error such as bad command line parameters, lack of system memory and the like has occured. 3 - DL_EX_EXIST The user wants to lock a file which has been locked by another process already. If dotlock is invoked with the -f command line option, dotlock won't generate this error, but break other processes' locks. 4 - DL_EX_NEED_RPIVS This return value only occurs if dotlock has been invoked with the -t command line option. It means that dotlock will have to use its group mail privileges to lock file. 5 - DL_EX_IMPOSSIBLE This return value only occurs if dotlock has been invoked with the -t command line option. It means that dotlock is unable to lock file. NOTES
dotlock tries to implement an NFS-safe dotlocking method which was borrowed from lockfile(1). If the user can't open file for reading with his normal privileges, dotlock will return the DL_EX_ERROR exit value to avoid certain attacks against other users' spool files. The code carefully avoids race conditions when checking permissions; for details of all this see the com- ments in dotlock.c. HISTORY
dotlock is part of the Mutt mail user agent package. It has been created to avoid running mutt with group mail privileges. AUTHOR
Thomas Roessler <roessler@guug.de> Unix OCTOBER 2005 dotlock(1)
All times are GMT -4. The time now is 11:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy