ALT Linux Bugzilla
– Attachment 6178 Details for
Bug 30281
Попытка выполнить chmod на ссылки, ведущие на файлы, недоступные для записи
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
chmodr fix
0001-skip-symlinks-as-bin-chmod-R-does.patch (text/plain), 1.38 KB, created by
Vitaly Lipatov
on 2014-11-21 15:32:45 MSK
(
hide
)
Description:
chmodr fix
Filename:
MIME Type:
Creator:
Vitaly Lipatov
Created:
2014-11-21 15:32:45 MSK
Size:
1.38 KB
patch
obsolete
>From b170ec5b4ba46da5d89e8d3da3eff1e354fc6a66 Mon Sep 17 00:00:00 2001 >From: Vladislav Bolshakov <barbass> >Date: Fri, 5 Sep 2014 16:17:33 +0400 >Subject: [PATCH 1/2] skip symlinks as /bin/chmod -R does >To: wine-patches <wine-patches@winehq.org> >Reply-To: wine-devel <wine-devel@winehq.org> > >--- > chmodr.js | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) > >diff --git a/chmodr.js b/chmodr.js >index 9edaa7f..613453b 100644 >--- a/chmodr.js >+++ b/chmodr.js >@@ -18,7 +18,15 @@ function chmodr (p, mode, cb) { > var len = children.length > var errState = null > children.forEach(function (child) { >- chmodr(path.resolve(p, child), mode, then) >+ var path_child = path.resolve(p, child); >+ fs.lstat(path_child, function(er, stats) { >+ if (er) >+ return cb(er) >+ if (!stats.isSymbolicLink()) >+ chmodr(path_child, mode, then) >+ else >+ then() >+ }) > }) > function then (er) { > if (errState) return >@@ -39,7 +47,10 @@ function chmodrSync (p, mode) { > if (!children.length) return fs.chmodSync(p, dirMode(mode)) > > children.forEach(function (child) { >- chmodrSync(path.resolve(p, child), mode) >+ var path_child = path.resolve(p, child) >+ var stats = fs.lstatSync(path_child) >+ if (!stats.isSymbolicLink()) >+ chmodrSync(path_child, mode) > }) > return fs.chmodSync(p, dirMode(mode)) > } >-- >2.1.3 >
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