Bug 1565970 - cat /ostree/repo/refs/heads/ostree/0/1/0 > /etc/file1 failed
Summary: cat /ostree/repo/refs/heads/ostree/0/1/0 > /etc/file1 failed
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm-ostree
Version: 28
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Colin Walters
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-04-11 08:11 UTC by lnie
Modified: 2018-04-24 15:07 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-24 14:55:56 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description lnie 2018-04-11 08:11:04 UTC
Description of problem:
I'm running this testcase
http://fedoraproject.org/wiki/User:Roshi/QA/AtomicTests/Atomic_Upgrade

[fedora@atomic01 ~]$ sudo cat /ostree/repo/refs/heads/ostree/0/1/0 > /etc/file1
-bash: /etc/file1: Permission denied

On a normal f28 server system,the command succeed as usual.



Version-Release number of selected component (if applicable):
Fedora-AtomicHost-28-20180410.n.1.x86_64.qcow2.1

How reproducible:
always

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Dusty Mabe 2018-04-24 14:54:56 UTC
hey Inie. Thanks for the bug report. This isn't a bug, though as the write to '/etc/file1' in the command you are running is not privileged (i.e. it's not part of the sudo command). 

If you were running as root this would work:

```
[vagrant@vanilla-f28-atomic ~]$ sudo su -
[root@vanilla-f28-atomic ~]# whoami 
root
[root@vanilla-f28-atomic ~]# cat /ostree/repo/refs/heads/ostree/0/1/0 > /etc/file1
[root@vanilla-f28-atomic ~]# echo $?
0
```

It would also work if you included the redirect in the sudo command:

```
[vagrant@vanilla-f28-atomic ~]$ whoami
vagrant
[vagrant@vanilla-f28-atomic ~]$ sudo su -c "cat /ostree/repo/refs/heads/ostree/0/1/0 > /etc/file1"
[vagrant@vanilla-f28-atomic ~]$ echo $?
0
```

closing for now as notabug

Comment 2 Micah Abbott 2018-04-24 15:00:39 UTC
I've updated the linked test case to clearly indicate to use a privileged user when writing to /etc

Comment 3 Dusty Mabe 2018-04-24 15:07:02 UTC
(In reply to Micah Abbott from comment #2)
> I've updated the linked test case to clearly indicate to use a privileged
> user when writing to /etc

thanks micah


Note You need to log in before you can comment on or make changes to this bug.