Sponsored Content
Full Discussion: ZFS ACLS and vim
Operating Systems Solaris ZFS ACLS and vim Post 302938938 by achenle on Friday 20th of March 2015 07:11:51 AM
Old 03-20-2015
The chmod() at 2.7074 is probably the culprit.

You can start up this dtrace script as root, then use vim to cause ACLs to disappear:

Code:
#!/usr/sbin/dtrace -s

#pragma D option flowindent

syscall::fchmodat:entry
/execname=="vim"/
{
    printf( "%s, 0x%x\n", execname, arg1 );
    self->trace = 1;
}

syscall::fchmodat:return
/self->trace/
{
    self->trace = 0;
}

fbt:::
/self->trace/
{
}

That'll show what's going on under the hood.

To verify that it's indeed that chmod() call that's blowing away the ACLs, take this C code:

Code:
int chmod( const char *name, unsigned int mode )
{
    return( 0 );
}

Compile it:
Code:
gcc -m32 -shared chmod.c -o chmod.so (gcc)

or
Code:
cc -G chmod.c -o chmod.so (Sun Studio)

Set your LD_PRELOAD_32:
Code:
export LD_PRELOAD_32=/path/to/chmod.so

Rerun vim from the same shell you set LD_PRELOAD_32 in.

If the ACLs are preserved, it's a bug in vim.

Oh yeah - don't do anything else from the bash session where you have the LD_PRELOAD set. Things aren't going to behave well with chmod() stubbed out like that.

And I recommend you never, ever use just plain "LD_PRELOAD" on Solaris. Always use LD_PRELOAD_32 or LD_PRELOAD_64. If a 32-bit binary hits a 64-bit shared object in LD_PRELOAD, or the other way around, it won't run.
This User Gave Thanks to achenle For This Post:
 

9 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

Help with Vim

How do I use compilers and syntax highlighting in (g)Vim? Specifically, I need a Common Lisp compiler and a C++ compiler. Thanks in advance! (Note: Disregard my other topic.) (1 Reply)
Discussion started by: led3234
1 Replies

2. UNIX for Advanced & Expert Users

changing UGO to ACLs on a file

Hello, I have a directory and a list of files in it on which I'd like to set ACLs and quota. To set ACLs regarding the UGO rights set at the moment, I haven't found any other way than grabbing the UGO rights set on the file with a shell cut command and then applying setfacl commands to that... (2 Replies)
Discussion started by: davchris
2 Replies

3. Solaris

Very Importan - Vim Settings - Error while opening a File using vim

I downloaded vim.7.2 and compiled the vim source . Added the vim binary path to PATH (Because iam not the root of the box) when i load the file using vim it throws me an error Error detected while processing /home2/e3003091/.vimrc: line 2: E185: Cannot find color scheme darkblue line... (0 Replies)
Discussion started by: girija
0 Replies

4. Emergency UNIX and Linux Support

Squid acls

Hi guys, There is a line in squid default configuration: # Deny CONNECT to other than secure SSL ports http_access deny CONNECT !SSL_ports acls are applied from top down, so CONNECT acl will deny access to all non SSL and SSL ports. I mean it never reaches the second access rule. (0 Replies)
Discussion started by: majid.merkava
0 Replies

5. Red Hat

Chmod overiding default ACLs.

Afternoon all, This should be a simple task. I have set up default acls on a directory to allow user user1 to read it. This directory is owned by root:root. setfacl -d -m u:user1:rx /directory I also did via the group. This works fine, new files made by root are readable. ... (4 Replies)
Discussion started by: snoop6060
4 Replies

6. UNIX for Advanced & Expert Users

Does regular Linux installation in fact uses any ACLs in any file/dir?

Hi everybody As the title says I wonder if the usual (in my case Ubuntu 14.04 LTS) linux installation root does in fact uses any of the ACLs possible extensions in any of its files/dirs I ask this because I usually use tar to backup the entire root (in offline) with a command like this (root... (2 Replies)
Discussion started by: man-walking
2 Replies

7. Red Hat

ACLs - How can i create new executable files

Hello experts, I would like to know if is possible to create a default acl rule to a directory. in this directory all files created should have executable permissions by the group IT. i tried setfacl -m d:g:it:rwx /files tried to change the mask setfacl -m m::rwx /files but i still... (3 Replies)
Discussion started by: berveglieri
3 Replies

8. Red Hat

Is there limit on number of ACLs' per directory in Redhat

I work on a distribution application on Linux which generates bulk reference data extract feeds and stores them on a Linux server. I have several consumer applications access the files stored on this Linux server using FTPS protocol. However in order for consumer applications to have access to... (2 Replies)
Discussion started by: waavman
2 Replies

9. AIX

Unable to set ACLs on sulog - need to grant read permission to a normal user on AIX 6.1

Hi, I need to grant read permission to a normal user on sulog file on AIX 6.1. As root I did acledit sulog and aclget shows "extended permissions" as "enabled" and normal user "splunk" has read permissions. When I try to access sulog as splunk user it won't allow and aclget for splunk user... (6 Replies)
Discussion started by: prvnrk
6 Replies
LCHMOD(3)						   BSD Library Functions Manual 						 LCHMOD(3)

NAME
lchmod -- change mode of file SYNOPSIS
#include <sys/stat.h> #include <unistd.h> int lchmod(const char *path, mode_t flags); DESCRIPTION
The function lchmod() sets the file permission bits of the file specified by the pathname path to mode. See chmod(2) for the values of the flags. The lchmod() call is like chmod() except when the named file is a symbolic link, in which case lchmod() will change the flags of the link itself, rather than the file it points to. NOTE
Instead of being a system call, lchmod() is emulated using setattrlist(2). Not all file systems support setattrlist(2). RETURN VALUES
Upon successful completion, a value of 0 is returned. Otherwise, -1 is returned and the global variable errno is set to indicate the error. ERRORS
The lchmod() call may return the same errors as chmod(2) and setattrlist(2). SEE ALSO
chmod(2), setattrlist(2) BSD
Oct 31, 2005 BSD
All times are GMT -4. The time now is 02:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy