OS X El Capitan 및 SMB 공유의 파일 권한 문제

OS X El Capitan 및 SMB 공유의 파일 권한 문제

OSX El Capitan으로 업그레이드한 이후 SMB 서버에서 이상한 파일 권한 오류가 발생했습니다.

우리는 작업 파일을 SMB 공유 폴더를 통해 각 Mac 워크스테이션에 호스팅하는 우분투 서버 시스템을 보유하고 있습니다. 우리는 사용SMB를 통한 Git~와 함께소스트리웹 사이트를 구축하기 위해(동일한 데이터베이스와 파일을 공유하는 것이 편리함) OS X El Capitan으로 업그레이드한 이후로 파일 권한이 동일하지 않으며 Git은 해당 권한이 0664에서 0775(또는 0644에서 0755)로 전환됨에 따라 변경된 모든 파일을 표시합니다. .

예를 들어, ls -la개발 서버에서 SSH를 사용한 출력 은 다음과 같습니다.

➜  CashierTheme git:(develop) ls -la
total 72
drwxrwsr-x  9 nestorwww nestorwww  4096 oct.  12 23:42 .
drwxrwsr-x  6 nestorwww nestorwww  4096 avril 14 17:33 ..
-rw-rw-r--  1 nestorwww nestorwww 12261 oct.  12 23:42 CashierThemeApp.php
-rw-rw-r--  1 nestorwww nestorwww    56 oct.  12 23:42 composer.json
-rw-rw-r--  1 nestorwww nestorwww   352 oct.  12 23:42 config.yml
drwxrwsr-x  2 nestorwww nestorwww  4096 oct.  12 23:42 Controllers
-rw-rw-r--  1 nestorwww nestorwww   170 oct.  12 23:42 .editorconfig
drwxrwsr-x  2 nestorwww nestorwww  4096 oct.  12 23:42 Entities
drwxrwsr-x  4 nestorwww nestorwww  4096 oct.  12 23:42 Forms
drwxrwsr-x  8 nestorwww nestorwww  4096 oct.  12 23:42 .git
-rw-rw-r--  1 nestorwww nestorwww    35 oct.  12 23:42 .gitignore
-rw-rw-r--  1 nestorwww nestorwww  1060 oct.  12 23:42 LICENSE.md
-rw-rw-r--  1 nestorwww nestorwww  1819 oct.  12 23:42 README.md
drwxr-sr-x  2 nestorwww nestorwww  4096 oct.  12 23:42 Repositories
drwxrwsr-x  6 nestorwww nestorwww  4096 oct.  12 23:42 Resources
drwxrwsr-x 10 nestorwww nestorwww  4096 oct.  12 23:42 static

파일 권한이 정상입니다. 그런 다음 ls -laSMB 공유 폴더(내 Mac에서)는 다음과 같습니다.

➜  CashierTheme git:(develop) ✗ ls -la
total 328
drwx------  1 ambroisemaupate  staff  16384 12 oct 23:42 .
drwx------  1 ambroisemaupate  staff  16384 14 avr 17:33 ..
-rwx------  1 ambroisemaupate  staff    170 12 oct 23:42 .editorconfig
drwx------  1 ambroisemaupate  staff  16384 12 oct 23:43 .git
-rwx------  1 ambroisemaupate  staff     35 12 oct 23:42 .gitignore
-rwx------  1 ambroisemaupate  staff  12261 12 oct 23:42 CashierThemeApp.php
drwx------  1 ambroisemaupate  staff  16384 12 oct 23:42 Controllers
drwx------  1 ambroisemaupate  staff  16384 12 oct 23:42 Entities
drwx------  1 ambroisemaupate  staff  16384 12 oct 23:42 Forms
-rwx------  1 ambroisemaupate  staff   1060 12 oct 23:42 LICENSE.md
-rwx------  1 ambroisemaupate  staff   1819 12 oct 23:42 README.md
drwx------  1 ambroisemaupate  staff  16384 12 oct 23:42 Repositories
drwx------  1 ambroisemaupate  staff  16384 12 oct 23:42 Resources
-rwx------  1 ambroisemaupate  staff     56 12 oct 23:42 composer.json
-rwx------  1 ambroisemaupate  staff    352 12 oct 23:42 config.yml
drwx------  1 ambroisemaupate  staff  16384 12 oct 23:42 static

git status따라서 개발 서버에 명령을 입력하면 모든 것이 정상입니다.

➜  CashierTheme git:(develop) git status
Sur la branche develop
Votre branche est à jour avec 'origin/develop'.

rien à valider, la copie de travail est propre

git status그리고… SMB 공유의 출력 은 다음과 같습니다 .

➜  CashierTheme git:(develop) ✗ git status
On branch develop
Your branch is up-to-date with 'origin/develop'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   .editorconfig
    modified:   .gitignore
    modified:   CashierThemeApp.php
    modified:   Controllers/ContactController.php
    modified:   Controllers/InvoiceController.php
    modified:   Controllers/PaymentController.php
    modified:   Controllers/PostingController.php
    modified:   Controllers/QuoteController.php
    modified:   Entities/BankOperationTrait.php
    modified:   Entities/Contact.php
    modified:   Entities/Invoice.php
    modified:   Entities/Letter.php
    modified:   Entities/PayableInterface.php
    modified:   Entities/Payment.php
    modified:   Entities/Posting.php
    modified:   Entities/PostingObject.php
    modified:   Entities/Quote.php
    modified:   Forms/ContactSelectorType.php
    modified:   Forms/ContactType.php
    modified:   Forms/DataTransformer/ContactToNumberTransformer.php
    modified:   Forms/Filters/ContactFilterType.php
    modified:   Forms/Filters/PostingFilterType.php
    modified:   Forms/Filters/QuoteFilterType.php
    modified:   Forms/InvoiceStatusType.php
    modified:   Forms/InvoiceType.php
    modified:   Forms/PaymentType.php
    modified:   Forms/PostingObjectType.php
    modified:   Forms/PostingObjectUnitType.php
    modified:   Forms/PostingType.php
    modified:   Forms/QuoteStatusType.php
    modified:   Forms/QuoteType.php
    modified:   LICENSE.md
    modified:   README.md
    modified:   Repositories/PostingRepository.php
    modified:   Resources/config/.gitignore
    modified:   Resources/config/fonts.default.xml
    modified:   Resources/config/pdf_stylesheet.default.xml
    modified:   Resources/firewalled-routes.yml
    modified:   Resources/imports/roles.rzt
    modified:   Resources/imports/settings.rzt
    modified:   Resources/routes.yml
    modified:   Resources/translations/messages.en.xlf
    modified:   Resources/translations/messages.fr.xlf
    modified:   Resources/views/404.html.twig
    modified:   Resources/views/admin/test.html.twig
    modified:   Resources/views/base.html.twig
    modified:   Resources/views/baseAnonymous.html.twig
    modified:   Resources/views/blocks/filters.html.twig
    modified:   Resources/views/blocks/paidtotals.html.twig
    modified:   Resources/views/blocks/totals.html.twig
    modified:   Resources/views/blocks/totals.xml.twig
    modified:   Resources/views/blocks/waitingtotals.html.twig
    modified:   Resources/views/contacts/edit.html.twig
    modified:   Resources/views/contacts/list.html.twig
    modified:   Resources/views/dashboard/list.html.twig
    modified:   Resources/views/forms.html.twig
    modified:   Resources/views/invoices/edit.html.twig
    modified:   Resources/views/invoices/list.html.twig
    modified:   Resources/views/invoices/view.xml.twig
    modified:   Resources/views/modules/navigation-elements.html.twig
    modified:   Resources/views/modules/navigation.html.twig
    modified:   Resources/views/payments/edit.html.twig
    modified:   Resources/views/payments/list.html.twig
    modified:   Resources/views/pdfbase.xml.twig
    modified:   Resources/views/quotes/edit.html.twig
    modified:   Resources/views/quotes/list.html.twig
    modified:   Resources/views/quotes/view.xml.twig
    modified:   Resources/views/tabledforms.html.twig
    modified:   composer.json
    modified:   config.yml
    modified:   static/Gruntfile.js
    modified:   static/bower.json
    modified:   static/css/main.less
    modified:   static/css/normalize.less
    modified:   static/css/postings/commons.less
    modified:   static/css/style.less
    modified:   static/css/style.min.css
    modified:   static/css/vars.less
    modified:   static/css/vendor.less
    modified:   static/css/vendor.min.css
    typechange: static/css/widgets/debugpanel.less
    modified:   static/css/widgets/nav.less
    modified:   static/fonts/fontawesome-webfont.woff2
    modified:   static/js/main.js
    modified:   static/js/vendor/jquery-2.1.3.min.js
    modified:   static/js/vendor/uikit.min.js
    modified:   static/package.json
    modified:   static/public/cashier-theme.08d1e458.min.js
    modified:   static/public/config/assets.config.php
    modified:   static/public/style.7474e8a1.css
    modified:   static/public/vendor-cashier-theme.1a8458ff.min.js
    modified:   static/public/vendor.03b81695.css

no changes added to commit (use "git add" and/or "git commit -a")

와 더불어 git diff:

diff --git a/.editorconfig b/.editorconfig
old mode 100644
new mode 100755
diff --git a/.gitignore b/.gitignore
old mode 100644
new mode 100755
diff --git a/CashierThemeApp.php b/CashierThemeApp.php
old mode 100644
new mode 100755
diff --git a/Controllers/ContactController.php b/Controllers/ContactController.php
old mode 100644
new mode 100755

기타 등등

마지막 스니펫은 파일에 0644를 사용하고 디렉터리에 0755를 사용하도록 명시적으로 지시하는 SMB 공유 구성입니다.

[DevWebServer]
   path = /var/www
   force group = myuser
   force user = myuser
   browsable = yes
   writeable = yes
   create mask = 0644
   directory mask = 0755
   force create mode = 0644
   force directory mode = 0755
   hide dot files = no
   guest ok = no
   public = no
   veto files = /._*/.DS_Store/.AppleDouble
   delete veto files = yes

이전에는 OS X Yosemite를 사용하면서 어떤 문제도 없었습니다.

  • OS 10.11로 업그레이드한 후 이 문제를 경험한 사람이 있습니까?
  • 서버에서 SMB 공유까지 동일한 권한을 유지하는 해결 방법을 아는 사람이 있습니까?
  • SMB 공유 구성에서 뭔가를 잊어버렸습니까?

SMB 대신 Git을 사용하는 이유가 궁금하신 분들을 위해 말씀드리자면, 웹사이트를 구축하는 동시에 많은 사람들과 함께 일하기 때문입니다. 우리 워크스테이션에 각각 복사본을 가지고 있으면 데이터베이스와 문서 파일을 동기화하는 것이 어려울 것입니다.

시간을 내어 읽어주셔서 감사합니다.

답변1

나에게 이 일은

[Shared]
    comment = Folder Shared
    path = /path
    unix extensions = no
    force group = root
    force user = root
    browsable = yes
    writeable = yes
    create mask = 0644
    directory mask = 0755
    force create mode = 0644
    force directory mode = 0755
    hide dot files = no
    guest ok = no
    public = no
    valid users = @users

답변2

SMB2를 지원하는 최신(4.2 이상) 버전의 Samba를 사용해 볼 수도 있습니다.vfs_과일공유에. 이는 SMB1/CIFS용 Unix 확장보다 더 잘 작동하는 SMB2용 Apple의 AAPL 확장에 대한 지원을 추가합니다.

답변3

이 문제는 OS X 10.11.1로 업그레이드한 후에도 계속 발생합니다.

부분적인 해결 방법으로 SMB 대신 SSHFS를 사용하여 파일을 공유할 수 있습니다. SSHFS는 권한을 유지하지만 몇 가지 단점이 있습니다.

  • 여러 사용자가 동일한 파일을 쓸 때 문제가 발생합니다.
  • 기본 확장 속성, ACL 등은 지원되지 않습니다.
  • SMB보다 느립니다.

Apple 지원 커뮤니티에 대한 토론도 참조하세요.https://discussions.apple.com/message/29104711

답변4

Ubuntu smb.conf파일에서 다음 명령문을 사용하여 Unix 확장을 비활성화해 보십시오:

unix extensions = no

그런 다음 Samba를 다시 시작하고 문제가 지속되는지 확인하십시오.

관련 정보