Skip to content

openSUSE patch for tmux.c #42

Description

@nemysis

Hello I'm openSUSE Maintainer for tmux

https://build.opensuse.org/package/show/utilities/tmuxHello I'm openSUSE Maintainer for tmux

https://build.opensuse.org/package/show/utilities/tmux

This patch i have found when have get Maintainer status

/usr/local/suse/utilities/tmux/ > cat tmux-socket-path.patch 
--- tmux-1.9a.orig/tmux.c
+++ tmux-1.9a/tmux.c
@@ -137,7 +137,7 @@ makesocketpath(const char *label)
        else if ((s = getenv("TMPDIR")) != NULL && *s != '\0')
                xsnprintf(base, sizeof base, "%s/tmux-%u", s, uid);
        else
-               xsnprintf(base, sizeof base, "%s/tmux-%u", _PATH_TMP, uid);
+               xsnprintf(base, sizeof base, "/run/tmux/%u", uid);

        if (mkdir(base, S_IRWXU) != 0 && errno != EEXIST)
                return (NULL);

and in old tmux.spec

/usr/local/suse/utilities/tmux/ >   cat tmux.spec
# PATCH-FIX-OPENSUSE tmux-socket-path.patch [email protected] -- Use /run/tmux instead of /tmp as the default socket path, this add some robustness against accidenta
l deletion via systemd-tmpfiles-clean, tmpwatch, or similar
Patch0:         tmux-socket-path.patch
...
%prep
%setup -q
%if %{with systemd}
%patch0 -p1
%endif

I have changed that use sed instead patch in tmux.spec

/usr/local/suse/home:nemysis:branches:utilities/tmux/ > cat tmux.spec
%if %{with systemd}
# SED-FIX-OPENSUSE [email protected] -- Use /run/tmux instead of /tmp as the default socket path, this add some robustness against accidental deletion via systemd-tm
pfiles-clean, tmpwatch, or similar
sed -i s'|"%s/tmux-%u", _PATH_TMP, uid)|"/run/tmux/%u", uid);|' tmux.c
%endif

Please add check for openSUSE in tmux.c and add this to Source.

Thanks,

This patch i have found when have get Maintainer status

/usr/local/suse/utilities/tmux/ > cat tmux-socket-path.patch 
--- tmux-1.9a.orig/tmux.c
+++ tmux-1.9a/tmux.c
@@ -137,7 +137,7 @@ makesocketpath(const char *label)
        else if ((s = getenv("TMPDIR")) != NULL && *s != '\0')
                xsnprintf(base, sizeof base, "%s/tmux-%u", s, uid);
        else
-               xsnprintf(base, sizeof base, "%s/tmux-%u", _PATH_TMP, uid);
+               xsnprintf(base, sizeof base, "/run/tmux/%u", uid);

        if (mkdir(base, S_IRWXU) != 0 && errno != EEXIST)
                return (NULL);

and in old tmux.spec

/usr/local/suse/utilities/tmux/ >   cat tmux.spec
# PATCH-FIX-OPENSUSE tmux-socket-path.patch [email protected] -- Use /run/tmux instead of /tmp as the default socket path, this add some robustness against accidenta
l deletion via systemd-tmpfiles-clean, tmpwatch, or similar
Patch0:         tmux-socket-path.patch
...
%prep
%setup -q
%if %{with systemd}
%patch0 -p1
%endif

I have changed that use sed instead patch in tmux.spec

/usr/local/suse/home:nemysis:branches:utilities/tmux/ > cat tmux.spec
%if %{with systemd}
# SED-FIX-OPENSUSE [email protected] -- Use /run/tmux instead of /tmp as the default socket path, this add some robustness against accidental deletion via systemd-tm
pfiles-clean, tmpwatch, or similar
sed -i s'|"%s/tmux-%u", _PATH_TMP, uid)|"/run/tmux/%u", uid);|' tmux.c
%endif

Please add check for openSUSE in tmux.c and add this to Source.

Thanks,

Activity

  1. ThomasAdam commented on Jul 7, 2015

    @ThomasAdam
    Contributor

    No. Either patch _PATH_TMP in compat.h, or accept /tmp/ as the default. But patching tmux.c is not correct.

  2. nicm commented on Jul 7, 2015

    @nicm
    Member

    Sorry we are happy with the sockets in /tmp. 

  3. lock commented on Feb 17, 2020

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  4. locked and limited conversation to collaborators on Feb 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions