Skip to content

Commit 8a2440e

Browse files
Updated localtxn for logic of path resolution
1 parent 298db69 commit 8a2440e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

internal/transprocessor/localtxn.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,28 +30,28 @@ func (p *PermProcessor) HandleLocalTransaction(txn *types.Transaction, absoluteP
3030
zap.String("Transaction ID", txn.ID.String()),
3131
zap.String("Action", txn.Entries.Action),
3232
zap.String("Entry", aclEntry),
33-
zap.String("Path", txn.TargetPath),
33+
zap.String("Path", absolutePath),
3434
)
3535

3636
/* lock the file path for thread safety (ensure unlock even on panic) */
37-
lock := getPathLock(txn.TargetPath)
37+
lock := getPathLock(absolutePath)
3838
lock.Lock()
3939
defer lock.Unlock()
4040

4141
/* execute the ACL modifications with acl commands */
4242
var cmd *exec.Cmd
4343
switch txn.Entries.Action {
4444
case "add", "modify":
45-
cmd = exec.Command("setfacl", "-m", aclEntry, txn.TargetPath)
45+
cmd = exec.Command("setfacl", "-m", aclEntry, absolutePath)
4646
case "remove":
47-
cmd = exec.Command("setfacl", "-x", aclEntry, txn.TargetPath)
47+
cmd = exec.Command("setfacl", "-x", aclEntry, absolutePath)
4848
default:
4949
// sendResponse(conn, false, "Unsupported action: "+req.Action)
5050
txn.ErrorMsg = fmt.Sprintf("unsupported ACL action: %s", txn.Entries.Action)
5151
}
5252

5353
start := time.Now()
54-
54+
5555
output, err := cmd.CombinedOutput()
5656

5757
duration := time.Since(start).Milliseconds()

0 commit comments

Comments
 (0)