• setcap command

    From Ghost@1:153/143 to All on Sun Oct 9 18:40:34 2022
    I have tried (and failed) using the setcap command to allow the ports <1024 to be used, but the command has failed with the following:

    sbbs@greg-Virtual-Machine:~/sbbs/exec$ sudo setcap cap_net_bind_service=+ep /home/sbbs/sbbs/exec/sbbs
    Failed to set capabilities on file `/home/sbbs/sbbs/exec/sbbs' (Invalid argument)
    The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file

    any help would be appreciated. I have looked on the web and could not come up with anything better than what I have done here.
    Thanks!
    --- SBBSecho 3.11-Win32
    * Origin: Ice Castle BBS, Anchorage, AK (1:153/143)
  • From Gamgee@1:103/705 to Ghost on Mon Oct 10 08:18:00 2022
    Ghost wrote to All <=-

    I have tried (and failed) using the setcap command to allow the
    ports <1024 to be used, but the command has failed with the
    following:

    sbbs@greg-Virtual-Machine:~/sbbs/exec$ sudo setcap cap_net_bind_service=+ep /home/sbbs/sbbs/exec/sbbs Failed to set capabilities on file `/home/sbbs/sbbs/exec/sbbs' (Invalid
    argument) The value of the capability argument is not permitted
    for a file. Or the file is not a regular (non-symlink) file

    any help would be appreciated. I have looked on the web and could
    not come up with anything better than what I have done here.

    My guess is that the 'sbbs' executable (/home/sbbs/sbbs/exec/sbbs) is
    actually a symlink to the actual file (/home/sbbs/sbbs/repo/exec/sbbs),
    and it's failing for the reason given in that error message regarding a symlink.

    Haven't tested this, since I don't use symlinks, but perhaps try running
    the setcap command on the file (/home/sbbs/sbbs/repo/exec/sbbs).



    ... All the easy problems have been solved.
    --- MultiMail/Linux v0.52
    þ Synchronet þ Palantir BBS * palantirbbs.ddns.net * Pensacola, FL
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Nightfox@1:103/705 to Ghost on Mon Oct 10 10:15:20 2022
    Re: setcap command
    By: Ghost to All on Sun Oct 09 2022 06:40 pm

    I have tried (and failed) using the setcap command to allow the ports <1024 to be used, but the command has failed with the following:

    sbbs@greg-Virtual-Machine:~/sbbs/exec$ sudo setcap cap_net_bind_service=+ep /home/sbbs/sbbs/exec/sbbs Failed to set capabilities on file `/home/sbbs/sbbs/exec/sbbs' (Invalid argument) The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file

    One of the resources you can use in Linux is the 'man' utility, which looks up a manual page for various commands, if it exists. You can use the command 'man setcap', for instance, to look up the documentation for setcap (and it looks like there is a manual page for that). It will explain the arguments it requires.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Digital Man@1:103/705 to Ghost on Mon Oct 10 10:40:34 2022
    Re: setcap command
    By: Ghost to All on Sun Oct 09 2022 06:40 pm

    I have tried (and failed) using the setcap command to allow the ports <1024 to be used, but the command has failed with the following:

    sbbs@greg-Virtual-Machine:~/sbbs/exec$ sudo setcap cap_net_bind_service=+ep /home/sbbs/sbbs/exec/sbbs
    Failed to set capabilities on file `/home/sbbs/sbbs/exec/sbbs' (Invalid argument)
    The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file

    any help would be appreciated. I have looked on the web and could not come up with anything better than what I have done here.

    Sounds like /home/sbbs/sbbs/exec/sbbs is a symlink. Specify 'setcap' as a 'make' target is the better/preferred way of getting those capabilities set on sbbs.
    --
    digital man (rob)

    Sling Blade quote #22:
    Karl: I don't reckon you have to go with women to be a good father to a boy. Norco, CA WX: 66.6øF, 90.0% humidity, 2 mph ESE wind, 0.00 inches rain/24hrs --- SBBSecho 3.15-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Ghost@1:153/143 to Gamgee on Mon Oct 10 12:42:03 2022
    Re: Re: setcap command
    By: Gamgee to Ghost on Mon Oct 10 2022 08:18 am

    sbbs@greg-Virtual-Machine:~/sbbs/exec$ sudo setcap cap_net_bind_service=+ep /home/sbbs/sbbs/exec/sbbs Failed to
    set
    capabilities on file `/home/sbbs/sbbs/exec/sbbs' (Invalid
    argument) The value of the capability argument is not permitted
    for a file. Or the file is not a regular (non-symlink) file

    any help would be appreciated. I have looked on the web and could
    not come up with anything better than what I have done here.

    My guess is that the 'sbbs' executable (/home/sbbs/sbbs/exec/sbbs) is actually a symlink to the actual file (/home/sbbs/sbbs/repo/exec/sbbs),
    and it's failing for the reason given in that error message regarding a symlink.

    Well, I haven't set up any symlinks, so unless it was done when installed, I don't know. However, I tried your suggestion and got the same response from the system.
    sbbs@greg-Virtual-Machine:~/sbbs/exec$ sudo setcap cap_net_bind_service=+ep /home/sbbs/sbbs/repo/exec/sbbs Failed to
    set capabilities on file `/home/sbbs/sbbs/repo/exec/sbbs' (Invalid argument) The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file
    --- SBBSecho 3.11-Win32
    * Origin: Ice Castle BBS, Anchorage, AK (1:153/143)
  • From Digital Man@1:103/705 to Ghost on Mon Oct 10 14:26:05 2022
    Re: Re: setcap command
    By: Ghost to Gamgee on Mon Oct 10 2022 12:42 pm

    Re: Re: setcap command
    By: Gamgee to Ghost on Mon Oct 10 2022 08:18 am

    sbbs@greg-Virtual-Machine:~/sbbs/exec$ sudo setcap cap_net_bind_service=+ep /home/sbbs/sbbs/exec/sbbs Failed to
    set
    capabilities on file `/home/sbbs/sbbs/exec/sbbs' (Invalid
    argument) The value of the capability argument is not permitted
    for a file. Or the file is not a regular (non-symlink) file

    any help would be appreciated. I have looked on the web and could not come up with anything better than what I have done here.

    My guess is that the 'sbbs' executable (/home/sbbs/sbbs/exec/sbbs) is actually a symlink to the actual file (/home/sbbs/sbbs/repo/exec/sbbs), and it's failing for the reason given in that error message regarding a symlink.

    Well, I haven't set up any symlinks, so unless it was done when installed, I don't know.

    The suggested installation steps creates symlinks from exec/* to the build output directories: http://wiki.synchro.net/install:nix

    However, I tried your suggestion and got the same response from
    the system.
    sbbs@greg-Virtual-Machine:~/sbbs/exec$ sudo setcap cap_net_bind_service=+ep /home/sbbs/sbbs/repo/exec/sbbs Failed to
    set capabilities on file `/home/sbbs/sbbs/repo/exec/sbbs' (Invalid argument) The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file

    Use "ls -l" or "readlink" to determine if a file is in fact a symlink, e.g.:
    $ readlink /sbbs/exec/sbbs ../../../home/rswindell/sbbs/src/sbbs3/gcc.linux.x64.exe.debug/sbbs

    Again, the suggested method of setting capabilities is to use the "setcap" build target as instructed here:
    http://wiki.synchro.net/install:nix#updating
    --
    digital man (rob)

    Synchronet "Real Fact" #8:
    Synchronet was originally developed as a replacement for WWIV BBS software Norco, CA WX: 81.5øF, 56.0% humidity, 4 mph ESE wind, 0.00 inches rain/24hrs --- SBBSecho 3.15-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Ghost@1:153/143 to Digital Man on Mon Oct 10 15:55:04 2022
    Re: Re: setcap command
    By: Digital Man to Ghost on Mon Oct 10 2022 02:26 pm

    sbbs@greg-Virtual-Machine:~/sbbs/exec$ sudo setcap cap_net_bind_service=+ep /home/sbbs/sbbs/repo/exec/sbbs Failed to
    set capabilities on file `/home/sbbs/sbbs/repo/exec/sbbs' (Invalid argument) The value of the capability argument is not permitted for a file. Or the file is not a regular
    (non-symlink) file

    Use "ls -l" or "readlink" to determine if a file is in fact a symlink, e.g.: $ readlink /sbbs/exec/sbbs ../../../home/rswindell/sbbs/src/sbbs3/gcc.linux.x64.exe.debug/sbbs

    Again, the suggested method of setting capabilities is to use the "setcap" build target as instructed here:
    http://wiki.synchro.net/install:nix#updating
    --

    The suggested method shown worked. Thanks again for your assistance.
    --- SBBSecho 3.11-Win32
    * Origin: Ice Castle BBS, Anchorage, AK (1:153/143)
  • From Gamgee@1:103/705 to Ghost on Mon Oct 10 21:33:00 2022
    Ghost wrote to Gamgee <=-

    Re: Re: setcap command
    By: Gamgee to Ghost on Mon Oct 10 2022 08:18 am

    sbbs@greg-Virtual-Machine:~/sbbs/exec$ sudo setcap
    cap_net_bind_service=+
    ep /home/sbbs/sbbs/exec/sbbs Failed to
    set
    capabilities on file `/home/sbbs/sbbs/exec/sbbs' (Invalid
    argument) The value of the capability argument is not permitted
    for a file. Or the file is not a regular (non-symlink) file

    any help would be appreciated. I have looked on the web and could
    not come up with anything better than what I have done here.

    My guess is that the 'sbbs' executable (/home/sbbs/sbbs/exec/sbbs) is actually a symlink to the actual file (/home/sbbs/sbbs/repo/exec/sbbs),
    and it's failing for the reason given in that error message regarding a
    syml
    ink.

    Well, I haven't set up any symlinks, so unless it was done when
    installed, I don't know. However, I tried your suggestion and got
    the same response from the system.

    Well, if you followed the installation instructions example, you may
    have set up symlinks. On your "make install" command line to install,
    did you also include "SYMLINK=1" ?

    Or just do the command "ls -l" while in the /sbbs directory, and see if
    there are symlinks there, or not.



    ... Gone crazy, be back later, please leave message.
    --- MultiMail/Linux v0.52
    þ Synchronet þ Palantir BBS * palantirbbs.ddns.net * Pensacola, FL
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Ghost@1:153/143 to Gamgee on Tue Oct 11 09:35:30 2022
    Re: Re: setcap command
    By: Gamgee to Ghost on Mon Oct 10 2022 09:33 pm

    Or just do the command "ls -l" while in the /sbbs directory, and see if there are symlinks there, or not.



    have set up symlinks. On your "make install" command line to install,
    did you also include "SYMLINK=1" ?

    Or just do the command "ls -l" while in the /sbbs directory, and see if there are symlinks there, or not.

    I tried another suggestion last night and it is now working correctly.
    Thanks for the help
    --- SBBSecho 3.11-Win32
    * Origin: Ice Castle BBS, Anchorage, AK (1:153/143)
  • From Charles Blackburn@1:103/705 to Gamgee on Tue Oct 11 16:09:49 2022
    Re: Re: setcap command
    By: Gamgee to Ghost on Mon Oct 10 2022 08:18:00

    Ghost wrote to All <=-

    I have tried (and failed) using the setcap command to allow the
    ports <1024 to be used, but the command has failed with the
    following:

    sbbs@greg-Virtual-Machine:~/sbbs/exec$ sudo setcap cap_net_bind_service=+ep /home/sbbs/sbbs/exec/sbbs Failed to set capabilities on file `/home/sbbs/sbbs/exec/sbbs' (Invalid
    argument) The value of the capability argument is not permitted
    for a file. Or the file is not a regular (non-symlink) file

    My guess is that the 'sbbs' executable (/home/sbbs/sbbs/exec/sbbs) is actually a symlink to the actual file (/home/sbbs/sbbs/repo/exec/sbbs), and it's failing for the reason given in that error message regarding a symlink.

    symlinks shouldnt matter in this regard, most likely the path is wrong (or h isnt root when he is running the commanf)...
    the /home/sbbs/sbbs bit looks suspect, but i don't know how he has installed it.

    setcap works fine on symlinks

    regards
    ---

    Charles Blackburn
    The F.B.O BBS 21:1/221 618:250/36
    bbs.thefbo.us IPV4/V6
    DOVE-Net FSX-Net MicroNET USENET




    ... A really busy person never knows how much he ways.
    ---
    þ Synchronet þ The FBO BBS - bbs.thefbo.us - A place for aviation fun....
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Digital Man@1:103/705 to Charles Blackburn on Thu Oct 13 14:05:10 2022
    Re: Re: setcap command
    By: Charles Blackburn to Gamgee on Tue Oct 11 2022 04:09 pm

    setcap works fine on symlinks

    No, it does not. If /sbbs/exec/sbbs is a symlink, for example, attempting to setcap on it results in this error (as was previously reported):

    $ sudo setcap cap_net_bind_service=+ep /sbbs/exec/sbbs
    Failed to set capabilities on file `/sbbs/exec/sbbs' (Invalid argument)
    The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file
    --
    digital man (rob)

    Synchronet/BBS Terminology Definition #49:
    KD = King Drafus (Allen Christiansen)
    Norco, CA WX: 76.0øF, 66.0% humidity, 2 mph SE wind, 0.00 inches rain/24hrs
    --- SBBSecho 3.15-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)