- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: chmod 775 on a symbolic link (not on its targe...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
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
тАО10-13-2003 12:22 AM
тАО10-13-2003 12:22 AM
Thanks in advance.
Regards,
Romaric.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2003 12:24 AM
тАО10-13-2003 12:24 AM
Solutioncc -o lchmod lchmod.c
#include
#include
#include
#define assign_errno(x) ((errno != 0) ? errno : (x))
static void problem(msg,err)
char *msg;
int err;
{
(void) fprintf(stderr,"%s - (%d)\n",msg,err);
(void) fflush(stderr);
return;
} /* problem */
int main(argc,argv)
int argc;
char *argv[];
{
int cc = 0;
char s_err[512];
if (argc > 2)
{
mode_t mode = 0;
char *dummy = NULL;
int i = 2;
mode = (mode_t) strtoul(argv[1],&dummy,8);
while (i < argc && cc == 0)
{
cc = lchmod(argv[i],mode);
if (cc != 0)
{
cc = assign_errno(-1);
(void) sprintf(s_err,"%s failed. File '%s'",argv[0],argv[i]);
problem(s_err,cc);
}
++i;
}
}
else
{
cc = 255;
(void) sprintf(s_err,"Usage: %s Octal_Mode file1 [file2 ...]",
argv[0]);
problem(s_err,cc);
}
return(cc);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2003 12:25 AM
тАО10-13-2003 12:25 AM
Re: chmod 775 on a symbolic link (not on its target)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2003 12:43 AM
тАО10-13-2003 12:43 AM
Re: chmod 775 on a symbolic link (not on its target)?
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2003 01:45 AM
тАО10-13-2003 01:45 AM
Re: chmod 775 on a symbolic link (not on its target)?
There was a thread very similar to this about a month earlier. I think that you will find that the actual author of that C code is none other than A. Clay Stephenson.
Please see the attached link for other ways to handle your problem.
http://forums1.itrc.hp.com/service/forums/parseCurl.do?CURL=%2Fcm%2FQuestionAnswer%2F1%2C%2C0xffcd12980463e24797ab1fdd8ed71fe0%2C00.html&admit=716493758+1066052317656+28353475
Greg