ALT Linux Bugzilla
– Attachment 6179 Details for
Bug 30281
Попытка выполнить chmod на ссылки, ведущие на файлы, недоступные для записи
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
chownr fix
0002-skip-symlinks-as-bin-chown-R-does.patch (text/plain), 1.29 KB, created by
Vitaly Lipatov
on 2014-11-21 15:33:09 MSK
(
hide
)
Description:
chownr fix
Filename:
MIME Type:
Creator:
Vitaly Lipatov
Created:
2014-11-21 15:33:09 MSK
Size:
1.29 KB
patch
obsolete
>From 204952ccc329fcdc6f0e67f730a9e2e1e4823910 Mon Sep 17 00:00:00 2001 >From: Vladislav Bolshakov <barbass> >Date: Thu, 20 Nov 2014 17:54:22 +0300 >Subject: [PATCH 2/4] skip symlink > >--- > chownr.js | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) > >diff --git a/chownr.js b/chownr.js >index 598b8f8..969085d 100644 >--- a/chownr.js >+++ b/chownr.js >@@ -14,7 +14,15 @@ function chownr (p, uid, gid, cb) { > var len = children.length > , errState = null > children.forEach(function (child) { >- chownr(path.resolve(p, child), uid, gid, then) >+ var path_child = path.resolve(p, child); >+ fs.lstat(path_child, function(er, stats) { >+ if (er) >+ return cb(er) >+ if (!stats.isSymbolicLink()) >+ chownr(path_child, uid, gid, then) >+ else >+ then() >+ }) > }) > function then (er) { > if (errState) return >@@ -35,7 +43,10 @@ function chownrSync (p, uid, gid) { > if (!children.length) return fs.chownSync(p, uid, gid) > > children.forEach(function (child) { >- chownrSync(path.resolve(p, child), uid, gid) >+ var path_child = path.resolve(p, child) >+ var stats = fs.lstatSync(path_child) >+ if (!stats.isSymbolicLink()) >+ chownrSync(path_child, uid, gid) > }) > return fs.chownSync(p, uid, gid) > } >-- >1.8.5.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 30281
:
6178
| 6179