Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Editing file with kdesu requires full path to the file

  1. #1

    Default Editing file with kdesu requires full path to the file

    Hi, I'm new openSUSE and while I'm trying to figure out how things work there is one thing that I couldn't find an answer to about kdesu command.

    For instance, if I changed folders to /etc/X11 and I want to edit xorg.conf I need to run the following command:
    Code:
    kdesu kwrite /etc/X11/xorg.conf
    while I'd expect to run the following:
    Code:
    kdesu kwrite xorg.conf
    but without the full path it opens an xorg.conf file in a folder somewhere in my home folder (but not directly under /home/user/).

    I assume this is normal, but is there a way around it? If I want to edit several files under the same folder I'd rather not have to type out the full path to the each of the files.

    Thanks in advance.

  2. #2

    Default Re: Editing file with kdesu requires full path to the file

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Kinda, but remember that kdesu is starting a new environment as another
    user ('root' in your case) so being exact is not only a good idea, it may
    be required:

    kdesu kwrite `pwd`/xorg.conf

    Good luck.




    Untitled No4 wrote:
    > Hi, I'm new openSUSE and while I'm trying to figure out how things work
    > there is one thing that I couldn't find an answer to about kdesu
    > command.
    >
    > For instance, if I changed folders to /etc/X11 and I want to edit
    > xorg.conf I need to run the following command:
    >
    > Code:
    > --------------------
    > kdesu kwrite /etc/X11/xorg.conf
    > --------------------
    >
    >
    > while I'd expect to run the following:
    >
    > Code:
    > --------------------
    > kdesu kwrite xorg.conf
    > --------------------
    >
    >
    > but without the full path it opens an xorg.conf file in a folder
    > somewhere in my home folder (but not directly under /home/user/).
    >
    > I assume this is normal, but is there a way around it? If I want to
    > edit several files under the same folder I'd rather not have to type out
    > the full path to the each of the files.
    >
    > Thanks in advance.
    >
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.9 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

    iQIcBAEBAgAGBQJLGD/OAAoJEF+XTK08PnB5jhUQAJd0A3NshrRm6Dycd8yWw56S
    wvMvCc51J6GEtZHw8GL8znvi8Y2WniEmjIcbAuV/TWEfsDz76FfFLZ+UKKLB4S7W
    N0nbq0NlEYKN2Y97R/OZV8EuVIFJY4D76wbdc+0FEZxm3SWboYIb2o9OCxL+cfuY
    A2OUv2SYFcyRAhy/f/XFBSOzoq61G4i0sz43ox10azYQdg56ncBBtYISk4M4EP3K
    NLKoxNorjH9pw0t/TKcvqZL7vMu1fK/0ykHXYbEZD6NAPiY7VVSaa/YrSMGtcuZE
    81t/o+0F905YR3mncdIDXFXJPz9mt1dz6mZypMCtuGb1sJLlcIUr1MQa1icJG2F9
    4ETs6fSqWjh7C5JNOE+ELDlXdl7wycD7x9spCEGHJN0VF3RFyfdp2bUQaTmQKPKt
    49bUZF0mqG97LLSOnd8lilvk2o9aSEqLcaHoUvPQEMUeMcpXdlPrPwhWeMIDCMc9
    AdFVgPmYnAYvkHKCPzdzlZ3YGLPKua4V9tmMEy2lj8bFDcXNM3koPWlhR/vI0xas
    9lCxkzGZppcmr54fPVZG0VLYXtFQtbN9g/TLX6i/QhHX0qlSE43DNg4eV4ZKyl5P
    NhKLmoDykActARNoiFh50ukr42PQSdv6MFXP99mx/U+5JZWY26dnxe2eCBBf4ye2
    M056b25QiQ6ZxaS9d77X
    =EZfp
    -----END PGP SIGNATURE-----

  3. #3

    Default Re: Editing file with kdesu requires full path to the file

    One way that might work:

    Code:
    kdesu kwrite ./xorg.conf
    One way that does:

    Code:
    su -
    kwrite xorg.conf

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,890

    Default Re: Editing file with kdesu requires full path to the file

    Quote Originally Posted by Untitled_No4 View Post
    while I'd expect to run the following:
    Code:
    kdesu kwrite xorg.conf
    but without the full path it opens an xorg.conf file in a folder somewhere in my home folder (but not directly under /home/user/).

    I assume this is normal, but is there a way around it? If I want to edit several files under the same folder I'd rather not have to type out the full path to the each of the files.

    Thanks in advance.
    Did you realy expect that kdesu or kwrite or whoever invented that you need the xorg.conf inside /etc/X11 and not one inside /bin or elsewhere?

    You could use a terminal as root and then you cd to the directory you want to be. Then you could use vim or any other CLI tool to let loose on the names found within your working directory.

    For different ways do do things as root (some ways are easier to use in some circumstances then others) see: SDB:Login as root - openSUSE
    Henk van Velden

  5. #5

    Default Re: Editing file with kdesu requires full path to the file

    Quote Originally Posted by hcvv View Post
    Did you realy expect that kdesu or kwrite or whoever invented that you need the xorg.conf inside /etc/X11 and not one inside /bin or elsewhere?
    I didn't expect kdesu to to guess anything hence why I wrote AFTER changing directories to /etc/X11. Perhaps that's too much to expect but since kdesudo does just that I thought that perhaps somehow kdesu might work the same way.

    Thanks for the other suggestions -- none worked for me but it was still worth-while asking.

  6. #6

    Default Re: Editing file with kdesu requires full path to the file

    Running 'su -', then 'cd'ing to the right directory, then running kwrite without the absolute path should...

    Unless I'm going nuts. But it seems to here...

    Just don't use a normal 'su', and my understanding is that the problems kdesu and gnomesu are designed to avoid are avoided.

    [Someone correct me if I'm wrong...]

  7. #7

    Default Re: Editing file with kdesu requires full path to the file

    Sorry, you're right, it does work.

    I also tried compiling kdesudo but it doesn't work the same way it does in other distributions, but the questions was me wanting to know whether I missed anything.

    Thanks again.

  8. #8

    Default Re: Editing file with kdesu requires full path to the file

    No need to apologise, and you're welcome.

  9. #9
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,890

    Default Re: Editing file with kdesu requires full path to the file

    Quote Originally Posted by Confuseling View Post
    Running 'su -', then 'cd'ing to the right directory, then running kwrite without the absolute path should...

    Unless I'm going nuts. But it seems to here...

    Just don't use a normal 'su', and my understanding is that the problems kdesu and gnomesu are designed to avoid are avoided.

    [Someone correct me if I'm wrong...]
    Of course one should use
    Code:
    su -
    That is clearly stated in the link I provided above. Leaving out the - is a security risk. This is btw illustrated by Untitled_No4. He (as root) is editing another file then he thought he would do.
    Henk van Velden

  10. #10
    palladium NNTP User

    Default Re: Editing file with kdesu requires full path to the file

    > Code:
    > --------------------
    > su -
    > --------------------


    i had a 'big' discussion with others in one of these fora here within
    the last month or so...trying to persuade them use the dash when they
    wanted to be root...

    and, i got such a coordinated stonewall about how wrong i was that i
    finely decided to just be quiet and let them do it any way they
    want....even if wrong...oh, i think it was a new how-to....i don't
    remember exactly...

    oh, i found it....here it is, read and grin:
    http://forums.opensuse.org/showthread.php?t=424498

    --
    palladium

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •