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
CHMOD(3)								 1								  CHMOD(3)

chmod - Changes file mode

SYNOPSIS
bool chmod (string $filename, int $mode) DESCRIPTION
Attempts to change the mode of the specified file to that given in $mode. PARAMETERS
o $filename - Path to the file. o $mode - Note that $mode is not automatically assumed to be an octal value, so to ensure the expected operation, you need to prefix $mode with a zero (0). Strings such as "g+w" will not work properly. <?php chmod("/somedir/somefile", 755); // decimal; probably incorrect chmod("/somedir/somefile", "u+rwx,go+rx"); // string; incorrect chmod("/somedir/somefile", 0755); // octal; correct value of mode ?> man 1 chmod' and ' man 2 chmod'. <?php // Read and write for owner, nothing for everybody else chmod("/somedir/somefile", 0600); // Read and write for owner, read for everybody else chmod("/somedir/somefile", 0644); // Everything for owner, read and execute for others chmod("/somedir/somefile", 0755); // Everything for owner, read and execute for owner's group chmod("/somedir/somefile", 0750); ?> RETURN VALUES
Returns TRUE on success or FALSE on failure. NOTES
Note The current user is the user under which PHP runs. It is probably not the same user you use for normal shell or FTP access. The mode can be changed only by user who owns the file on most systems. Note This function will not work on remote files as the file to be examined must be accessible via the server's filesystem. Note When safe mode is enabled, PHP checks whether the files or directories you are about to operate on have the same UID (owner) as the script that is being executed. In addition, you cannot set the SUID, SGID and sticky bits. SEE ALSO
chown(3), chgrp(3), fileperms(3), stat(3). PHP Documentation Group CHMOD(3)
All times are GMT -4. The time now is 11:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy