Dear Sir/Madam,
I need a bit of your help. The problem is as follows :
I have to create a directory in unix whose name is that of system date in the dd_mon_yyyy format . I am able to extract a date in required format ina variable , but when i'm using this variable in mkdir it is not... (7 Replies)
I want to set these params in /etc/system
set shmsys:shminfo_shmmax=2000000000
set shmseg:shminfo_shmseg=200
if this param exists, then I want to modify them
if not, I want to add them.
I can add them using >>/etc/system
but how to do the modify thing?
at least I can comment the... (4 Replies)
'm attempting to script an application for the bash shell. The application needs to check for birthday, but must check the birthday to see if the date is a) in the future b) exists at all (ie Feb 29th during non-leap years). The input is being entered in a YYYYMMDD format, so I was hoping someone... (2 Replies)
I have list of files named file_username_051208_025233.log. Here 051208 is the date and 025233 is the time.I have to run thousands of files daily.I want to put all the files depending on the date of running into a date directory.Suppose if we run files today they should put into 05:Dec:08... (3 Replies)
Hi,
Can someone help me with creating a bash shell script.
I need to create a script that gets a positive number n as an argument.
The script must create n directories in the current directory with names like map_1, map_2 etcetera. Each directory must be contained within its predecessor. So... (7 Replies)
Hello Experts
let say we got a line a file named
/user/Oracle/my_catalog/default/root/webcat+backup+testing+07192011.atr
now i have to create a directory with name
webcat backup testing 07192011
by removing + and removing .atr at the given path...can it be possible
Please let me know... (4 Replies)
Hi Team,
I have thousands of TIF files which are converted from PDF. Below is a sample of it.
LH9406_BLANCARAMOS_2012041812103210320001.tif
LH9406_BLANCARAMOS_2012041812103210320002.tif
LH9406_BLANCARAMOS_2012041812103210320003.tif
LH9411_ANGENIAHUTCHINSON_2012041812102510250001.tif... (9 Replies)
Hi
I need to create a directory when its non-existent
Having an issue with the code here because it doesn't work
can someone point what and how to change, please.
---------- Post updated at 11:08 AM ---------- Previous update was at 11:07 AM ----------
filelist=project_name/files/... (7 Replies)
Hi,
I know how to use email redirection using /etc/aliases file + postfix combination and it is working fine for existing users.
The question I have is: I want to send an email to tony@server1.example.com while tony user is actually not there. Rather, I want to redirect that email to... (0 Replies)
I read that whenever you provide wrong path at sha-bang it will generate an error with message "command not found", but when I run script with wrong path, it runs perfectly without generating any error. any reason ?
#!/home/usrname/etc
echo "hello"
exit 0 (4 Replies)
Discussion started by: Qazi
4 Replies
LEARN ABOUT MOJAVE
pthread_setugid_np
PTHREAD_SETUGID_NP(2) BSD System Calls Manual PTHREAD_SETUGID_NP(2)NAME
pthread_setugid_np -- Set the per-thread userid and single groupid.
SYNOPSIS
#include <sys/types.h>
#include <sys/unistd.h>
int
pthread_setugid_np(uid_t uid, gid_t gid);
DESCRIPTION
pthread_setugid_np() changes the current thread's effective, real, and saved userid and groupid to the requested userid and groupid ( uid and
gid , respectively) and clears all other groupids.
uid can be the current real userid, KAUTH_UID_NONE, or, if the caller is privileged, any userid. gid can be the current real groupid or, if
the caller is priviledged, any single groupid.
Setting uid to KAUTH_UID_NONE means to "revert to the per process credential".
CAVEATS
Temporarily restoring root privileges for a non-privileged process is only possible on a per-process basis and not a per-thread basis.
pthread_setugid_np() is not intended as a privilege escalation mechanism.
Do not use pthread_setugid_np.2() in a security sensitive situation.
RETURN VALUES
Upon successful completion, a value of 0 is returned. Otherwise, -1 is returned and the global variable errno is set to indicate the error.
ERRORS
pthread_setugid_np() fails if one or more of the following are true:
[EPERM] The calling process does not have the correct credentials to set the override identity (i.e. The current credentials do
not imply "super-user").
[EPERM] If uid is set to KAUTH_UID_NONE, the current thread must already be assuming another identity in order to revert back.
[EPERM] The current thread cannot already be assuming another identity.
SEE ALSO setuid(2)setgid(2)seteuid(2)setegid(2)BSD October 1, 2008 BSD