-
ant-xIn /etc/ssl/certs , I cannot create a new file with cat:
-
ant-x# cat self.crt self.key > self.pem
-
ant-xsh: cannot create self.pem: Permission denied
-
ant-xEven though I can open, edit, and save self.pem in a text editor, also as root. Why?
-
rwpant-x, Works for me. Is self.pem actually a symlink to some place that is truly not writable?
-
ant-xNo, it is cat-related: I have done it by hand.
-
ant-xNo symlinks.
-
ant-xAs I said, I can create self.pem with ``vi self.pem`` or with ``touch self.pem'' (as root).
-
rwpcsh has a shell flag that prevents it overwriting files with > redirection. Is that set for you?
-
ant-xI use sh.
-
ant-xdoas echo test > self.pem # fails, too.
-
rwpset -o | grep clobber
-
ant-xI am doing that under /etc/ssl/certs (perhaps it matters).
-
rwpdoas will not have any effect on a > redirection.
-
ant-xOoop!
-
rwpWhat does "set -o | grep clobber" show?
-
ant-xUnless I do something like eval?
-
rwpYou said you were already root so there is no need for doas.
-
ant-xThat explains it. This works: doas sh -c "echo test > self.pem"
-
rwpHowever if you want to use doas to elevate a non-root process then: doas sh -c "echo foo > foo.txt"
-
rwpJinx!
-
ant-xI said that to simplify things. I use doas to assume root. Beg pardon!@
-
ant-xYep. Thanks.
-
ant-xThat'll teach me to report things literally as they are.
-
rwpI still think you must have the shell's noclobber option set.
-
ant-xNo, I don't (just checked). I have never heard of this options.
a minute ago