You are not logged in.

#1 2020-12-05 20:10:26

lost_eth0
Member
From: USA
Registered: 2020-07-31
Posts: 30
Website

mkdir uses 777 instead of 755 after update?

Hey all, I just `pacman -Syu`'d last night, and now when I use `mkdir`, it defaults to using 777 instead of 755, and I have no idea why. I tried adding `alias mkdir=mkdir -m755` in my zshrc, but that didn't help, so I'm gonna post here. Is there some way for me to change the default?? Having to `chmod 755` after every mkdir is _really_ annoying.

Offline

#2 2020-12-05 20:13:19

loqs
Member
Registered: 2014-03-06
Posts: 19,036

Re: mkdir uses 777 instead of 755 after update?

What is the output of `umask`?

Offline

#3 2020-12-05 20:13:56

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: mkdir uses 777 instead of 755 after update?

the umask is set in /etc/profile. Is that not getting sourced? Unmerged pacnew files?

Offline

#4 2020-12-05 20:14:15

lost_eth0
Member
From: USA
Registered: 2020-07-31
Posts: 30
Website

Re: mkdir uses 777 instead of 755 after update?

loqs wrote:

What is the output of `umask`?

`000`

Offline

#5 2020-12-05 20:16:07

lost_eth0
Member
From: USA
Registered: 2020-07-31
Posts: 30
Website

Re: mkdir uses 777 instead of 755 after update?

Scimmia wrote:

the umask is set in /etc/profile. Is that not getting sourced? Unmerged pacnew files?

Its entirely possible, but I'm not sure what I would have done to cause that to happen? Where is it sourced by default?

Offline

#6 2020-12-05 20:16:59

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: mkdir uses 777 instead of 755 after update?

It's sourced by most shells when they're started as a login shell.

Offline

#7 2020-12-05 20:19:30

lost_eth0
Member
From: USA
Registered: 2020-07-31
Posts: 30
Website

Re: mkdir uses 777 instead of 755 after update?

Scimmia wrote:

It's sourced by most shells when they're started as a login shell.

Huh, thats really odd. I guess zsh doesn't source it for whatever reason as of the latest version?? adding `source /etc/profile` to my zshrc fixed it.

Offline

#8 2020-12-05 20:24:17

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: mkdir uses 777 instead of 755 after update?

How are you logging in?

Edit: zsh sources it by default on Arch from /etc/zsh/zprofile.

Last edited by Scimmia (2020-12-05 20:26:41)

Offline

#9 2020-12-05 20:32:26

lost_eth0
Member
From: USA
Registered: 2020-07-31
Posts: 30
Website

Re: mkdir uses 777 instead of 755 after update?

Scimmia wrote:

How are you logging in?

Edit: zsh sources it by default on Arch from /etc/zsh/zprofile.

I log in directly through tty.

I have a custom .zprofile, maybe thats the issue.

This is my .zprofile:

if systemctl -q is-active graphical.target \
&& [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
  xinit;
fi;

Offline

#10 2020-12-05 20:38:12

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: mkdir uses 777 instead of 755 after update?

~/.zprofile won't cancel out /etc/zsh/zprofile.

What's in $PATH right now?

Offline

#11 2020-12-05 20:40:25

lost_eth0
Member
From: USA
Registered: 2020-07-31
Posts: 30
Website

Re: mkdir uses 777 instead of 755 after update?

Scimmia wrote:

~/.zprofile won't cancel out /etc/zsh/zprofile.

What's in $PATH right now?

/home/jack/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin

Offline

#12 2020-12-05 21:00:06

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: mkdir uses 777 instead of 755 after update?

So the perl paths aren't in there twice, which they would be if you were sourcing /etc/profile twice, so it does appear it's not getting sourced when you log in. Unless you're logging in with a different shell then starting zsh or /etc/zsh/zprofile is messed up, I don't know what's going on.

Offline

#13 2020-12-05 21:23:56

loqs
Member
Registered: 2014-03-06
Posts: 19,036

Re: mkdir uses 777 instead of 755 after update?

Scimmia wrote:

So the perl paths aren't in there twice, which they would be if you were sourcing /etc/profile twice, so it does appear it's not getting sourced when you log in.

Would the use of append_path() in profile prevent the perl paths being added twice?

Offline

#14 2020-12-05 23:14:43

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,678

Re: mkdir uses 777 instead of 755 after update?

zsh -lxc exit > /tmp/zsh.trace 2>&1

You can then inspect /tmp/zsh.trace for whether/when /etc/profile is source, where and how umask is set etcetc.

Are you btw. using OMZ?

Offline

#15 2020-12-06 02:18:18

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: mkdir uses 777 instead of 755 after update?

loqs wrote:
Scimmia wrote:

So the perl paths aren't in there twice, which they would be if you were sourcing /etc/profile twice, so it does appear it's not getting sourced when you log in.

Would the use of append_path() in profile prevent the perl paths being added twice?

You're right, it would. I forgot that changed a few months ago, so my test was invalid.

Offline

#16 2020-12-06 20:35:29

lost_eth0
Member
From: USA
Registered: 2020-07-31
Posts: 30
Website

Re: mkdir uses 777 instead of 755 after update?

seth wrote:
zsh -lxc exit > /tmp/zsh.trace 2>&1

You can then inspect /tmp/zsh.trace for whether/when /etc/profile is source, where and how umask is set etcetc.

Are you btw. using OMZ?

Yep, i'm using OMZ.

Looks to me like its sourcing /etc/profile at the beginning, but then it does it again at the end when I source it manually. Perhaps something is undoing the changes done by /etc/profile in between?

Offline

#17 2020-12-06 21:17:37

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,678

Re: mkdir uses 777 instead of 755 after update?

Perhaps something is undoing the changes done by /etc/profile

Yep, i'm using OMZ.

Try to un-use that and whether the situation remains the same.

Offline

#18 2020-12-06 21:44:26

chaseleif
Member
From: Texas
Registered: 2020-08-01
Posts: 18

Re: mkdir uses 777 instead of 755 after update?

Someone asked already what your umask was, and apparently it is 000 ....
The umask is a (not) bit flag.... try setting it to 006

do:

# see what the umask is
umask
# change the umask to restrict others
umask 006
# see the umask, it should be changed
umask
# make a file
touch test
# see the permissions
ls -l test

if that works then set the umask in the /etc/profile to make system-wide.

Is this the problem?

Offline

#19 2020-12-06 21:51:34

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,678

Re: mkdir uses 777 instead of 755 after update?

https://bbs.archlinux.org/viewtopic.php … 2#p1941892

The entire problem of this thread is that something™ (it's gonna be OMZ because it's always OMZ…) overrides the umask set in /etc/profile

Offline

#20 2020-12-06 21:51:53

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 696

Re: mkdir uses 777 instead of 755 after update?

chaseleif wrote:

if that works then set the umask in the /etc/profile to make system-wide.

Is this the problem?

You know, the umask is system-wide /etc/profile as 022...
And he's using OMZ, the so widely know to cause breakage is seems (I haven't used it, only thing I tried on my zsh days was grml cause the archiso looked quite neat)

So, lets wait for OP to un-use OMZ and report if the issue persists.

Last edited by GaKu999 (2020-12-06 21:52:50)


My reposSome snippets

Heisenberg might have been here.

Offline

Board footer

Powered by FluxBB