Re: BPXBATCH "SH ...; su; pax ..." does not do what you think it does (was: rsync anyone?)

2015-12-29 Thread Paul Gilmartin
On Tue, 29 Dec 2015 16:01:15 +0100, Peter Hunkeler wrote:
>
>To run commands in a "su" shell environment, you have to write all the 
>commands into a UNIX file first, and then call "su" by redirecting stdin to 
>that UNIX file.
>
>echo "id" > /tmp/sucommandfile
>su < /tmp/sucommandfile
>
>This will show uid=0, because it is the sub shell (uid=0), which is reading 
>from /tmp/sucommandfile as if it was stdin, and execute the commands found 
>therein.
> 
Did this work for you on z/OS?  Looking for alternatives on a Linux system
(I haven't su on z/OS):

501 $ echo id | su
su: must be run from a terminal
502 $

It's a security feature.  But:

500 $ sudo sh -c id
[sudo] password for :
uid=0(root) gid=0(root) groups=0(root)
501 $
500 $ echo id | sudo sh
[sudo] password for : 
uid=0(root) gid=0(root) groups=0(root)
501 $

... and I belive sudo is now available in Ported Tools.

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: BPXBATCH "SH ...; su; pax ..." does not do what you think it does (was: rsync anyone?)

2015-12-29 Thread Chris Hoelscher
does not do what you think it does ...

or, in the words of Inigo Montoya ..

you keep using that command. I do not think it means what you think it means ...

Chris Hoelscher
Technology Architect, Database Infrastructure Services
Technology Solution Services
: humana.com
123 East Main Street
Louisville, KY 40202
Humana.com
(502) 714-8615, (502) 476-2538


-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of John McKown
Sent: Tuesday, December 29, 2015 11:48 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: [IBM-MAIN] BPXBATCH "SH ...; su; pax ..." does not do what you 
think it does (was: rsync anyone?)

On Tue, Dec 29, 2015 at 9:01 AM, Peter Hunkeler  wrote:

> ​
>
> To run commands in a "su" shell environment, you have to write all the 
> commands into a UNIX file first, and then call "su" by redirecting 
> stdin to that UNIX file.
>
>
> echo "id" > /tmp/sucommandfile
> su < /tmp/sucommandfile
>
>
​The following also works:

$
{ cat < id
> whoami
> EOF
> } | su
uid=0(
​ROOT
) gid=1000(
​
) groups=2000(
​
),0(SYS1)
ROOT
$

​



--
Computer Science is the only discipline in which we view adding a new wing to a 
building as being maintenance -- Jim Horning

Schrodinger's backup: The condition of any backup is unknown until a restore is 
attempted.

Yoda of Borg, we are. Futile, resistance is, yes. Assimilated, you will be.

He's about as useful as a wax frying pan.

10 to the 12th power microphones = 1 Megaphone

Maranatha! <><
John McKown

--
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
lists...@listserv.ua.edu with the message: INFO IBM-MAIN

The information transmitted is intended only for the person or entity to which 
it is addressed
and may contain CONFIDENTIAL material.  If you receive this 
material/information in error,
please contact the sender and delete or destroy the material/information.


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: BPXBATCH "SH ...; su; pax ..." does not do what you think it does (was: rsync anyone?)

2015-12-29 Thread John McKown
On Tue, Dec 29, 2015 at 9:01 AM, Peter Hunkeler  wrote:

> ​
>
> To run commands in a "su" shell environment, you have to write all the
> commands into a UNIX file first, and then call "su" by redirecting stdin to
> that UNIX file.
>
>
> echo "id" > /tmp/sucommandfile
> su < /tmp/sucommandfile
>
>
​The following also works:

$
{ cat < id
> whoami
> EOF
> } | su
uid=0(
​ROOT
) gid=1000(
​
) groups=2000(
​
),0(SYS1)
ROOT
$

​



-- 
Computer Science is the only discipline in which we view adding a new wing
to a building as being maintenance -- Jim Horning

Schrodinger's backup: The condition of any backup is unknown until a
restore is attempted.

Yoda of Borg, we are. Futile, resistance is, yes. Assimilated, you will be.

He's about as useful as a wax frying pan.

10 to the 12th power microphones = 1 Megaphone

Maranatha! <><
John McKown

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: BPXBATCH "SH ...; su; pax ..." does not do what you think it does (was: rsync anyone?)

2015-12-29 Thread John McKown
On Tue, Dec 29, 2015 at 11:17 AM, Chris Hoelscher 
wrote:

> does not do what you think it does ...
>
> or, in the words of Inigo Montoya ..
>
> you keep using that command. I do not think it means what you think it
> means ...
>

​What am I missing on that. I'm always wanting to learn stuff. Especially
when I give wrong advice. I don't like doing that.​




>
> Chris Hoelscher
> Technology Architect, Database Infrastructure Services
> Technology Solution Services
> : humana.com
> 123 East Main Street
> Louisville, KY 40202
> Humana.com
> (502) 714-8615, (502) 476-2538
>
> --
Computer Science is the only discipline in which we view adding a new wing
to a building as being maintenance -- Jim Horning

Schrodinger's backup: The condition of any backup is unknown until a
restore is attempted.

Yoda of Borg, we are. Futile, resistance is, yes. Assimilated, you will be.

He's about as useful as a wax frying pan.

10 to the 12th power microphones = 1 Megaphone

Maranatha! <><
John McKown

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: BPXBATCH "SH ...; su; pax ..." does not do what you think it does (was: rsync anyone?)

2015-12-29 Thread Shmuel Metz (Seymour J.)
In
<29b16432403d6c45a9bee5f0302d191779ba2...@vss-exchmb1.sfg.corp.LOCAL>,
on 12/29/2015
   at 06:24 PM, "Pommier, Rex"  said:

>The only thing you're missing on Chris' response was the movie
>reference.

Movie? The book came first.
 
-- 
 Shmuel (Seymour J.) Metz, SysProg and JOAT
 ISO position; see  
We don't care. We don't have to care, we're Congress.
(S877: The Shut up and Eat Your spam act of 2003)

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: BPXBATCH "SH ...; su; pax ..." does not do what you think it does (was: rsync anyone?)

2015-12-29 Thread Pommier, Rex
John,

The only thing you're missing on Chris' response was the movie reference.  He 
was making a play on a line said by Inigo Montoya in the movie "The Princess 
Bride".  The actual quote is "You keep using that word.  I do not think it 
means what you think it means".

Rex

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of John McKown
Sent: Tuesday, December 29, 2015 11:26 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: BPXBATCH "SH ...; su; pax ..." does not do what you think it does 
(was: rsync anyone?)

On Tue, Dec 29, 2015 at 11:17 AM, Chris Hoelscher 
wrote:

> does not do what you think it does ...
>
> or, in the words of Inigo Montoya ..
>
> you keep using that command. I do not think it means what you think it
> means ...
>

​What am I missing on that. I'm always wanting to learn stuff. Especially
when I give wrong advice. I don't like doing that.​




>
> Chris Hoelscher
> Technology Architect, Database Infrastructure Services
> Technology Solution Services
> : humana.com
> 123 East Main Street
> Louisville, KY 40202
> Humana.com
> (502) 714-8615, (502) 476-2538
>
> --
Computer Science is the only discipline in which we view adding a new wing
to a building as being maintenance -- Jim Horning

Schrodinger's backup: The condition of any backup is unknown until a
restore is attempted.

Yoda of Borg, we are. Futile, resistance is, yes. Assimilated, you will be.

He's about as useful as a wax frying pan.

10 to the 12th power microphones = 1 Megaphone

Maranatha! <><
John McKown

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


The information contained in this message is confidential, protected from 
disclosure and may be legally privileged.  If the reader of this message is not 
the intended recipient or an employee or agent responsible for delivering this 
message to the intended recipient, you are hereby notified that any disclosure, 
distribution, copying, or any action taken or action omitted in reliance on it, 
is strictly prohibited and may be unlawful.  If you have received this 
communication in error, please notify us immediately by replying to this 
message and destroy the material in its entirety, whether in electronic or hard 
copy format.  Thank you.


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: BPXBATCH "SH ...; su; pax ..." does not do what you think it does (was: rsync anyone?)

2015-12-29 Thread Skip Robinson
This thread is driving me crazy. It's the last week of 2015, so scr*w the
rules. All week is Friday.

I encountered an omen this morning. On my local NPR station--KPCC--there was
a discussion of death and how it's clinically determined and officially
declared. It's not a bipolar condition, according to the researcher
interviewed. There was explicit reference to Princess Bride, where the Black
Knight, in seriously dire straits, was described as being somewhere on a
continuum from fully alive to fully dead. He was, at one juncture, mostly
dead. A marvelous film. Never read the book. Only know the 'cheeky'
adaptation by Rob Reiner.

So what was the misunderstood word? INCONCEIVABLE. A word immortalized on
screen by Wallace Shawn. And, to bend the conversation back to Mainframe, a
word that some of us have used emphatically to describe an 'impossible'
situation encountered in our daily work. Let's hope that in 2016 we find a
happier conclusion than Vizinni did. 

.
.
.
J.O.Skip Robinson
Southern California Edison Company
Electric Dragon Team Paddler 
SHARE MVS Program Co-Manager
323-715-0595 Mobile
jo.skip.robin...@att.net
jo.skip.robin...@gmail.com

> -Original Message-
> From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU]
> On Behalf Of Peter Hunkeler
> Sent: Tuesday, December 29, 2015 11:34 AM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: [Bulk] AW: Re: BPXBATCH "SH ...; su; pax ..." does not do what
you think
> it does (was: rsync anyone?)
> 
> 
> >does not do what you think it does ...
>  >
> >or, in the words of Inigo Montoya ..
>  >
> >you keep using that command. I do not think it means what you think it
means
> ...
> 
> 
> 
> 
> I don't get your point, I'm afraid.
> 
> 
> --
> Peter Hunkeler

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


AW: Re: BPXBATCH "SH ...; su; pax ..." does not do what you think it does (was: rsync anyone?)

2015-12-29 Thread Peter Hunkeler

>>echo "id" > /tmp/sucommandfile
>>su < /tmp/sucommandfile
>>
>>This will show uid=0, because it is the sub shell (uid=0), which is reading 
>>from /tmp/sucommandfile as if it >was stdin, and execute the commands found 
>>therein.
>>
>Did this work for you on z/OS?  Looking for alternatives on a Linux system
>(I haven't su on z/OS):




Yes, it does indeed. I don't have su right neither but I asked a colleage who 
has to verify for me (on z/OS V2.1)


--
Peter Hunkeler



--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


BPXBATCH "SH ...; su; pax ..." does not do what you think it does (was: rsync anyone?)

2015-12-29 Thread Peter Hunkeler

> sh cd /u/zfs;su;pax -rwvCMX -p eW . /u/hfs


This does not do what you think it does. The pax command will run under the 
initial uid and not with uid=o as you might hope. I recently explained this on 
the RACF-L list as follows:


Starting in the initial shell process, most (shell) commands will be run in a 
new child process of this parent shell process. If you issue "sh" you will end 
up in a new sub shell process. The parent shell is waiting for the sub shell to 
end. Issuing "su" is also startting a sub shell in a new process, but will 
additionally try to switch to uid=0 in the *new subshell process*. Again the 
parent shell will wait for the sub shell to terminate, before it will run the 
next command. At that time, the uid=0 sub shell process has ended, so the uid=0 
environment does no longer exist. The next command is again starting with the 
initial parent shell's environment.


The ";" separates shell commands; they are run sequentially. Same with "&&" and 
"||", they just add the "run only if previous command ran successfully (&&) or 
unsucessfully (||)" to it. Still most commands are run in subshells.

To run commands in a "su" shell environment, you have to write all the commands 
into a UNIX file first, and then call "su" by redirecting stdin to that UNIX 
file.


echo "id" > /tmp/sucommandfile
su < /tmp/sucommandfile


This will show uid=0, because it is the sub shell (uid=0), which is reading 
from /tmp/sucommandfile as if it was stdin, and execute the commands found 
therein.
--
Peter Hunkeler

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN