René's URL Explorer Experiment


Title: Missing SFTP file attribute constants · Issue #119 · ParallelSSH/ssh2-python · GitHub

Open Graph Title: Missing SFTP file attribute constants · Issue #119 · ParallelSSH/ssh2-python

X Title: Missing SFTP file attribute constants · Issue #119 · ParallelSSH/ssh2-python

Description: Bug reports I tried to set permission on a file on a SFTP server. I use normally use FileZilla to interact with the server, but I needed a fast way to change a lot of files, file permission. So I thought I would write a python script. I ...

Open Graph Description: Bug reports I tried to set permission on a file on a SFTP server. I use normally use FileZilla to interact with the server, but I needed a fast way to change a lot of files, file permission. So I t...

X Description: Bug reports I tried to set permission on a file on a SFTP server. I use normally use FileZilla to interact with the server, but I needed a fast way to change a lot of files, file permission. So I t...

Opengraph URL: https://github.com/ParallelSSH/ssh2-python/issues/119

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Missing SFTP file attribute constants","articleBody":"### Bug reports\r\nI tried to set permission on a file on a SFTP server. I use normally use FileZilla to interact with the server, but I needed a fast way to change a lot of files, file permission. So I thought I would write a python script.\r\n\r\nI noticed 2 things, if I only have read access to the file, I could not change the permission, giving me a `ssh2.exceptions.SFTPProtocolError`, I can using the same login, change the permission in FileZilla.\r\n\r\nThe second and more important issue, was that I could not change the permission at all using the code described below:\r\n__Steps to reproduce:__\r\n\r\n```py\r\ndef chmod(sftp, path, permissions):\r\n    stat = sftp.stat(path)\r\n    print(\"original permission\", oct(stat.permissions))\r\n    \r\n    stat.permissions = permissions | 0x8000 #I tried without the '|' as well, and I tried with only LIBSSH2_SFTP_S_IRWXU\r\n    print(\"seting permissions to \", oct(stat.permissions))\r\n\r\n    try:\r\n        if sftp.setstat(path, stat) == 0:\r\n            stat = sftp.stat(path)\r\n            print(\"managed to set permissions to \", oct(stat.permissions))\r\n        else:\r\n            print(\"failed to set permissions\")\r\n\r\n    except Exception:\r\n        raise\r\n```\r\nThe out put is this when trying to change the permission of a file from '666' to '755'\r\n\r\n```txt\r\noriginal permission 0o100666\r\nseting permissions to  0o100755\r\nmanaged to set permissions to  0o100666\r\nsuccess\r\n```\r\n__Expected behaviour:__ \r\nI expect that I can change permission on files with only read-access, as long as the authenticated user, has privileges todo so\r\nI expected that the new file permission would be '755' after calling `setstat` with changed permissions\r\n__Actual behaviour:__ \r\nWhen I only read access has been set on a file it throws a `ssh2.exceptions.SFTPProtocolError`\r\nWhen trying to setstat it does not change, even though the `setstat()` returned a 0\r\n__Additional info:__ \r\nI am uncertain of which libssh2 I am running, as I just pip installed `ssh2-python` and it was up and running, but if I were to hazard a guess, I'd say 1.9.0","author":{"url":"https://github.com/Togtja","@type":"Person","name":"Togtja"},"datePublished":"2020-10-13T11:08:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":12},"url":"https://github.com/119/ssh2-python/issues/119"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:b7fbce0f-52cf-cff7-222c-65c53b7f0351
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE358:3B507F:16BCBA2:1F5AC9A:696AA7DC
html-safe-noncef339a747f5c0e6b1fe802f2b07be2ca0dfdbd3f83207a02287650f5080cd21db
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzU4OjNCNTA3RjoxNkJDQkEyOjFGNUFDOUE6Njk2QUE3REMiLCJ2aXNpdG9yX2lkIjoiMTg2NzU0NjI3MTM0OTkwOTQ2OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacf4f092632ff8c34694ea141c70b35b659da7e4f39c414f0a0f85f40da03add6d
hovercard-subject-tagissue:720128101
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/ParallelSSH/ssh2-python/119/issue_layout
twitter:imagehttps://opengraph.githubassets.com/a201a1f7527e4687cffd28d3812178df9e5b215fc4b83d9ee9a941937913eda4/ParallelSSH/ssh2-python/issues/119
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/a201a1f7527e4687cffd28d3812178df9e5b215fc4b83d9ee9a941937913eda4/ParallelSSH/ssh2-python/issues/119
og:image:altBug reports I tried to set permission on a file on a SFTP server. I use normally use FileZilla to interact with the server, but I needed a fast way to change a lot of files, file permission. So I t...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameTogtja
hostnamegithub.com
expected-hostnamegithub.com
None3eaf9b8cf1badcd7041a8ad480b9d9b28bea0ef1cc821ca9ff20f2cc7f4fe4b9
turbo-cache-controlno-preview
go-importgithub.com/ParallelSSH/ssh2-python git https://github.com/ParallelSSH/ssh2-python.git
octolytics-dimension-user_id22918200
octolytics-dimension-user_loginParallelSSH
octolytics-dimension-repository_id98586974
octolytics-dimension-repository_nwoParallelSSH/ssh2-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id98586974
octolytics-dimension-repository_network_root_nwoParallelSSH/ssh2-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasedd9a979046e6382bd084e2bd873bf65f797125ff
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/ParallelSSH/ssh2-python/issues/119#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FParallelSSH%2Fssh2-python%2Fissues%2F119
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FParallelSSH%2Fssh2-python%2Fissues%2F119
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=ParallelSSH%2Fssh2-python
Reloadhttps://github.com/ParallelSSH/ssh2-python/issues/119
Reloadhttps://github.com/ParallelSSH/ssh2-python/issues/119
Reloadhttps://github.com/ParallelSSH/ssh2-python/issues/119
ParallelSSH https://github.com/ParallelSSH
ssh2-pythonhttps://github.com/ParallelSSH/ssh2-python
Notifications https://github.com/login?return_to=%2FParallelSSH%2Fssh2-python
Fork 74 https://github.com/login?return_to=%2FParallelSSH%2Fssh2-python
Star 236 https://github.com/login?return_to=%2FParallelSSH%2Fssh2-python
Code https://github.com/ParallelSSH/ssh2-python
Issues 0 https://github.com/ParallelSSH/ssh2-python/issues
Pull requests 1 https://github.com/ParallelSSH/ssh2-python/pulls
Discussions https://github.com/ParallelSSH/ssh2-python/discussions
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/ParallelSSH/ssh2-python/security
Please reload this pagehttps://github.com/ParallelSSH/ssh2-python/issues/119
Insights https://github.com/ParallelSSH/ssh2-python/pulse
Code https://github.com/ParallelSSH/ssh2-python
Issues https://github.com/ParallelSSH/ssh2-python/issues
Pull requests https://github.com/ParallelSSH/ssh2-python/pulls
Discussions https://github.com/ParallelSSH/ssh2-python/discussions
Security https://github.com/ParallelSSH/ssh2-python/security
Insights https://github.com/ParallelSSH/ssh2-python/pulse
New issuehttps://github.com/login?return_to=https://github.com/ParallelSSH/ssh2-python/issues/119
New issuehttps://github.com/login?return_to=https://github.com/ParallelSSH/ssh2-python/issues/119
Missing SFTP file attribute constantshttps://github.com/ParallelSSH/ssh2-python/issues/119#top
API implementationhttps://github.com/ParallelSSH/ssh2-python/issues?q=state%3Aopen%20label%3A%22API%20implementation%22
https://github.com/Togtja
https://github.com/Togtja
Togtjahttps://github.com/Togtja
on Oct 13, 2020https://github.com/ParallelSSH/ssh2-python/issues/119#issue-720128101
API implementationhttps://github.com/ParallelSSH/ssh2-python/issues?q=state%3Aopen%20label%3A%22API%20implementation%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.