- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How can I set users parameter by compiled file
Categories
Company
Local Language
Forums
Discussions
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2004 10:40 PM
04-20-2004 10:40 PM
L-Class
I need to set user parameter by compiled file.
Because user do not know what parameter was set
or which file is setted, so i tried to compile
putenv fuction.
#include
#include
void main(int argc, char *argv[])
{
putenv("USERPASS=/tmp/dir01");
system("export USERPASS");
system("echo $USERPASS");
}
when i put this compiled exec module in
user .profile user cannot login
How do i set the user parameter by compiled file.
Thanks everyone. ^^;
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2004 11:27 PM
04-20-2004 11:27 PM
Solutionputenv should work but there is no need to do the system(export) because you have already put the thing in the environment (and as you run the export in a different shell anyway, the only reason it does anything at all is because you already exported it with putenv()) .
When you run the program try calling it with a preceding "." as in ". ./program". Because otherwise you are putting things in the environment of the program, not your running shell.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2004 11:41 PM
04-21-2004 11:41 PM
Re: How can I set users parameter by compiled file
export USERPASS=/tmp/dir01
Then the getenv will recover it.
-or-
wrap a script around your program
#!/bin/ksh
export USERPASS=/tmp/dir01
myProgram
They run the script which sets the environment and myProgram recovers the environment variable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2004 02:04 AM
04-22-2004 02:04 AM
Re: How can I set users parameter by compiled file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2004 04:00 AM
04-22-2004 04:00 AM
Re: How can I set users parameter by compiled file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2004 12:50 PM
04-22-2004 12:50 PM
Re: How can I set users parameter by compiled file
I found the crypt function is Good solution
in this situation.
I set the all user environment variable and
connection password in the shell program
and encode the script. ^_^;
When i need the environment variable, I run cript ...(key?) < clear >cypher
cript will be a good solution
Thanks everyone
thanks for good answer.
Good luck to everyone.