101 |
#if ENABLE_FEATURE_INSTALL_LONG_OPTIONS |
#if ENABLE_FEATURE_INSTALL_LONG_OPTIONS |
102 |
applet_long_options = install_longopts; |
applet_long_options = install_longopts; |
103 |
#endif |
#endif |
104 |
opt_complementary = "s--d:d--s" USE_SELINUX(":Z--\xff:\xff--Z"); |
opt_complementary = "s--d:d--s" IF_FEATURE_INSTALL_LONG_OPTIONS(IF_SELINUX(":Z--\xff:\xff--Z")); |
105 |
/* -c exists for backwards compatibility, it's needed */ |
/* -c exists for backwards compatibility, it's needed */ |
106 |
/* -v is ignored ("print name of each created directory") */ |
/* -v is ignored ("print name of each created directory") */ |
107 |
/* -b is ignored ("make a backup of each existing destination file") */ |
/* -b is ignored ("make a backup of each existing destination file") */ |
108 |
opts = getopt32(argv, "cvb" "Ddpsg:m:o:" USE_SELINUX("Z:"), |
opts = getopt32(argv, "cvb" "Ddpsg:m:o:" IF_SELINUX("Z:"), |
109 |
&gid_str, &mode_str, &uid_str USE_SELINUX(, &scontext)); |
&gid_str, &mode_str, &uid_str IF_SELINUX(, &scontext)); |
110 |
argc -= optind; |
argc -= optind; |
111 |
argv += optind; |
argv += optind; |
112 |
|
|
129 |
if (opts & OPT_PRESERVE_TIME) { |
if (opts & OPT_PRESERVE_TIME) { |
130 |
copy_flags |= FILEUTILS_PRESERVE_STATUS; |
copy_flags |= FILEUTILS_PRESERVE_STATUS; |
131 |
} |
} |
132 |
mode = 0666; |
mode = 0755; /* GNU coreutils 6.10 compat */ |
133 |
if (opts & OPT_MODE) |
if (opts & OPT_MODE) |
134 |
bb_parse_mode(mode_str, &mode); |
bb_parse_mode(mode_str, &mode); |
135 |
uid = (opts & OPT_OWNER) ? get_ug_id(uid_str, xuname2uid) : getuid(); |
uid = (opts & OPT_OWNER) ? get_ug_id(uid_str, xuname2uid) : getuid(); |
175 |
} |
} |
176 |
} |
} |
177 |
|
|
178 |
/* Set the file mode */ |
/* Set the file mode (always, not only with -m). |
179 |
if ((opts & OPT_MODE) && chmod(dest, mode) == -1) { |
* GNU coreutils 6.10 is not affected by umask. */ |
180 |
|
if (chmod(dest, mode) == -1) { |
181 |
bb_perror_msg("can't change %s of %s", "permissions", dest); |
bb_perror_msg("can't change %s of %s", "permissions", dest); |
182 |
ret = EXIT_FAILURE; |
ret = EXIT_FAILURE; |
183 |
} |
} |