07-19-2011
sudo requires you to prefix every command you want to execute as root. Just because it's been called once doesn't mean the rest of the terminal session has elevated privileges too.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello Again,
Those that have noticed my earlier posts will know that I have succesfully installed Solaris 8 onto my pc. I haven't been able to get x-server working (i think it doesn't like my video card) though I've been able to log into root (with a bit of help from unix forums :o ) and have... (2 Replies)
Discussion started by: timresh
2 Replies
2. Programming
#include <stdio.h>
#include <sys/types.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
struct stat s;
main() {
char c;
if (fork()==0) {
system("clear");
do {
printf("myAI\\>§ ");
scanf("%s",c);
if(stat(c,&s)>-1) {... (3 Replies)
Discussion started by: C|[anti-trust]
3 Replies
3. Shell Programming and Scripting
Hi all,
I'm trying to generate a series of txt files starting from a plain csv file
part of my code:
#!/bin/ksh
INSTALLDIR=/Users/ME/Installdir
CSV=CSV.csv
TMP=/tmp/$(basename $0).txt
tr -s "\r" "\n" < /$INSTALLDIR/$CSV > $TMP
function Makefiles
{
printf '%24s:%30s\n' "sometext"... (1 Reply)
Discussion started by: Jive Spector
1 Replies
4. UNIX for Advanced & Expert Users
Hi All,
Can any one help me to solve the issue.
The Issue is, i have started the sendmail service on my RHEL 4 update 6 box, I am able to send the mail from my box to almost all of the Email Id's except few.
Exampe,
test mail.
.
Output is :the message is sent.
now if I send the... (2 Replies)
Discussion started by: akhtar.bhat
2 Replies
5. Shell Programming and Scripting
I am using mailx command in my script to attach a file and send an email. I need to attach a csv file and send email to a mail id -
I am using
uuencode output.csv output.csv | mailx -s "test mail" xyz@abc.com
This will send a mail with scrambled text in body.
am i missing something ?... (4 Replies)
Discussion started by: Sriranga
4 Replies
6. Linux
Hi,
I am trying to enable rexec to automate certain tasks(it has to be rexec, not ssh or any other due to the system environment), so after switching to linux, I followed the certain instructions that were laid out in the web.
My operating system is fedora 17, so I first installed the... (1 Reply)
Discussion started by: wringer
1 Replies
7. UNIX for Dummies Questions & Answers
Hi There,
---------
file1
-------
~c asd@ac.com
--------------
Now i am using below command
cat file1|mailx -s " testing" -r " My Name" abc@tech.com (3 Replies)
Discussion started by: Tapan Sharma
3 Replies
8. Shell Programming and Scripting
Platform: RHEL 5.4
In the below text file I have strings like following.
$ cat /tmp/mytextfile.txt
DISK1
DISK10
DISK101
DISK102
DISK103
DISK104
DISK105
DISK106
DISK107
DISK108
DISK109
DISK110
DISK111
DISK112
DISK113
DISK114 (8 Replies)
Discussion started by: kraljic
8 Replies
9. Shell Programming and Scripting
I want to join two files , with file 1 col 3 and file 2 col 1 as key.
The join command is erratic for some reason. File 2 is a master file having all the names, and file 1 has some values. I want to add the names from fil2 in file 1. If I use the original master file, some output is missing.
... (16 Replies)
Discussion started by: ritakadm
16 Replies
10. Shell Programming and Scripting
I'm using an Ubuntu machine and expansion is not working properly. What would cause this? Do I need to check for any particular bash packages?
$ ipcs -m | grep $USER | awk '{printf "%s ",$2}'
$ ipcs -m | grep UNF | awk '{printf "%s ",$2}'
294912 1048577 425986 688131 786436 1245189... (14 Replies)
Discussion started by: cokedude
14 Replies
LEARN ABOUT CENTOS
set_role
SET
ROLE(7) PostgreSQL 9.2.7 Documentation SET ROLE(7)
NAME
SET_ROLE - set the current user identifier of the current session
SYNOPSIS
SET [ SESSION | LOCAL ] ROLE role_name
SET [ SESSION | LOCAL ] ROLE NONE
RESET ROLE
DESCRIPTION
This command sets the current user identifier of the current SQL session to be role_name. The role name can be written as either an
identifier or a string literal. After SET ROLE, permissions checking for SQL commands is carried out as though the named role were the one
that had logged in originally.
The specified role_name must be a role that the current session user is a member of. (If the session user is a superuser, any role can be
selected.)
The SESSION and LOCAL modifiers act the same as for the regular SET(7) command.
The NONE and RESET forms reset the current user identifier to be the current session user identifier. These forms can be executed by any
user.
NOTES
Using this command, it is possible to either add privileges or restrict one's privileges. If the session user role has the INHERITS
attribute, then it automatically has all the privileges of every role that it could SET ROLE to; in this case SET ROLE effectively drops
all the privileges assigned directly to the session user and to the other roles it is a member of, leaving only the privileges available to
the named role. On the other hand, if the session user role has the NOINHERITS attribute, SET ROLE drops the privileges assigned directly
to the session user and instead acquires the privileges available to the named role.
In particular, when a superuser chooses to SET ROLE to a non-superuser role, she loses her superuser privileges.
SET ROLE has effects comparable to SET SESSION AUTHORIZATION (SET_SESSION_AUTHORIZATION(7)), but the privilege checks involved are quite
different. Also, SET SESSION AUTHORIZATION determines which roles are allowable for later SET ROLE commands, whereas changing roles with
SET ROLE does not change the set of roles allowed to a later SET ROLE.
SET ROLE does not process session variables as specified by the role's ALTER ROLE (ALTER_ROLE(7)) settings; this only happens during login.
SET ROLE cannot be used within a SECURITY DEFINER function.
EXAMPLES
SELECT SESSION_USER, CURRENT_USER;
session_user | current_user
--------------+--------------
peter | peter
SET ROLE 'paul';
SELECT SESSION_USER, CURRENT_USER;
session_user | current_user
--------------+--------------
peter | paul
COMPATIBILITY
PostgreSQL allows identifier syntax ("rolename"), while the SQL standard requires the role name to be written as a string literal. SQL does
not allow this command during a transaction; PostgreSQL does not make this restriction because there is no reason to. The SESSION and LOCAL
modifiers are a PostgreSQL extension, as is the RESET syntax.
SEE ALSO
SET SESSION AUTHORIZATION (SET_SESSION_AUTHORIZATION(7))
PostgreSQL 9.2.7 2014-02-17 SET ROLE(7)