[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tramp: changing umask?
From: |
Barry Margolin |
Subject: |
Re: Tramp: changing umask? |
Date: |
Wed, 08 Jun 2016 16:33:02 -0400 |
User-agent: |
MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) |
In article <drrag5Fi9grU1@mid.individual.net>,
egarrulo <egarrulo@gmail.com> wrote:
> On 08/06/16 17:20, Barry Margolin wrote:
> > In article <drq6pqFb3dsU1@mid.individual.net>,
> > egarrulo <egarrulo@gmail.com> wrote:
> >
> >> When I create a file with C-x C-f (ido-find-file) in Tramp, Tramp
> >> creates the file with 0664 permissions instead of 0644 permissions.
> >>
> >> Here is the relevant configuration:
> >>
> >> (setq tramp-default-user "myuser")
> >> (require 'tramp)
> >>
> >> How can I make Tramp create new files with 0644 permissions? Thanks.
> >
> > It sounds like the target user's umask is different from your umask.
>
> Thanks for your suggestion. Indeed the user's umask is 0002, which explains
> the 0664 permissions. Can I change the umask from Tramp before
> creating/saving files?
You can use tramp-remote-process-environment to set environment
variables for the remote shell.
(add-to-list 'tramp-remote-process-environment "TRAMP_UMASK=022")
The .profile can look for an environment variable that's set there, and
set umask appropriately.
if [ "$TRAMP_UMASK" ]
then umask "$TRAMP_UMASK"
else umask 002
fi
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
- Tramp: creating new files with 0644 permissions rather than 0664?, egarrulo, 2016/06/08
- Re: Tramp: creating new files with 0644 permissions rather than 0664?, egarrulo, 2016/06/08
- Re: Tramp: creating new files with 0644 permissions rather than 0664?, Barry Margolin, 2016/06/08
- Re: Tramp: changing umask?, egarrulo, 2016/06/08
- Re: Tramp: changing umask?,
Barry Margolin <=
- Re: Tramp: changing umask?, egarrulo, 2016/06/08
- Re: Tramp: changing umask?, Nick Dokos, 2016/06/08
- Message not available
- Re: Tramp: changing umask?, egarrulo, 2016/06/08
- Re: Tramp: changing umask?, Michael Albinus, 2016/06/09
- Message not available
- Re: Tramp: changing umask?, egarrulo, 2016/06/09