Exists a typical symbolic link to the existing customers residence directory site?

The covering can expand ~ to your residence directory site. $HOME generally has the very same bargain, yet usually you intend to describe the existing customers residence directory site from a context that might not sustain such development.

I have actually had config documents where $HOME functions yet ~ does not and also the other way around.

I would certainly presume that fuse can give something along these lines, something like /var/myself -> $HOME

With that said I can position values in config documents to indicate points like /var/myself/backdrops/pornography/wtf/yarly.jpg

Exists something similar to this currently? Otherwise, exist excellent factors for there not being something similar to this?

2019-05-05 03:00:50
Source Share
Answers: 4

Most programs permit you to define a course to the arrangement documents on the command line. So you can write a wrapper that takes a typical arrangement documents, filters it to replace points like $HOME for the existing customer, and afterwards passes the changed, short-lived arrangement documents to the program.

2019-05-08 14:14:54

One method (on Linux, at the very least) would certainly be to transform directory site to $HOME prior to running the application and afterwards make use of /proc/self/cwd/... in the config documents.

2019-05-08 06:21:59

I recognize your problem yet the solution is "no" there is not such point.
The common method is to ask the OS the customer's residence course, or get the $HOME variable.

All these alternatives requires constantly some coding from the application. A great deal of applications, like celebration, supply the "pen name" ~ (open (2) does not convert that).

Certainly a vfs or a fuse component can be applied to do this. Possibly there is something to do that, I am mosting likely to ask that!

Yet is it actually required? You can make use of a workaround like :

2019-05-08 04:51:26

You can get the pid of requestin customer and also ask system of his/her residence directory site. So it is feasible.

Nonetheless I'm not exactly sure if there is no SUID programs that would certainly think FS as fixed.

Modify :

struct fuse_context *ctx = fuse_get_context ();
struct passwd pwd, *ppwd;
char buffer[1024];
int status = getpwuid_r (ctx->ui, &pwd, buffer, sizeof(buffer), &ppwd);
if (status == 0) {
  if (ppwd == NULL) {
    // No record found
  } else {
    // Handle record
} else {
    // Handle error

The above code is not excellent yet need to do benefit usual instances.

2019-05-08 04:48:27