Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a shell script that I execute after uninstalling a web application. The script is meant to clean up permissions that were needed during the execution of the application.

find /opt/path -exec setacl -d user:myUser {} ';'

After this executes and the acl is removed I am left with an acl that looks as follows

user:101:--- /opt/path

How can I properly call setacl to remove the user without leaving behind a uid?

share|improve this question

migrated from stackoverflow.com Jan 15 '11 at 10:04

This question came from our site for professional and enthusiast programmers.

Can you show the output from getacl /opt/path before you run anything, and then afterwards too? Plus the output of ls -ld /opt/path both before and after too. That way, there's a chance we'll see what's changed. What was the UID of myUser? – Jonathan Leffler Jan 15 '11 at 0:35
@Jonathan the UID was 101 of the user, I am not sure if that is coincidental – Woot4Moo Jan 15 '11 at 0:41

If you've quoted your command accurately as:

find /opt/path -exec setacl -d user:myUser{} ';'

you are missing a crucial space:

find /opt/path -exec setacl -d user:myUser {} ';'

The former invokes undefined (or maybe implementation-defined) behaviour from find; it might or might not expand the file name when the {} is not in an argument on its own. But it then invokes the setacl command with no filename; it combines the filename with the control argument user:myUser.

It is most unlikely to be correct as written - but I'm hoping that it is just a typo in your transcription from your system to SO.

share|improve this answer
Yeah, I just noticed, but if the missing space was a problem, I think there would be an error from setacl, or it would do nothing. – Gilles Jan 15 '11 at 0:22
Yeah - I think we can treat it as a transcription error. On a HP-UX machine, running $setacl -d user:101$PWD generated unknown user-id "101/u/jleffler". So, technically an accurate answer, but not really the help the question needed. – Jonathan Leffler Jan 15 '11 at 0:28
Oops typo on my part. – Woot4Moo Jan 15 '11 at 0:28

Is user 101 the owner of the file? If so, you need to change the file to a different user ID, with chown (in addition to, or in lieu of, the setacl call). Every file belongs to one user and one group; ACLs come in addition to that.

Note that I've never used ACLs on HP/UX, so I may be missing something.

It might help if you showed the output of ls -ld /opt/path and getacl /opt/path before you run that find command.

share|improve this answer
root:sys as owner:group – Woot4Moo Jan 15 '11 at 0:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.