How does one make Samba change the owner of a file when it is edited? - samba

I want to add some basic accountability to a Samba share without going all out with the audit logging module. If a file is owned by user1:usergroup and user2 edits it, is it possible for the ownership status to change automatically to user2:usergroup?

Samba can't automatically change the ownership of the file for you if it's edited. It would be possible to write a Samba VFS plugin that can do this for you, but at that point you're probably better off setting up the audit module.

Related

AEM Connected assets setup / configuration

When trying to configure connected assets in AEM, on the Sites instance, the connected configuration save option gets disabled after the initial setup.
Not able to save subsequent edits to the configuration, even when trying with admin credentials.
Is there any configuration to check why the save is disabled? Where under the jcr is this configuration stored?
The configuration is stored under the node /conf/global/settings/dam/remotedam/configuration/jcr:content
We can directly make edits to the properties under this node. However the remote assets instance password is stored as encrypted value. In case edit is required on the password filed, the best option as of now seems to be delete the jcr:content node at this path and reconfigure it through the UI.
Deleting the jcr:content node at this path is the only option I could find to enable the save option on the UI.
This certainly is a bug in this newly introduced feature in AEM 6.5. Hopefully will get addressed in a service pack.
As indicated in the answer - https://stackoverflow.com/a/56945996/1592801,
You don't need to delete the configuration node
Re-entering the password works - and that is working as designed.
The save button is disabled, because there have been no edits in the form to save. Once you make a change, you should be able to see the button enabled.

How to prevent Google from changing your /etc/hosts file when you restart the network service?

Whenever I change the /etc/hosts file and restart the network service, Google overwrites the file.
So, it is impossible to do. Your server does not directly contain a public IP address. Yes, this screws things up with certain pieces of software, such as ISPConfig. There literally is no way to run ISPConfig on Google currently. Thankfully several other web hosting control panels (cPanel and InerWorx) work with a little bit of hacky configuration. If you want to know how to configure them, reply below.

buildpublish to a different server

I am trying to use buildpublisher in the ccnet.config to copy some files over after the build. I am able to do this locally on the server but if I try to copy it over to another server that is on the same network it doesnt go. I think it has to do with security settings but I am not seeing anything in the Documentation about setting a user/pass security setting or anything. Any suggestions on what do do?
<buildpublisher>
<sourceDir>C:\Build\Publish\</sourceDir>
<publishDir>\\remoteserver\Site</publishDir>
<cleanPublishDirPriorToCopy>true</cleanPublishDirPriorToCopy>
<useLabelSubDirectory>false</useLabelSubDirectory>
<description>Build publish</description>
</buildpublisher>
You need to share the \remoteserver\Site directory. Also make sure the user (or service account) that runs the CruisControl.Net service has read/write permissions on the shared directory. We use nant to copy files from Clear Case to another server with this method.

Hudson sourcesafe Plugin problem

i have a question. I use VSS (SourceSafe) Plugin in Hudson. But I don't have rights for a file. If I start my job, I have the following error: "Access to file ... denied" and Hudson stops the build. How can I ignore this error and continue the build ? Thank You in advance.
Without knowing the specifics, you will have to tell Visual SourceSafe to ignore that file for the specific user being used so that the file isn't retrieved when the job is started. Otherwise, you will have to get the necessary permissions to retrieve the file. I doubt there is anything you can do in Hudson to prevent the build from failing.
The plug-in configuration allows you to specify the user that accesses the SourceSafe repository. Normally what you should do is create a CI/build user and use that information to get access to any files involved in the build.
You can verify the user has access by attempting to open the 'srcsafe.ini' file over the network using that same information. If it works, you should be able to retrieve files from VSS via Hudson. If it doesn't, then you'll have to poke around more in your environment.
Basically, just make sure you can get things running manually first using the same account information before you try and integrate your build into Hudson.

How to restrict user access the file on the HTTP Server?

I'm writing a web application that allow user upload their files on the app. The file will be uploaded on the HTTP Server, after the user click the "upload" button. The user can receive the file by getting the file from the path.... ...for example: http://www.demo.com/user/abc/download/the_file.jpg
but I found that all the people can access this file using the path. How can I do, or is there a better way to manage the file that only registered user or the file owner can download the file?
Serving a file directly within a script is not an option because of performance issues and it's not really possible to serve BIG files because of memory limits.
The best option is to use the Apache module mod_xsendfile. The idea is to redirect all requests to a
PHP/Perl/Python script which will just set a HTTP header saying "Hey Apache, serve this file instead" and mod_xsendfile will take care of it.
And the client will never be able to download the file without this authentication.
If using something like apache httpd, you can use .htaccess files and have directories that are provisioned to users or groups if you want the user to continue accessing files at a path on the filesystem.
If you lock down the directory and have a script to manage file delivery, you can check permissions in the script and give the user the file requested or a 403.
I tend to use the script approach as it gives me more control over how the permissions are managed and more complex access scenarios.